Loading res/values/colors.xml +2 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ <color name="primary">@color/tool_bar_color</color> <!--<color name="accent">@color/tool_bar_color</color>--> <color name="accent">@*android:color/accent_device_default</color> <color name="colorAccent">@*android:color/accent_device_default</color> <!-- <color name="colorAccent">@*android:color/accent_device_default</color>--> <color name="accent_dark">@*android:color/accent_device_default_dark</color> <color name="text_cursor">@*android:color/white</color> Loading src/com/android/documentsui/BaseActivity.java +6 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.support.annotation.LayoutRes; import android.support.annotation.VisibleForTesting; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; Loading Loading @@ -692,10 +693,11 @@ public abstract class BaseActivity * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); TypedArray a = this.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); 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(); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color toolbar.setBackgroundColor(color); Loading src/com/android/documentsui/DrawerController.java +5 −6 Original line number Diff line number Diff line Loading @@ -274,13 +274,12 @@ 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 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.provider.DocumentsContract; import android.support.annotation.Nullable; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import com.android.documentsui.R; Loading Loading @@ -180,13 +181,13 @@ public class LauncherActivity extends Activity { * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); TypedArray a = this.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); 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(); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color return color; } Loading Loading
res/values/colors.xml +2 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ <color name="primary">@color/tool_bar_color</color> <!--<color name="accent">@color/tool_bar_color</color>--> <color name="accent">@*android:color/accent_device_default</color> <color name="colorAccent">@*android:color/accent_device_default</color> <!-- <color name="colorAccent">@*android:color/accent_device_default</color>--> <color name="accent_dark">@*android:color/accent_device_default_dark</color> <color name="text_cursor">@*android:color/white</color> Loading
src/com/android/documentsui/BaseActivity.java +6 −4 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.support.annotation.LayoutRes; import android.support.annotation.VisibleForTesting; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; Loading Loading @@ -692,10 +693,11 @@ public abstract class BaseActivity * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); TypedArray a = this.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); 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(); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color toolbar.setBackgroundColor(color); Loading
src/com/android/documentsui/DrawerController.java +5 −6 Original line number Diff line number Diff line Loading @@ -274,13 +274,12 @@ 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 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.provider.DocumentsContract; import android.support.annotation.Nullable; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import com.android.documentsui.R; Loading Loading @@ -180,13 +181,13 @@ public class LauncherActivity extends Activity { * */ private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); TypedArray a = this.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); 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(); a.recycle();*/ Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color return color; } Loading