1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-16 05:34:05 +02:00

set correctly tint color if night mode is globally on but in openScale theme mode is light, see issue #611

This commit is contained in:
oliexdev
2020-08-16 08:44:59 +02:00
parent cded2816d3
commit 3594739651
3 changed files with 7 additions and 4 deletions

View File

@@ -139,7 +139,7 @@ dependencies {
// Simple CSV
implementation 'com.j256.simplecsv:simplecsv:2.6'
// Blessed Android
implementation 'com.github.weliem:blessed-android:1.20'
implementation 'com.github.weliem:blessed-android:1.26'
// CustomActivityOnCrash
implementation 'cat.ereza:customactivityoncrash:2.2.0'
// AppIntro

View File

@@ -18,6 +18,7 @@ package com.health.openscale.gui.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Color;
import android.preference.PreferenceManager;
@@ -35,7 +36,9 @@ public class ColorUtil {
public static int getTintColor(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getString("app_theme", "").equals("Dark")) {
int nightModeFlags = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
if (prefs.getString("app_theme", "Light").equals("Dark") || nightModeFlags == Configuration.UI_MODE_NIGHT_YES) {
return Color.parseColor("#b3ffffff");
}

View File

@@ -6,8 +6,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0-beta01"
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0"
}
}