android-How to use dark theme for dialog on api8+ - android

this is the dialog I have right now :
as you can see, it's white . How can I use dark theme for this dialog ? I want to make it dark .
I'm using appcompact and I want it to work on api+8 .

I'm sorry to simply link to a library, but that's the only way I know to make that work on such old API levels.
library:AlertDialogPro#github (API 7+)
<style name="YourAppTheme">
<item name="alertDialogProTheme">#style/Theme.AlertDialogPro.Material</item>
</style>
A README and a demo application is included.

Related

BoxInsetLayout on Android wearable round screen not working with Theme.AppCompat

I'm developing an app for Android wearables. I want to create a layout working on both round and square screens. Therefore I'm using BoxInsetLayout.
I also want to use a CheckBox from Material Theme. Therefore I'm using a custom theme derived from Theme.AppCompat.Light.
<style name="AppTheme" parent="#style/Theme.AppCompat.Light">
The problem is that BoxInsetLayout is not working properly on round screens. I'm having the same issue as described here but the solution mentioned there is not working for me. The relevant code parts are the same except the theming part.
When I switch the theme to Theme.DeviceDefault I only get the CheckBox from Holo.
Try adding:
<item name="android:windowOverscan">true</item>
to your theme. It is necessary for dispatching insets.

Android number picker style

I have the following problem : I want to use Theme.NoTitleBar.Fullscreen for my application parrent theme, but with this theme the number picker looks in the older way (with "+" and "-"), but I want to looks like the new way (with the blue dividers). Is there a way to achieve this? It will be sad (and I will lose a lot of time) to write my own picker only, because of the theme ? I will be glad if someone has simple solution. I google it but I insist to not change the style, because the application was always with this style and it will be strange to change the whole style only for that.
Thanks in advance.
P.S. I try not to make this theme parent theme and just to copy
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">#null</item>
this properties in my theme, but then application is not in full screen i.e. not working properly (like with make Theme.NoTitleBar.Fullscreen parent theme ) .
P.S.2 There is Theme.Holo.NoActionBar.Fullscreen and I thing it should work, but I'm not sure what is the difference between it and Theme.NoTitleBar.Fullscreen.
I will be glad if someone enlighten me.

Dark ActionBar in Holo Dark

I am developing an Android app on Android Studio and I would like to use the Holo Dark theme but in the KitKat version, I mean, how it appears on the picture I attach below.
I'm testing the app on a KitKat AVD, and in the manifest the maximum and target SDK version is 19, but the action bar is like in the pic below:
I just want to get the design like in the first image, so if anyone knows how, please tell me.
You have to use the Solid ActionBar:
<style name="Theme.Whatever" parent="#android:style/Theme.Holo">
<item name="android:actionBarStyle">#android:style/Widget.Holo.ActionBar.Solid</item>
</style>

Properly set SeekBar style for Holo and pre-Holo APIs

After setting SeekBar with Holo style, I got warning that it's not supported pre-Holo APIs.
If I leave it this way, will this crash the app or pull pre-Holo style anyway? It does not crash on the emulator and I don't have 2.3.3 device.
The reason for asking his is odd behaviour. I tried to manually set style for Holo and pre-Holo using res/values-v11/ directories and placing styles.xml in each and setting the style of SeekBar to style="#style/settings_seekbar" .
Style for API 11+ looked like this
<style name="settings_seekbar">
<item name="android:seekBarStyle">#android:style/Widget.Holo.SeekBar</item>
</style>
and style for APIs older than 11 looked like this
<style name="settings_seekbar">
<item name="android:seekBarStyle">#android:style/Widget.SeekBar</item>
</style>
So it looked like this would work. But on either device with Android 4.0+, I don't see Holo's theme, but the old thick-yellow theme.
If this is the proper way of settings styles (in case the first solution will crash a device), where did I make a mistake thus Holo theme never appeared on newer devices?
It seems we can safely use a theme from the upper SDK because I found no indicators that it will ever crash the app.
If the theme does not exist, Android will use the appropriate lower-level theme.
The error we can see on the image is just a warning that UI will not look the same in the SDKs which do not support this theme.

Android custom theme on 2.3, holo theme on 4.0

I read http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html but have some issues. For pre-honeycomb I want a custom title, for post-honeycomb I want the default. When I try to run my app on ICS
android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
If I remove the custom title it works fine on all releases, just without the custom title.
in values-v11 I have themes.xml file with this content:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="customTheme" parent="android:Theme.Holo.Light">
</style>
</resources>
So my theme document says to use no custom theme basically.
If I remove
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);
then the theme shows up correctly on ICS.
I cannot imagine that I have to check on coding level what API level I run and either request the window feature or not, that should be handled by the system.
Thanks, A.
Pretty similar to this question. I guess the action bar is considered a title feature, so turning it off gets rid of the exception.
I'm still a bit confused by the question though. You say you want the default title for post-honeycomb, but you can't use a custom title and also use the default actionbar. If you really want to do what you're asking (custom title for < 3.0, default actionbar for >= 3.0), then you'll need to check Build.VERSION.SDK_INT before calling window.requestFeature etc. That's how it's done in the actionBarCompat example that does just this sort of thing.

Categories

Resources