android-appcompat

Programmatically tint a Support Vector

陌路散爱 提交于 2019-12-18 12:53:04
问题 Android Studio version 2.1, gradle version 2.1.0, please correct me if you spot any misinterpretations :) I am confused about support vectors in the support library 23.3.0. Specifically what I would like to do is tint an image button programmatically, whose src is defined is a vector drawable. From what I can tell this is not possible on pre-lollipop now. I have read several related posts about the changes: 23.2.0 announcement and changes: As of Android Support Library 23.3.0, support vector

appcompat-v7 v23.0.0 statusbar color black when in ActionMode

孤街醉人 提交于 2019-12-18 12:38:21
问题 UPDATE Same issue present in the latest Gmail app. I still don't understand why would Google make such unpleasant UI change. Obsessive in me goes crazy whenever I see it QUESTION I have this weird issue with appcompat-v7 23. Issue I am going to describe does not happen with 22 series You can get source code that reproduces this issuse form https://github.com/devserv/t/ Once built, you can tap and hold an item in the list to activate ActionMode Issue: When in ActionMode, appcompat turns status

How to change AppCompat v21 toolbar theme programmatically?

*爱你&永不变心* 提交于 2019-12-18 12:15:01
问题 This is my toolbar xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" app:contentInsetEnd="0dp" app:contentInsetStart="0dp" android:layout_height="@dimen/toolbar_height" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" android

Android support library increases APK size a lot

北城以北 提交于 2019-12-18 12:13:01
问题 I'm using AppCompat support library in my Android project. AppCompat has plenty of drawables and resources which I don't use in my app. That unnecessary files increases my 900K app to above 2M , which I don't like. Is there any way to exclude those files when creating the APK file? Or I should obfuscate the library in my code instead of making a dependency? I'm using Gradle in Android Studio. Thanks EDIT 1 I am using proguard already. but proguard can't know I don't want to have drawable

Android toolbar back arrow with icon like WhatsApp

女生的网名这么多〃 提交于 2019-12-18 11:34:54
问题 How to display icon with back arrow in android toolbar like WhatsApp ? I use below code to set back arrow & icon in toolbar. toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); toolbar.setLogo(icon); but i got result as below image. I want icon immediate next after back arrow. I don't want any gap between back

Android toolbar back arrow with icon like WhatsApp

*爱你&永不变心* 提交于 2019-12-18 11:34:07
问题 How to display icon with back arrow in android toolbar like WhatsApp ? I use below code to set back arrow & icon in toolbar. toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); toolbar.setLogo(icon); but i got result as below image. I want icon immediate next after back arrow. I don't want any gap between back

“Field can be converted to a local variable” message appearing when setting Android ActionBar colour

时光怂恿深爱的人放手 提交于 2019-12-18 11:05:05
问题 After setting the colour of the Action Bar, actionBarColor in private String actionBarColor = "#B36305"; gets highlighted yellow and a warning is returned for some reason. What can be done to get rid of this warning? Field can be converted to a local variable public class MainActivity extends AppCompatActivity { private String actionBarColor = "#B36305"; private int getFactorColor(int color, float factor) { float[] hsv = new float[3]; Color.colorToHSV(color, hsv); hsv[2] *= factor; color =

AppCompatActivity as a dialog without title

China☆狼群 提交于 2019-12-18 10:58:35
问题 I have an Activity inherited from AppCompactActivity . in manifest for activity set theme: <style name="Theme.custom" parent="Theme.AppCompat.Light.Dialog"> <item name="android:windowNoTitle">true</item> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> <item name="colorButtonNormal">@color/accent</item> <item name="android:buttonStyle">@style/ButtonStyle</item> </style> When I run activity,

Dynamically change height of BottomSheetBehavior

99封情书 提交于 2019-12-18 10:39:07
问题 I'm using the BottomSheetBehavior from Google recently released AppCompat v23.2. The height of my bottom sheet depends on the content displayed inside of the bottom sheet (similar to the what Google does themselves in their Maps app). It works fine with the data loaded initially, but my application changes the content displayed during runtime and when this happens the bottom sheet retains at it's old height, which either leads to unused space at the bottom or a cut of view. Is there any way

HowTo use support.v7.preference with AppCompat and potential drawbacks

南楼画角 提交于 2019-12-18 10:24:31
问题 I was trying to implement preferences for an AppCompat app, using support.v7.preference. It took me a couple of days to fiddle through it, since support.v7.preference has some significant differences to the native preferences... which isn't too bad once you know, but unfortunately there's little documentation out there. I thought I'd share my findings so others don't have to go through the same pain. So... question: How do you best implement Preferences for AppCompat apps (with