Skip to content

Commit

Permalink
chore: improved eink theme
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Nov 13, 2024
1 parent ddd7daf commit f026aff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions App_Resources/Android/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@
<!-- <item name="bottomSheetDialogTheme">@style/ThemeOverlay.App.BottomSheetDialogEInk</item> -->
</style>
<style name="AppTheme.EInk" parent="AppTheme">
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.App.EinkBottomSheetDialog</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowActionBarOverlay">false</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:navigationBarColor">@android:color/white</item>
<item name="android:navigationBarColor">@color/md_theme_eink_background</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/white</item>
<item name="android:statusBarColor">@color/md_theme_eink_background</item>
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.App.BottomSheetDialogEInk</item>

<item name="colorPrimary">@color/md_theme_eink_primary</item>
Expand Down
12 changes: 8 additions & 4 deletions app/helpers/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,19 @@ export function start() {
if (__ANDROID__) {
if (colorTheme !== DEFAULT_COLOR_THEME) {
const context = Utils.android.getApplicationContext();
let nativeTheme = 'AppTheme';
let nativeTheme;
switch (colorTheme) {
case 'eink':
nativeTheme = 'AppTheme.EInk';
break;
}
const themeId = context.getResources().getIdentifier(nativeTheme, 'style', context.getPackageName());
DEV_LOG && console.log(SETTINGS_COLOR_THEME, nativeTheme, themeId);
ApplicationSettings.setNumber('SET_THEME_ON_LAUNCH', themeId);
if (nativeTheme) {
const themeId = context.getResources().getIdentifier(nativeTheme, 'style', context.getPackageName());
DEV_LOG && console.log(SETTINGS_COLOR_THEME, nativeTheme, themeId);
ApplicationSettings.setNumber('SET_THEME_ON_LAUNCH', themeId);
} else {
ApplicationSettings.remove('SET_THEME_ON_LAUNCH');
}
} else {
ApplicationSettings.remove('SET_THEME_ON_LAUNCH');
}
Expand Down

0 comments on commit f026aff

Please sign in to comment.