Loading res/values/colors.xml +5 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ <color name="priority_red">#FF412B</color> <color name="priority_yellow">#FFFD16</color> <color name="list_background_pressed">#11000000</color> <color name="list_background_activated">#33000000</color> Loading @@ -38,4 +37,8 @@ <!-- A really bright Holo shade of blue --> <color name="holo_blue_bright">#ff00ddff</color> <!-- Our primary color - a nice shade of teal --> <color name="colorPrimary">#009688</color> <color name="colorPrimaryDarker">#00796b</color> </resources> No newline at end of file src/org/dmfs/tasks/QuickAddDialogFragment.java +1 −11 Original line number Diff line number Diff line Loading @@ -324,21 +324,11 @@ public class QuickAddDialogFragment extends SupportDialogFragment implements OnE } private static int darkenColor(int color) { float[] hsv = new float[3]; Color.colorToHSV(color, hsv); hsv[2] = hsv[2] * 0.75f; color = Color.HSVToColor(hsv); return color; } @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Cursor c = (Cursor) parent.getItemAtPosition(position); mLastColor = darkenColor(TaskFieldAdapters.LIST_COLOR.get(c)); mLastColor = TaskFieldAdapters.LIST_COLOR.get(c); mColorBackground.setBackgroundColor(mLastColor); mSelectedListId = id; } Loading src/org/dmfs/tasks/ViewTaskActivity.java +9 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ public class ViewTaskActivity extends ActionBarActivity implements ViewTaskFragm // If should be in two-pane mode, finish to return to main activity if (getResources().getBoolean(R.bool.has_two_panes)) { Intent taskListIntent = new Intent(this, TaskListActivity.class); startActivity(taskListIntent); finish(); return; } Loading Loading @@ -114,4 +116,11 @@ public class ViewTaskActivity extends ActionBarActivity implements ViewTaskFragm finish(); } @Override public void updateColor(int color) { // nothing to do here } } src/org/dmfs/tasks/ViewTaskFragment.java +10 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,15 @@ public class ViewTaskFragment extends SupportFragment implements OnModelLoadedLi * The {@link Uri} of the deleted task. Note that the Uri is likely to be invalid at the time of calling this method. */ public void onDelete(Uri taskUri); /** * Notifies the listener about the list color of the current task. * * @param color * The color. */ public void updateColor(int color); } Loading Loading @@ -688,6 +697,7 @@ public class ViewTaskFragment extends SupportFragment implements OnModelLoadedLi if (contentSet.containsKey(Tasks.ACCOUNT_TYPE)) { mListColor = TaskFieldAdapters.LIST_COLOR.get(contentSet); ((Callback) getActivity()).updateColor(darkenColor2(mListColor)); if (VERSION.SDK_INT >= 11) { Loading Loading
res/values/colors.xml +5 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ <color name="priority_red">#FF412B</color> <color name="priority_yellow">#FFFD16</color> <color name="list_background_pressed">#11000000</color> <color name="list_background_activated">#33000000</color> Loading @@ -38,4 +37,8 @@ <!-- A really bright Holo shade of blue --> <color name="holo_blue_bright">#ff00ddff</color> <!-- Our primary color - a nice shade of teal --> <color name="colorPrimary">#009688</color> <color name="colorPrimaryDarker">#00796b</color> </resources> No newline at end of file
src/org/dmfs/tasks/QuickAddDialogFragment.java +1 −11 Original line number Diff line number Diff line Loading @@ -324,21 +324,11 @@ public class QuickAddDialogFragment extends SupportDialogFragment implements OnE } private static int darkenColor(int color) { float[] hsv = new float[3]; Color.colorToHSV(color, hsv); hsv[2] = hsv[2] * 0.75f; color = Color.HSVToColor(hsv); return color; } @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Cursor c = (Cursor) parent.getItemAtPosition(position); mLastColor = darkenColor(TaskFieldAdapters.LIST_COLOR.get(c)); mLastColor = TaskFieldAdapters.LIST_COLOR.get(c); mColorBackground.setBackgroundColor(mLastColor); mSelectedListId = id; } Loading
src/org/dmfs/tasks/ViewTaskActivity.java +9 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ public class ViewTaskActivity extends ActionBarActivity implements ViewTaskFragm // If should be in two-pane mode, finish to return to main activity if (getResources().getBoolean(R.bool.has_two_panes)) { Intent taskListIntent = new Intent(this, TaskListActivity.class); startActivity(taskListIntent); finish(); return; } Loading Loading @@ -114,4 +116,11 @@ public class ViewTaskActivity extends ActionBarActivity implements ViewTaskFragm finish(); } @Override public void updateColor(int color) { // nothing to do here } }
src/org/dmfs/tasks/ViewTaskFragment.java +10 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,15 @@ public class ViewTaskFragment extends SupportFragment implements OnModelLoadedLi * The {@link Uri} of the deleted task. Note that the Uri is likely to be invalid at the time of calling this method. */ public void onDelete(Uri taskUri); /** * Notifies the listener about the list color of the current task. * * @param color * The color. */ public void updateColor(int color); } Loading Loading @@ -688,6 +697,7 @@ public class ViewTaskFragment extends SupportFragment implements OnModelLoadedLi if (contentSet.containsKey(Tasks.ACCOUNT_TYPE)) { mListColor = TaskFieldAdapters.LIST_COLOR.get(contentSet); ((Callback) getActivity()).updateColor(darkenColor2(mListColor)); if (VERSION.SDK_INT >= 11) { Loading