android-appcompat

Error:Attribute “color” has already been defined, update appcompat v-7

。_饼干妹妹 提交于 2019-12-23 07:47:00
问题 I am trying to update my appcompat-v7 in Android Studio project from v20.0.0 to 21.0.0 for use material design component but I allways get the same error: "Error:Attribute "color" has already been defined" I have not idea about what to do for fix this error, I searched in internet but I cant get the answer. Here is my gradle: android { compileOptions.encoding = "iso-8859-1" compileSdkVersion 21 buildToolsVersion "21.1.1" defaultConfig { applicationId "com.test" minSdkVersion 11

Android DrawerLayout.setDrawerLockMode() not working

99封情书 提交于 2019-12-23 07:29:16
问题 I have a Navigation Drawer ( appcompat v7 ) in my app which is working perfectly fine. Now I want to disable it, until the user buys an in-app-purchase to unlock additional functionality. So in my Activity.onCreate() , after initializing the drawer and populating it, I am calling this function: mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); This function is not doing anything. The drawer continues to open and close as normal after tapping the drawer carat in the

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8?

烈酒焚心 提交于 2019-12-23 04:35:40
问题 Have researched this to death and just cannot find the answer. I have an ActionBar using AppCompat. I am supporting up to API v7 (API v8 would do). ActionBar works perfectly from API v11. API < v11 has the problem of removing an icon (and thus a feature) from the ActionBar without supplying an Overflow. The big picture is that I have an App Logo, an App Title, and 3 Icons all squidging into the same ActionBar on a low end phone. Trying to make some room! I would be happy with 1 of 2 solutions

Customized circular checkbox in Android

拈花ヽ惹草 提交于 2019-12-23 03:09:26
问题 I am trying to get the Google apps photo select UI .. Am using Appcompat checkbox to achieve that with out success. The steps I am working on , 1. Set the checkbox background to custom circular shape 2. define custom shape in xml This is my check box xml looks like , <android.support.v7.widget.AppCompatCheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/checkBox" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android

What is the correct way to use attr for pre-lollipop devices?

大城市里の小女人 提交于 2019-12-22 18:37:34
问题 I am developing an Android application with support for Jelly Beans onwards. I have my own style defined as: <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> </style> <style name="AppTheme.Child" parent="AppTheme"> <item name="colorButtonNormal">@color/login_button_enabled</item> </style> <style name="HomeButton" parent="Widget.AppCompat.Button"> <item name="android:background">@drawable/home_button</item> </style> And drawable/home_button.xml is defined as: <?xml version="1.0"

Android Unit Tests with AppCompat project library

自闭症网瘾萝莉.ら 提交于 2019-12-22 17:12:33
问题 I have a project with some unit tests that extends ActivityUnitTestCase, but when I installed the android-support-v7-appcomapt project library to use the ActionBar, these tests have stopped working. I also have some ActivityInstrumentationTestCase2 tests and they are working fine. This is my setup protected void setUp() throws Exception { super.setUp(); Intent intent = new Intent(getInstrumentation().getTargetContext(), MyActivity.class); startActivity(intent, null, null); // The exception

Android Unit Tests with AppCompat project library

可紊 提交于 2019-12-22 17:12:12
问题 I have a project with some unit tests that extends ActivityUnitTestCase, but when I installed the android-support-v7-appcomapt project library to use the ActionBar, these tests have stopped working. I also have some ActivityInstrumentationTestCase2 tests and they are working fine. This is my setup protected void setUp() throws Exception { super.setUp(); Intent intent = new Intent(getInstrumentation().getTargetContext(), MyActivity.class); startActivity(intent, null, null); // The exception

Multiple dex files define Landroid/support/v7/app/ActionBar$DisplayOptions

拈花ヽ惹草 提交于 2019-12-22 11:27:36
问题 My Project shows no errors. Though when I run the application it says please fix the error before running your application. When I looked at Console tab it says [2015-07-10 19:50:26 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v7/app/ActionBar$DisplayOptions; [2015-07-10 19:50:26 - NavigationDrawer] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v7/app/ActionBar$DisplayOptions; I tried searching for the

Custom layout with ActionBar in appcompat causes content to overlap with action bar

独自空忆成欢 提交于 2019-12-22 07:39:27
问题 I have implemented a custom action bar layout with AppCompat : public class DoneBarActivity { public interface OnSaveActionListener { public void onSave(); } public static void setupActionBar(final ActionBarActivity activity, final OnSaveActionListener listener) { // Inflate a "Done/Cancel" custom action bar view. final LayoutInflater inflater = (LayoutInflater) activity .getSupportActionBar().getThemedContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); final View

build.gradle warning 'avoid using + in version numbers'

巧了我就是萌 提交于 2019-12-22 07:19:23
问题 This is my build.gradle app-level file. apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion "26.0.2" defaultConfig { applicationId "it.myco.app.myproj" minSdkVersion 16 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile