Android statusbar icons color
Yes it’s possible to change it to gray (no custom colors) but this only works from API 23 and above you only need to add this in your values-v23/styles.xml <item name=”android:windowLightStatusBar”>true</item>
Yes it’s possible to change it to gray (no custom colors) but this only works from API 23 and above you only need to add this in your values-v23/styles.xml <item name=”android:windowLightStatusBar”>true</item>
Here’s a natural way to do it with styles: If your AppTheme is inherited from Theme.MaterialComponents, then: <style name=”AlertDialogTheme” parent=”ThemeOverlay.MaterialComponents.Dialog.Alert”> <item name=”buttonBarNegativeButtonStyle”>@style/NegativeButtonStyle</item> <item name=”buttonBarPositiveButtonStyle”>@style/PositiveButtonStyle</item> </style> <style name=”NegativeButtonStyle” parent=”Widget.MaterialComponents.Button.TextButton.Dialog”> <item name=”android:textColor”>#f00</item> </style> <style name=”PositiveButtonStyle” parent=”Widget.MaterialComponents.Button.TextButton.Dialog”> <item name=”android:textColor”>#00f</item> </style> If your AppTheme is inherited from Theme.AppCompat: <style name=”AlertDialogTheme” parent=”ThemeOverlay.AppCompat.Dialog.Alert”> <item name=”buttonBarNegativeButtonStyle”>@style/NegativeButtonStyle</item> <item name=”buttonBarPositiveButtonStyle”>@style/PositiveButtonStyle</item> </style> <style name=”NegativeButtonStyle” parent=”Widget.AppCompat.Button.ButtonBar.AlertDialog”> … Read more
in your adapter add this class: private class VIEW_TYPES { public static final int Header = 1; public static final int Normal = 2; public static final int Footer = 3; } then Override the following method like this: @Override public int getItemViewType(int position) { if(items.get(position).isHeader) return VIEW_TYPES.Header; else if(items.get(position).isFooter) return VIEW_TYPES.Footer; else return VIEW_TYPES.Normal; … Read more
When you use android:background, you are replacing much of the styling and look and feel of a button with a blank color. Update: As of the version 23.0.0 release of AppCompat, there is a new Widget.AppCompat.Button.Colored style which uses your theme’s colorButtonNormal for the disabled color and colorAccent for the enabled color. This allows you … Read more
Update with Android 8.0 Oreo Even though the question was originally asked for Android L support, people still seem to be hitting this question and answer, so it is worth describing the improvements introduced in Android 8.0 Oreo. The backward compatible methods are still described below. What changed? Starting with Android 8.0 Oreo, the PHONE … Read more
To extend Muzikant’s Solution #2, can someone please try the solution below on an Android 5.0 rooted device (as I currently do not possess one) and let me know if it works or does not work. To enable or disable mobile data, try: // 1: Enable; 0: Disable su -c settings put global mobile_data 1 … Read more
Note: This has been updated to reflect the release of API 21, Lollipop. Be sure to download the latest SDK. In one of my modules I had the following in build.gradle: dependencies { compile ‘com.android.support:support-v4:+’ } Changing this to dependencies { // do not use dynamic updating. compile ‘com.android.support:support-v4:21.0.0’ } fixed the issue. Make sure … Read more
Method #1: To achieve a completely transparent status bar, you have to use statusBarColor, which is only available on API 21 and above. windowTranslucentStatus is available on API 19 and above, but it adds a tinted background for the status bar. However, setting windowTranslucentStatus does achieve one thing that changing statusBarColor to transparent does not: … Read more
I had to add a footer to my RecyclerView and here I’m sharing my code snippet as I thought it might be useful. Please check the comments inside the code for better understanding of the overall flow. import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; public class RecyclerViewWithFooterAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { … Read more
This message sounds like your project is too large. You have too many methods. There can only be 65536 methods for dex. Since the gradle plugin 0.14.0 and the Build Tools 21.1.0 you can use the multidex support. Just add these lines in the build.gradle: android { defaultConfig { … // Enabling multidex support. multiDexEnabled … Read more