Is there an API to detect which theme the OS is using – dark or light (or other)?

Google has just published the documentation on the dark theme at the end of I/O 2019, here. In order to manage the dark theme, you must first use the latest version of the Material Components library: “com.google.android.material:material:1.1.0-alpha06”. Change the application theme according to the system theme For the application to switch to the dark theme … Read more

Modifying the color of an android drawable

So after a lot of trial and error, reading different articles, and most importantly, going through the API Demos (ColorFilters.java — found in com.example.android.apis.graphics) I found the solution. For solid images, I have found it is best to use the color filter PorterDuff.Mode.SRC_ATOP because it will overlay the color on top of the source image, … Read more

How to change tab style in Android?

You could adjust the tabs via code – here’s an excerpt from my application, but you could also assign themes instead of the background image directly. (I haven’t used a way via xml attributes yet, not sure if that’s available as well somehow). private void initTabs() { tabs = (TabHost) findViewById(R.id.tabhost); tabs.setup(); tabs.setBackgroundResource(R.drawable.bg_midgray); TabHost.TabSpec spec; … Read more

Customize sphinxdoc theme

All I wanted is to add ReST strikethrough in my sphinx doc. Here is how I did it: $ cd my-sphinx-dir $ mkdir -p theme/static $ touch theme/theme.conf $ touch theme/static/style.css In theme/theme.conf: [theme] inherit = default stylesheet = style.css pygments_style = pygments.css (this makes it look like the default theme (l. 2)) In theme/static/style.css: … Read more

Themes in Android?

I would start with Google’s page on Styles and Themes. Many of your questions are answered there. http://developer.android.com/guide/topics/ui/themes.html Here’s a simple tutorial: http://developerlife.com/tutorials/?p=309 EDIT: If you are talking about themes for the phone instead of the app, you can create themes for specific home screen replacements such as aHome. I’m sure if you look around … Read more

Styling EditText view with shape drawable to look similar to new holographic theme for Android < 3.0

It’s a little hack, but unless you find something better, this way it should be possible. <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android” > <item> <shape > <solid android:color=”@color/border” /> </shape> </item> <!– main color –> <item android:bottom=”1.5dp” android:left=”1.5dp” android:right=”1.5dp”> <shape > <solid android:color=”@color/background” /> </shape> </item> <!– draw another block to cut-off the left and right … Read more