Loading res/values/colors.xml +5 −1 Original line number Diff line number Diff line Loading @@ -26,8 +26,12 @@ <color name="primary_dark">#ff254FAE</color> <color name="primary">@*android:color/Blue_700</color> <color name="accent">@*android:color/Blue_700</color> <!-- <color name="accent">@*android:color/Blue_700</color>--> <color name="accent">@*android:color/accent_device_default_dark</color> <color name="accent_dark">@*android:color/accent_device_default_dark</color> <!-- <color name="accent_dark">@*android:color/accent_device_default_dark</color>--> <color name="text_cursor">@*android:color/white</color> <color name="text_handle">#FF82B1FF</color> <!--Blue A100--> Loading src/com/android/documentsui/BaseActivity.java +7 −6 Original line number Diff line number Diff line Loading @@ -691,13 +691,14 @@ public abstract class BaseActivity * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; int color=getResources().getColor(R.color.accent); /* TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color //toolbar change color to accent color toolbar.setBackgroundColor(color); //change status bar color Loading src/com/android/documentsui/DrawerController.java +6 −6 Original line number Diff line number Diff line Loading @@ -272,14 +272,14 @@ public abstract class DrawerController implements DrawerListener { * */ private static int fetchAccentColor(Activity activity) { TypedValue typedValue = new TypedValue(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(activity, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; int color=activity.getResources().getColor(R.color.accent); /* TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color return color; } Loading src/com/android/documentsui/files/LauncherActivity.java +5 −6 Original line number Diff line number Diff line Loading @@ -176,12 +176,11 @@ public class LauncherActivity extends Activity { * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; int color=getResources().getColor(R.color.accent); /* TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color Loading Loading
res/values/colors.xml +5 −1 Original line number Diff line number Diff line Loading @@ -26,8 +26,12 @@ <color name="primary_dark">#ff254FAE</color> <color name="primary">@*android:color/Blue_700</color> <color name="accent">@*android:color/Blue_700</color> <!-- <color name="accent">@*android:color/Blue_700</color>--> <color name="accent">@*android:color/accent_device_default_dark</color> <color name="accent_dark">@*android:color/accent_device_default_dark</color> <!-- <color name="accent_dark">@*android:color/accent_device_default_dark</color>--> <color name="text_cursor">@*android:color/white</color> <color name="text_handle">#FF82B1FF</color> <!--Blue A100--> Loading
src/com/android/documentsui/BaseActivity.java +7 −6 Original line number Diff line number Diff line Loading @@ -691,13 +691,14 @@ public abstract class BaseActivity * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; int color=getResources().getColor(R.color.accent); /* TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color //toolbar change color to accent color toolbar.setBackgroundColor(color); //change status bar color Loading
src/com/android/documentsui/DrawerController.java +6 −6 Original line number Diff line number Diff line Loading @@ -272,14 +272,14 @@ public abstract class DrawerController implements DrawerListener { * */ private static int fetchAccentColor(Activity activity) { TypedValue typedValue = new TypedValue(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(activity, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; int color=activity.getResources().getColor(R.color.accent); /* TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color return color; } Loading
src/com/android/documentsui/files/LauncherActivity.java +5 −6 Original line number Diff line number Diff line Loading @@ -176,12 +176,11 @@ public class LauncherActivity extends Activity { * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; int color=getResources().getColor(R.color.accent); /* TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color Loading