Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e08a921 authored by Marten Gajda's avatar Marten Gajda
Browse files

change list color handling

Instead of changing the text color for very bright list colors we darken
all colors and use white text and white icons everywhere.
parent 64fd9adc
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -2,7 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical" >
    android:orientation="vertical"
    android:paddingBottom="8dp"
    android:paddingTop="8dp" >


    <TextView
    <TextView
        android:id="@+id/task_list_name"
        android:id="@+id/task_list_name"
@@ -18,7 +20,8 @@
        android:layout_width="match_parent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_height="match_parent"
        android:ellipsize="end"
        android:ellipsize="end"
        android:singleLine="true" >
        android:singleLine="true"
        android:textColor="#a0ffffff" >
    </TextView>
    </TextView>


</LinearLayout>
</LinearLayout>
 No newline at end of file
+3 −2
Original line number Original line Diff line number Diff line
@@ -539,7 +539,7 @@ public class EditTaskFragment extends SupportFragment implements LoaderManager.L
		Cursor c = (Cursor) arg0.getItemAtPosition(pos);
		Cursor c = (Cursor) arg0.getItemAtPosition(pos);


		String accountType = c.getString(TASK_LIST_PROJECTION_VALUES.account_type);
		String accountType = c.getString(TASK_LIST_PROJECTION_VALUES.account_type);
		mListColor = c.getInt(TASK_LIST_PROJECTION_VALUES.list_color);
		mListColor = TaskFieldAdapters.LIST_COLOR.get(c);
		updateColor((float) mRootView.getScrollY() / mTaskListBar.getMeasuredHeight());
		updateColor((float) mRootView.getScrollY() / mTaskListBar.getMeasuredHeight());


		if (mEditor != null)
		if (mEditor != null)
@@ -566,6 +566,7 @@ public class EditTaskFragment extends SupportFragment implements LoaderManager.L
		}
		}
	}
	}



	public int mixColors(int col1, int col2)
	public int mixColors(int col1, int col2)
	{
	{
		int r1, g1, b1, r2, g2, b2;
		int r1, g1, b1, r2, g2, b2;
+1 −1
Original line number Original line Diff line number Diff line
@@ -593,7 +593,7 @@ public class ViewTaskFragment extends SupportFragment implements OnModelLoadedLi
	{
	{
		if (contentSet.containsKey(Tasks.ACCOUNT_TYPE))
		if (contentSet.containsKey(Tasks.ACCOUNT_TYPE))
		{
		{
			mListColor = contentSet.getAsInteger(Tasks.LIST_COLOR);
			mListColor = TaskFieldAdapters.LIST_COLOR.get(contentSet);


			if (VERSION.SDK_INT >= 11)
			if (VERSION.SDK_INT >= 11)
			{
			{
+2 −2
Original line number Original line Diff line number Diff line
@@ -236,7 +236,7 @@ public class ByList extends AbstractGroupingFactory
			{
			{
				if (colorbar1 != null)
				if (colorbar1 != null)
				{
				{
					colorbar1.setBackgroundColor(cursor.getInt(2));
					colorbar1.setBackgroundColor(TaskFieldAdapters.LIST_COLOR.get(cursor));
					colorbar1.setVisibility(View.VISIBLE);
					colorbar1.setVisibility(View.VISIBLE);
				}
				}
				if (colorbar2 != null)
				if (colorbar2 != null)
@@ -252,7 +252,7 @@ public class ByList extends AbstractGroupingFactory
				}
				}
				if (colorbar2 != null)
				if (colorbar2 != null)
				{
				{
					colorbar2.setBackgroundColor(cursor.getInt(2));
					colorbar2.setBackgroundColor(TaskFieldAdapters.LIST_COLOR.get(cursor));
					colorbar2.setVisibility(View.VISIBLE);
					colorbar2.setVisibility(View.VISIBLE);
				}
				}
			}
			}
+2 −1
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import org.dmfs.provider.tasks.TaskContract;
import org.dmfs.provider.tasks.TaskContract.Tasks;
import org.dmfs.provider.tasks.TaskContract.Tasks;
import org.dmfs.tasks.model.adapters.BooleanFieldAdapter;
import org.dmfs.tasks.model.adapters.BooleanFieldAdapter;
import org.dmfs.tasks.model.adapters.ChecklistFieldAdapter;
import org.dmfs.tasks.model.adapters.ChecklistFieldAdapter;
import org.dmfs.tasks.model.adapters.ColorFieldAdapter;
import org.dmfs.tasks.model.adapters.DescriptionStringFieldAdapter;
import org.dmfs.tasks.model.adapters.DescriptionStringFieldAdapter;
import org.dmfs.tasks.model.adapters.FloatFieldAdapter;
import org.dmfs.tasks.model.adapters.FloatFieldAdapter;
import org.dmfs.tasks.model.adapters.IntegerFieldAdapter;
import org.dmfs.tasks.model.adapters.IntegerFieldAdapter;
@@ -132,7 +133,7 @@ public final class TaskFieldAdapters
	/**
	/**
	 * Adapter for the Color of the task.
	 * Adapter for the Color of the task.
	 * */
	 * */
	public final static IntegerFieldAdapter LIST_COLOR = new IntegerFieldAdapter(TaskContract.Tasks.LIST_COLOR);
	public final static IntegerFieldAdapter LIST_COLOR = new ColorFieldAdapter(TaskContract.Tasks.LIST_COLOR, 0.8f);


	/**
	/**
	 * Adpater for the ID of the task.
	 * Adpater for the ID of the task.
Loading