Improve importance background

pull/14/head
Sam Bosley 11 years ago
parent 735d65810e
commit af4b81b15b

@ -7,10 +7,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#00000000"/>
<stroke
android:color="@android:color/darker_gray"
android:width="2dip" />
android:color="#eee"/>
<corners
android:radius="4dp" />
<size android:width="40dip"

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#111"/>
<corners
android:radius="4dp" />
<size android:width="40dip"
android:height="40dip"/>
</shape>

@ -254,22 +254,20 @@ public class ThemeService {
ContextManager.getResources().getResourceName(lightDrawable));
}
public static int getTaskEditDrawable(int regularDrawable, int lightBlueDrawable) {
public static int getDarkVsLight(int resForWhite, int resForDark) {
int theme = getTheme();
if (theme == R.style.Theme || theme == R.style.Theme_White_Alt || theme == R.style.Theme_TransparentWhite) {
return lightBlueDrawable;
return resForDark;
} else {
return regularDrawable;
return resForWhite;
}
}
public static int getTaskEditDrawable(int regularDrawable, int lightBlueDrawable) {
return getDarkVsLight(regularDrawable, lightBlueDrawable);
}
public static int getTaskEditThemeColor() {
int theme = getTheme();
if (theme == R.style.Theme || theme == R.style.Theme_White_Alt || theme == R.style.Theme_TransparentWhite) {
return R.color.blue_theme_color;
} else {
return R.color.task_edit_selected;
}
return getDarkVsLight(R.color.task_edit_selected, R.color.blue_theme_color);
}
public static void forceTheme(int theme) {

@ -19,6 +19,7 @@ import android.widget.ToggleButton;
import com.timsu.astrid.R;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.helper.TaskEditControlSet;
import com.todoroo.astrid.service.ThemeService;
/**
* Control Set for setting task importance
@ -45,7 +46,7 @@ public class ImportanceControlSet extends TaskEditControlSet {
if(b.getTag() == i) {
b.setTextSize(getTextSize());
b.setChecked(true);
b.setBackgroundResource(R.drawable.importance_background_selected);
b.setBackgroundResource(ThemeService.getDarkVsLight(R.drawable.importance_background_selected, R.drawable.importance_background_selected_dark));
} else {
b.setTextSize(getTextSize());
b.setChecked(false);

Loading…
Cancel
Save