Fix Black theme

This commit is contained in:
Trevor Slocum 2021-09-05 21:53:58 -07:00
parent fd07ba3dcf
commit 631d6bbfbb
3 changed files with 24 additions and 13 deletions

View File

@ -402,7 +402,7 @@ public class MediNETActivity extends Activity {
}
public void setWindowBackground() {
if (getMeditationAssistant().getMATheme() != R.style.MeditationDarkTheme && getMeditationAssistant().getMATheme() != R.style.Buddhism) {
if (getMeditationAssistant().getMAThemeIsLight()) {
getWindow().setBackgroundDrawable(
getResources().getDrawable(
android.R.drawable.screen_background_light)

View File

@ -445,13 +445,13 @@ public class MeditationAssistant extends Application {
public int getMATextColor(Boolean enabled) {
if (enabled) {
if (!getMAThemeString().equals("dark") && !getMAThemeString().equals("buddhism")) {
if (getMAThemeIsLight()) {
return android.R.color.primary_text_light;
} else {
return android.R.color.primary_text_dark;
}
} else {
if (!getMAThemeString().equals("dark") && !getMAThemeString().equals("buddhism")) {
if (getMAThemeIsLight()) {
return android.R.color.secondary_text_light;
} else {
return android.R.color.secondary_text_dark;
@ -497,10 +497,21 @@ public class MeditationAssistant extends Application {
if (theme == null) {
theme = getPrefs().getString("pref_theme", "dark");
}
return theme;
}
public boolean getMAThemeIsLight() {
String currentTheme = getMAThemeString();
switch (currentTheme) {
case "buddhism":
case "dark":
case "black":
return false;
default:
return true;
}
}
public MediNET getMediNET() {
if (medinet == null) {
//

View File

@ -177,7 +177,14 @@ public abstract class MonthAdapterMA extends BaseAdapter {
}
});
if (getMeditationAssistant().getMAThemeString().equals("dark")) {
if (getMeditationAssistant().getMAThemeIsLight()) {
int bgcolor = (date[1] == mMonth) ? R.color.highlighted_text_dark
: R.color.dim_foreground_dark;
//: R.color.dim_foreground_holo_dark;
view.setBackgroundColor(getMeditationAssistant()
.getResources().getColor(bgcolor));
} else {
/*int bgcolor = (date[1] == mMonth) ? R.color.highlighted_text_light
: R.color.dim_foreground_light;*/
int bgcolor = (date[1] == mMonth) ? android.R.color.holo_blue_dark
@ -185,13 +192,6 @@ public abstract class MonthAdapterMA extends BaseAdapter {
// : android.R.color.dim_foreground_light;
view.setBackgroundColor(getMeditationAssistant()
.getResources().getColor(bgcolor));
} else {
int bgcolor = (date[1] == mMonth) ? R.color.highlighted_text_dark
: R.color.dim_foreground_dark;
//: R.color.dim_foreground_holo_dark;
view.setBackgroundColor(getMeditationAssistant()
.getResources().getColor(bgcolor));
}
@ -199,7 +199,7 @@ public abstract class MonthAdapterMA extends BaseAdapter {
view.setHeight(mDayHeight);
if (date[1] != mMonth) { // previous or next month
if (getMeditationAssistant().getMAThemeString().equals("dark")) {
if (getMeditationAssistant().getMAThemeIsLight()) {
view.setTextColor(getMeditationAssistant().getResources()
.getColor(android.R.color.tertiary_text_light));
} else {