Browse Source

Fix Black theme

master 1.6.5
Trevor Slocum 2 weeks ago
parent
commit
631d6bbfbb
  1. 2
      MeditationAssistant/src/main/java/sh/ftp/rocketninelabs/meditationassistant/MediNETActivity.java
  2. 17
      MeditationAssistant/src/main/java/sh/ftp/rocketninelabs/meditationassistant/MeditationAssistant.java
  3. 18
      MeditationAssistant/src/main/java/sh/ftp/rocketninelabs/meditationassistant/MonthAdapterMA.java

2
MeditationAssistant/src/main/java/sh/ftp/rocketninelabs/meditationassistant/MediNETActivity.java

@ -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)

17
MeditationAssistant/src/main/java/sh/ftp/rocketninelabs/meditationassistant/MeditationAssistant.java

@ -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) {
//

18
MeditationAssistant/src/main/java/sh/ftp/rocketninelabs/meditationassistant/MonthAdapterMA.java

@ -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 {

Loading…
Cancel
Save