Skip to content

New way to support dark theme to improve integration with system

Anjani Kumar requested to merge anjani/kdeconnect-android:system_theme into master

Summary

This patch implements the new preferred way of supporting a dark theme using DayNight theme. https://developer.android.com/guide/topics/ui/look-and-feel/darktheme which is also backwards-compatible. It also adds a new theme picker in the main App settings.

I've removed the old implementation of the dark theme and all the references it had in the project.

I've tested it on Android 10 and works awesome. It needs to be tested below Android 10.

Options on Android Systems that have global system dark theme(from API 28)

  • System Default
  • Light
  • Dark

Options on below API 28

  • Set by Battery Saver
  • Light
  • Dark

This is in accordance with the examples provided by Google on dark themes. https://github.com/android/user-interface-samples/tree/master/DarkTheme

Test Plan

Select different options from App Settings to set different themes.

On Android 10

Screenshot_20200508-194608

Screenshot_20200508-194556

Screenshot_20200510-215002

On Android 8.1 (Emulator)

Screenshot_1589127936

Battery Saver turns on the dark theme

Screenshot_1588964962

Edited by Anjani Kumar

Merge request reports

Loading