Dark text on dark background on AlertDialog with Theme.Sherlock.Light - android

I'm using Theme.Sherlock.Light theme for my application and I'm creating a DialogFragment with an underlying AlertDialog. It works just fine on Android 3.x and 4.x, but on Android 2.x I see dark text on dark background, which is hardly readable. Am I doing something wrong and do I need to force light background by creating a custom style? Thanks in advance.

I found solution here:
builder.setInverseBackgroundForced(true)
Also, as I see here, Jake Warton suggests fix it by the same way and he doesn't know any better solution because of AlertDialogs implementation.

Related

Android Theming toolbar isn't themed correctly

Trying to add Dark Mode to my app. I am mostly there, most things work as I expect after I made the required changes, however I have a problem with the Toolbar. What have I missed?
Screenshot of Toolbar issue, and layout
You're applying AppTheme to popupTheme, what does it have?
You don't usually need to make a custom one, one of the pre-made ones like ThemeOverlay.MaterialComponents.Toolbar is enough.
And actually, if you're using MaterialComponents, you don't need to apply anything to your app to make it work in Dark Mode, just use the DayNight MaterialComponents theme.

How to change theme of the keyboard for android in react-native app?

I have an app on react-native with two themes: light and dark. And it looks not so nice when the keyboard in the light colours appears in the dark theme. I need to change the theme of the keyboard depends on my app theme. On IOS it is possible to make with keyboardAppearance(enum('default', 'light', 'dark')) property from TextInput https://reactnative.dev/docs/textinput.html#keyboardappearance. But it is not working on Android. Does somebody know a good way to do it?
you can find a solution for this issue at https://reactnative.dev/docs/textinput.html
be careful

AppCombat v21 TextAppearance on Gingerbread with DarkActionBar

i recently updated the appcombat library to integrate the material design.
But there is an issue with the style "Theme.AppCompat.Light.DarkActionBar", because if i use this style and let my TextView like:
android:textAppearance="?android:attr/textAppearanceSmall
the whole text appears invisible (or just white) on a white background
If a use the "Theme.AppCompat.Light" theme, everything is working fine.
This issue i have only on Devices running android 2.3.*
Samples: (Don't have enough reputation to post images, so you need to click)
DarkActionBar:
Light:
Any suggestions guys? Anyone tried the new appcombat library with Gingerbread?
Obviously i found out that i need to use material text appeareance, for instance:
android:textAppearance="#style/TextAppearance.AppCompat.Body1"
See also:
http://www.google.com/design/spec/style/typography.html#typography-roboto-noto

Using holo light colors in android Lower API

The problem is that when I am using Holo theme colors for my app I am getting error that #android:color/ holo_bright_ blue requires higherAPI. I am using appcompat for my app. Any way to use holo theme colors in lower API?
You could use an approximation of the color instead of using the android reference. For instance, holo_blue_bright is fairly close to #31B6E7
You could try to use HoloEveryWhere library, that brings holo widgets and themes to the <4.0 devices.
I don't know if this would help you with your specific question, but it probably should.

How do I use common UI styles in Android?

I am writing my little Android app. I pop up a dialog control which is a nice, non-fullscreen, rounded-corners dialog by setting android:theme="#android:style/Theme.Dialog" on the activity in my manifest. That all works just as I expected. However it is just a drab, grey-titled dialog as in this screenshot:
I've noticed however that a LOT of applications, when they pop up dialogs have a nice, blue-themed title as in this screen shot.
I would assume this theme is some common theme, as it shows up in a LOT of different apps. I would assume it is something built in to the OS. (My phone is a Captivate with the official Froyo release). Of course it COULD be something that every developer simply re-coded on their own, but I doubt that.
Assuming that this is a common theme, how do I utilize it in my app? What changes do I need to make to my activity to have it use that theme?
Thanks in advance!
You can set your activity to use a default theme like Theme.Black. There are default themes and they are in R.style - although i'm not sure which are available to which platforms(i.e. i think the holo themes are for 3.0 and up...
http://developer.android.com/reference/android/R.style.html
see here http://developer.android.com/guide/topics/ui/themes.html for defining your own custom themes and scroll all the way down for using the "platform styles" and themes.
Rather messy (there doesn't seem to be a good reference for this), but the platform styles are defined in \platforms\android-\data\res\values\styles.xml and \platforms\android-\data\res\values\themes.xml. You can dig through those and figure out the theme/style IDs that are available at compile time.
Other than that its really just trial and error.
To make a dialog you need to extend the dialog class. And to have a nice title bar you can use:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
and have your own custom title.
to have a title use:
setTitle("MyTitle");
You can also assign your custom view for the title.

Categories

Resources