diff --git a/res/values/colors.xml b/res/values/colors.xml index e7801b94486ef949f9a452e8108f9f5f4853a074..8983e7f87949e767957431415a1f632ca86419df 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -26,8 +26,12 @@ #ff254FAE @*android:color/Blue_700 - @*android:color/Blue_700 + + @*android:color/accent_device_default_dark @*android:color/accent_device_default_dark + + + @*android:color/white #FF82B1FF diff --git a/src/com/android/documentsui/BaseActivity.java b/src/com/android/documentsui/BaseActivity.java index f2f67005d45d3fbc18708bb3d573d35d2daebe11..fd14b595a268ead0b40221c45eba5a738109b893 100644 --- a/src/com/android/documentsui/BaseActivity.java +++ b/src/com/android/documentsui/BaseActivity.java @@ -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 diff --git a/src/com/android/documentsui/DrawerController.java b/src/com/android/documentsui/DrawerController.java index 169cda8cf485c0f2fa4881205b874f0c764ee8ba..24cadcda448c2dda258203ff28598ca23b254d67 100644 --- a/src/com/android/documentsui/DrawerController.java +++ b/src/com/android/documentsui/DrawerController.java @@ -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; } diff --git a/src/com/android/documentsui/files/LauncherActivity.java b/src/com/android/documentsui/files/LauncherActivity.java index ff205e5b75ccd64756a2b56a5deb6480e3a22c11..b9d152aaf515450a0d770af54e10683aa3df3907 100644 --- a/src/com/android/documentsui/files/LauncherActivity.java +++ b/src/com/android/documentsui/files/LauncherActivity.java @@ -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