Loading gradle.properties +1 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,4 @@ ROBOLECTRIC_VERSION=3.1.4 JEMS_VERSION=1.13 ANDROID_TEST_RUNNER_VERSION=0.5 RFC5545_DATETIME_VERSION=0.2.4 BOLTS_VERSION=92914c5 opentasks/build.gradle +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ dependencies { } implementation 'org.dmfs:jems:' + JEMS_VERSION implementation 'org.dmfs:rfc5545-datetime:' + RFC5545_DATETIME_VERSION implementation 'com.github.dmfs.bolts:color-bolts:' + BOLTS_VERSION testImplementation 'junit:junit:4.12' Loading opentasks/src/main/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="org.dmfs.tasks"> <uses-permission android:name="org.dmfs.permission.READ_TASKS"/> Loading @@ -11,6 +12,9 @@ <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <!--TODO Remove after https://github.com/dmfs/opentasks/issues/392--> <uses-sdk tools:overrideLibrary="org.dmfs.android.bolts"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" Loading opentasks/src/main/java/org/dmfs/tasks/EmptyTaskFragment.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,11 +16,13 @@ package org.dmfs.tasks; import android.app.Activity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import org.dmfs.android.bolts.color.colors.AttributeColor; import org.dmfs.android.retentionmagic.SupportFragment; Loading @@ -39,4 +41,15 @@ public class EmptyTaskFragment extends SupportFragment return inflater.inflate(R.layout.opentasks_fragment_empty_task, container, false); } @Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof ViewTaskFragment.Callback) { ((ViewTaskFragment.Callback) activity) .updateColor(new AttributeColor(getContext(), R.attr.colorPrimary)); } } } opentasks/src/main/java/org/dmfs/tasks/TaskListActivity.java +11 −9 Original line number Diff line number Diff line Loading @@ -21,13 +21,13 @@ import android.annotation.TargetApi; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Build; import android.os.Build.VERSION; import android.os.Bundle; import android.os.Handler; import android.support.annotation.ColorInt; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CollapsingToolbarLayout; import android.support.design.widget.FloatingActionButton; Loading @@ -50,6 +50,7 @@ import android.view.View.OnClickListener; import android.view.Window; import android.view.WindowManager; import org.dmfs.android.bolts.color.Color; import org.dmfs.android.retentionmagic.annotations.Retain; import org.dmfs.provider.tasks.AuthorityUtil; import org.dmfs.tasks.contract.TaskContract.Tasks; Loading Loading @@ -754,35 +755,36 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C }; private int darkenColor(int color) private int darkenColor(@ColorInt int color) { float[] hsv = new float[3]; Color.colorToHSV(color, hsv); android.graphics.Color.colorToHSV(color, hsv); hsv[2] = hsv[2] * 0.75f; color = Color.HSVToColor(hsv); color = android.graphics.Color.HSVToColor(hsv); return color; } @SuppressLint("NewApi") @Override public void updateColor(int color) public void updateColor(Color color) { if (mTwoPane) { getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color)); mTabs.setBackgroundColor(color); int colorInt = color.argb(); getSupportActionBar().setBackgroundDrawable(new ColorDrawable(colorInt)); mTabs.setBackgroundColor(colorInt); if (mAppBarLayout != null) { mAppBarLayout.setBackgroundColor(color); mAppBarLayout.setBackgroundColor(colorInt); } if (VERSION.SDK_INT >= 21) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(darkenColor(color)); window.setStatusBarColor(darkenColor(colorInt)); } } } Loading Loading
gradle.properties +1 −0 Original line number Diff line number Diff line Loading @@ -9,3 +9,4 @@ ROBOLECTRIC_VERSION=3.1.4 JEMS_VERSION=1.13 ANDROID_TEST_RUNNER_VERSION=0.5 RFC5545_DATETIME_VERSION=0.2.4 BOLTS_VERSION=92914c5
opentasks/build.gradle +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ dependencies { } implementation 'org.dmfs:jems:' + JEMS_VERSION implementation 'org.dmfs:rfc5545-datetime:' + RFC5545_DATETIME_VERSION implementation 'com.github.dmfs.bolts:color-bolts:' + BOLTS_VERSION testImplementation 'junit:junit:4.12' Loading
opentasks/src/main/AndroidManifest.xml +4 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="org.dmfs.tasks"> <uses-permission android:name="org.dmfs.permission.READ_TASKS"/> Loading @@ -11,6 +12,9 @@ <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <!--TODO Remove after https://github.com/dmfs/opentasks/issues/392--> <uses-sdk tools:overrideLibrary="org.dmfs.android.bolts"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" Loading
opentasks/src/main/java/org/dmfs/tasks/EmptyTaskFragment.java +13 −0 Original line number Diff line number Diff line Loading @@ -16,11 +16,13 @@ package org.dmfs.tasks; import android.app.Activity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import org.dmfs.android.bolts.color.colors.AttributeColor; import org.dmfs.android.retentionmagic.SupportFragment; Loading @@ -39,4 +41,15 @@ public class EmptyTaskFragment extends SupportFragment return inflater.inflate(R.layout.opentasks_fragment_empty_task, container, false); } @Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof ViewTaskFragment.Callback) { ((ViewTaskFragment.Callback) activity) .updateColor(new AttributeColor(getContext(), R.attr.colorPrimary)); } } }
opentasks/src/main/java/org/dmfs/tasks/TaskListActivity.java +11 −9 Original line number Diff line number Diff line Loading @@ -21,13 +21,13 @@ import android.annotation.TargetApi; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.Build; import android.os.Build.VERSION; import android.os.Bundle; import android.os.Handler; import android.support.annotation.ColorInt; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CollapsingToolbarLayout; import android.support.design.widget.FloatingActionButton; Loading @@ -50,6 +50,7 @@ import android.view.View.OnClickListener; import android.view.Window; import android.view.WindowManager; import org.dmfs.android.bolts.color.Color; import org.dmfs.android.retentionmagic.annotations.Retain; import org.dmfs.provider.tasks.AuthorityUtil; import org.dmfs.tasks.contract.TaskContract.Tasks; Loading Loading @@ -754,35 +755,36 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C }; private int darkenColor(int color) private int darkenColor(@ColorInt int color) { float[] hsv = new float[3]; Color.colorToHSV(color, hsv); android.graphics.Color.colorToHSV(color, hsv); hsv[2] = hsv[2] * 0.75f; color = Color.HSVToColor(hsv); color = android.graphics.Color.HSVToColor(hsv); return color; } @SuppressLint("NewApi") @Override public void updateColor(int color) public void updateColor(Color color) { if (mTwoPane) { getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color)); mTabs.setBackgroundColor(color); int colorInt = color.argb(); getSupportActionBar().setBackgroundDrawable(new ColorDrawable(colorInt)); mTabs.setBackgroundColor(colorInt); if (mAppBarLayout != null) { mAppBarLayout.setBackgroundColor(color); mAppBarLayout.setBackgroundColor(colorInt); } if (VERSION.SDK_INT >= 21) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(darkenColor(color)); window.setStatusBarColor(darkenColor(colorInt)); } } } Loading