Android – Making activity full screen with status bar on top of it

I know that the guy asking the question may have found his own solution but for the people who are still looking for a solution this is a very simple solution but one thing it has a limitation till Kitkat so a condition is added if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); }

What are the default color values for the Holo theme on Android 4.0?

If you want the default colors of Android ICS, you just have to go to your Android SDK and look for this path: platforms\android-15\data\res\values\colors.xml. Here you go: <!– For holo theme –> <drawable name=”screen_background_holo_light”>#fff3f3f3</drawable> <drawable name=”screen_background_holo_dark”>#ff000000</drawable> <color name=”background_holo_dark”>#ff000000</color> <color name=”background_holo_light”>#fff3f3f3</color> <color name=”bright_foreground_holo_dark”>@android:color/background_holo_light</color> <color name=”bright_foreground_holo_light”>@android:color/background_holo_dark</color> <color name=”bright_foreground_disabled_holo_dark”>#ff4c4c4c</color> <color name=”bright_foreground_disabled_holo_light”>#ffb2b2b2</color> <color name=”bright_foreground_inverse_holo_dark”>@android:color/bright_foreground_holo_light</color> <color name=”bright_foreground_inverse_holo_light”>@android:color/bright_foreground_holo_dark</color> <color name=”dim_foreground_holo_dark”>#bebebe</color> <color … Read more

android themes – defining colours in custom themes

I found a solution which seems to work. First you need to define the custom color fields in attr.xml <?xml version=”1.0″ encoding=”utf-8″?> <resources> <attr name=”titleColor” format=”reference|color” /> <attr name=”introColor” format=”reference|color” /> </resources> Next you define your themes <style name=”AppTheme.MyDark” parent=”android:Theme”> <item name=”titleColor”>#FFFFFF</item> <item name=”introColor”>#FFFFFF</item> </style> <style name=”AppTheme.MyLight” parent=”android:Theme”> <item name=”titleColor”>#000000</item> <item name=”introColor”>#004444</item> </style> and finally … Read more

Get color value programmatically when it’s a reference (theme)

This should do the job: TypedValue typedValue = new TypedValue(); Theme theme = context.getTheme(); theme.resolveAttribute(R.attr.theme_color, typedValue, true); @ColorInt int color = typedValue.data; Also make sure to apply the theme to your Activity before calling this code. Either use: android:theme=”@style/Theme.BlueTheme” in your manifest or call (before you call setContentView(int)): setTheme(R.style.Theme_BlueTheme) in onCreate(). I’ve tested it with … Read more

How to use device default theme for app?

There are currently up to 3, sometimes 4 Themes available for Android devices (.Light variations and similar not included) Theme the default for the earliest versions of Android up to 2.3 Gingerbread(10), including some minor style changes in those versions Theme.Holo introduced with Android 3.0 Honeycomb (11) Theme.Material new in Android 5.0 Lollipop (21) Theme.DeviceDefault … Read more

How to change color / appearance of EditText select handle / anchor?

The worst part here was to find the “name” for this item and how it is called inside the theme. So I looked through every drawable in the android SDK folder and finally found the drawables named “text_select_handle_middle”, “text_select_handle_left” and “text_select_handle_right”. So the solution is simple: Add these drawables with customized design/color to your drawable … Read more

When should one use Theme.AppCompat vs ThemeOverlay.AppCompat?

Theme.AppCompat is used to set the global theme for the entire app. ThemeOverlay.AppCompat is used to override (or “overlay”) that theme for specific views, especially the Toolbar. Let’s look at an example for why this is necessary. App themes with an ActionBar The ActionBar is normally shown in an app. I can choose it’s color … Read more

Implementing user choice of theme

I actually have this feature in my application and additionally, I allow users to change theme at runtime. As reading a value from preferences takes some time, I’m getting a theme id via globally accessible function which holds cached value. As already pointed out – create some Android themes, using this guide. You will have … Read more

How to hide status bar in Android

Write this in your Activity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); } Check Doc here : https://developer.android.com/training/system-ui/status.html and your app will go fullscreen. no status bar, no title bar. 🙂