DatePicker / TimePicker background - APK not working on Android 5 → Theme: Dark

I use Theme → Dark, but with the TimePicker & DatePicker I get this on Android 5.x devices:
Left: Companion / right: APK

timeDatePicker_background.aia (2.4 KB)

Most of the time @Boban has an idea or solution to these problems or hopefully someone else.
(Or did I miss something, maybe in the old forum?)

Is it this:

image

I already tried to change this ...

So you have multiple devices that have the same effect?

Yes, I have 3 test devices with Android 5.x (5.0, 5.1).

And when you use the datepicker outside of App Inventor on those phones it looks good i presume.

I just tried in Genymotion on a Nexus 5 with Android 5.1. I see what you mean.

1 Like

I built the same project with Kodular: no issues!

But I have to create the app with AI2 because I am using an extension that uses the AndroidX libs (so Kodular is out). And I need the Dark mode (Theme: Dark) for various reasons.

Android 5.0 (Galaxy Note 3) - APK built with Kodular:

1 Like

Btw, unfortunately this solution no longer works:

Decompile APK, go to folder → \res\drawable\
Find the file and edit it → abc_dialog_material_background.xml
Find and change from this

<solid android:color="@android:color/white" />
to this
<solid android:color="@color/material_grey_800" />
or this
<solid android:color="@color/background_floating_material_dark" />

I got this solution from @Boban, some years ago.

As far as I can see, there doesn't seem to be a (short-term) solution / workaround for Android 5. Therefore I will have to set the minSdkVersion = 23. Too bad. But maybe there is still hope in the near future / for the next AI2 update? @ewpatton

Hi Anke

... you could DIY your own pickers.

Try this one

1 Like

Great, it works on Android 5.x. :+1:
What do you have to adjust to get that done?

As the previous approach, but I only changed the color in the same file name on \res\drawable-v21

2 Likes

It works perfectly. Many Thanks! :clap:
You're unbeatable in things like that.

I'll check tomorrow on my other test devices, if there are any problems with other Android versions (> Android 5) with this solution (workaround), but I don't thinks so.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.