android-appcompat

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

馋奶兔 提交于 2019-12-22 07:19:10
问题 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

Apply theme to button programmatically

岁酱吖の 提交于 2019-12-22 06:49:33
问题 Is it possible to apply Widget.AppCompat.Button theme to button programmatically? Button button = new Button(context); button.setText("Button"); Currently, I am using custom drawable resource that tries to implement a style like a AppCompat theme, but I think it might be implemented easier. In the layout it implements like: <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:theme="@style/ThemeBasedOnAppcompatButton"/> Thanks in advance. 回答1: You should

how can i show icon app in Lollipop Toolbar?

大城市里の小女人 提交于 2019-12-22 06:38:14
问题 I am missing an app icon after switching from ICS ActionBar to Lollipop toolbar . Is it possible? Please help me. Thanks mDrawerToggle.setDrawerIndicatorEnabled(false); 回答1: The use of application icon and a title is discouraged on API 21,according to Material Design. Anyway if you want to use an icon, you can use the setLogo method in your Toolbar. 来源: https://stackoverflow.com/questions/27768109/how-can-i-show-icon-app-in-lollipop-toolbar

Android: unable to change color of back arrow navigation icon

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 06:37:39
问题 I'm using new android appcompat toolbar. I need to set the same custom color to both burger icon and back arrow icons. Using drawerArrowStyle allows me to change burger icon but not the arrow. The issue is only on Lollipop devices, anything pre-lollipop is fine. Here is the code: Toolbar: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id

Attribute already defined with incompatible format (Original attribute defined here)

元气小坏坏 提交于 2019-12-22 04:53:27
问题 Can't build project after adding compile 'com.android.support:design:24.2.0' Keeps giving the following errors: Seems like, the problem is with supporting vector drawables. Somewhere some attributes are added twice. For instance, built values.xml file contains: <declare-styleable name="AppBarLayout_LayoutParams"><attr name="layout_scrollFlags"><flag name="scroll" value="0x1"/><flag name="exitUntilCollapsed" value="0x2"/><flag name="enterAlways" value="0x4"/><flag name="enterAlwaysCollapsed"

getActionBar from Fragment with AppCompatLibrary

那年仲夏 提交于 2019-12-22 04:42:27
问题 I'm look for the easiest way to get an ActionBar instance from a Fragment using AppCompatLibrary and API 8. Already tried things like getActivity().getSupportActionBar() but no luck. 回答1: Try to cast it: ((YourActivity)getActivity()).getSupportActionBar() 来源: https://stackoverflow.com/questions/17954471/getactionbar-from-fragment-with-appcompatlibrary

Primary color (sometimes) goes transparent

偶尔善良 提交于 2019-12-22 04:38:05
问题 I am developing with the latest SDK version (API 21) and Support Library 21.0.2 and I've been having trouble when trying to implement the new Material Design guidelines. Material Design says that I need to have my primary color and my accent color and apply them over my app. But sometimes when I open the app the primary color becomes transparent in some widgets, it goes back to normal until I close the app (with the Back Button) and launch it again. Here is an example of the primary color

Xamarin Forms 2.0 AppCompat android keyboard mode

我与影子孤独终老i 提交于 2019-12-21 22:20:03
问题 Xamarin I updated to version 4, Forms and 2.0 versions. On Android, I use AppCompat. I had a problem. Previously, the Android keyboard caused resize view. Now this does not happen. The keyboard appears on the top view. And the desired Elements to be hiding. I've tried: [Activity(WindowSoftInputMode = SoftInput.AdjustResize, Label = "Title", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

Android Notification with DecoratedCustomViewStyle

…衆ロ難τιáo~ 提交于 2019-12-21 21:42:24
问题 I'm trying to create a Notification on Android 7 with a custom layout but I want to use the DecoratedCustomView Style from the v7-Support Library: https://developer.android.com/reference/android/support/v7/app/NotificationCompat.DecoratedCustomViewStyle.html The reason why I want to use this style is that I want to use the notification header provided by android, as the documentation states: Instead of providing a notification that is completely custom, a developer can set this style and

Android appCompat issue with samsung and wiko

独自空忆成欢 提交于 2019-12-21 18:02:22
问题 currently I have a little problem with my application, everything works fine on most devices but on some samsung and wiko I get this error : java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder I saw some answers on the internet where they said to add the line below in the proguard file, in my case this doesn't work -keep class !android.support.v7.internal.view.menu.**, ** { *; } My app is compound of 2 modules(so I have 2 proguard file), 1module is for the main