mathisdt / trackworktime

Android app to track your work time via WiFi or location and categorize each recorded intervall by a predefined client/task and a free text.
https://zephyrsoft.org/trackworktime
GNU General Public License v3.0
136 stars 30 forks source link

update widget design for Android 12 #256

Closed hadrienbecle closed 9 months ago

hadrienbecle commented 1 year ago

Hi :)

I've updated the widget to the new design guidelines (see https://developer.android.com/guide/topics/appwidgets). This includes:

Some screenshots:

Before/after on Android 8:

widget-android8-petite

Before/after on Android 12 with light mode:

widget-android12-light-petite

Before/after on Android 12 with dark mode:

widget-android12-dark-petite

Image preview of the widget (< Android 12):

widget-android12-oldpreview-petite

Layout preview of the widget (Android 12):

widget-android12-preview-petite

mathisdt commented 1 year ago

Hi @hadrienbecle, thank you for your contribution! This looks really sleek. :sunglasses:

While testing I found out that on API level 21 (Android 5 is the minimum version for TWT) through 28 the widget background is white now, with no possibility to change it as the dark mode does not exist in the system yet. I think that the background should stay the same color for those old Android versions - could you please add that to the PR?

(BTW: The preview has the dark background, but the resulting widget does not.)

hadrienbecle commented 10 months ago

So, this is weird, but the DayNight theme works as expected on my Android 8 device (API level 26). I can choose a light or dark mode, and the widget respects that.

I suspect Galaxy Themes sort of sets a dark mode system variable that was only made generally available on Android 10+, but I wasn't able to find any info on that...

I've updated to use the Material 3 Dark theme on devices below API level 28. I can't switch anymore between light or dark on my Samsung device, but at least it defaults to dark mode on other older devices (tested with the Android emulator).

mathisdt commented 9 months ago

@hadrienbecle Thanks for your work! (And sorry that it took me so long to find the time for having a look at it.)