From 94d0952e5bad685efd619d9e74cf37f723fc7c2f Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Tue, 9 Apr 2013 11:29:45 -0700 Subject: [PATCH] Fixed a theming issue in importance control --- .../src/com/todoroo/astrid/ui/ImportanceControlSet.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java b/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java index f881ae251..626e28524 100644 --- a/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/ImportanceControlSet.java @@ -46,7 +46,10 @@ public class ImportanceControlSet extends TaskEditControlSet { if(b.getTag() == i) { b.setTextSize(getTextSize()); b.setChecked(true); - b.setBackgroundResource(ThemeService.getDarkVsLight(R.drawable.importance_background_selected, R.drawable.importance_background_selected_dark)); + int resource = ThemeService.getDarkVsLight(R.drawable.importance_background_selected, R.drawable.importance_background_selected_dark); + if (ThemeService.getTheme() == R.style.Theme_White_Alt) + resource = R.drawable.importance_background_selected; + b.setBackgroundResource(resource); } else { b.setTextSize(getTextSize()); b.setChecked(false); @@ -90,16 +93,12 @@ public class ImportanceControlSet extends TaskEditControlSet { DisplayMetrics metrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); - int width = (int) (metrics.widthPixels / metrics.density) - 20; - int usedWidth = 0; - for(int i = max; i >= min; i--) { final ToggleButton button = new ToggleButton(activity); LinearLayout.LayoutParams params; int dimension = 38; params = new LinearLayout.LayoutParams((int) (metrics.density * dimension), (int) (metrics.density * dimension)); - usedWidth += dimension; button.setLayoutParams(params); StringBuilder label = new StringBuilder();