Loading src/com/android/documentsui/BaseActivity.java +8 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.provider.DocumentsContract; import android.text.TextUtils; 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 @@ -902,9 +903,13 @@ public abstract class BaseActivity private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); TypedArray a = this.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color toolbar.setBackgroundColor(color); Loading src/com/android/documentsui/DrawerController.java +6 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.app.Activity; import android.content.res.TypedArray; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.View; import androidx.annotation.ColorRes; Loading Loading @@ -264,9 +265,11 @@ public abstract class DrawerController implements DrawerListener { private static int fetchAccentColor(Activity activity) { TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(activity, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color return color; Loading src/com/android/documentsui/files/LauncherActivity.java +6 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.provider.DocumentsContract; import androidx.annotation.Nullable; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import com.android.documentsui.R; Loading Loading @@ -180,9 +181,11 @@ 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 = a.getColor(0, 0); a.recycle(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color Loading Loading
src/com/android/documentsui/BaseActivity.java +8 −3 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.provider.DocumentsContract; import android.text.TextUtils; 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 @@ -902,9 +903,13 @@ public abstract class BaseActivity private int fetchAccentColor() { TypedValue typedValue = new TypedValue(); TypedArray a = this.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color toolbar.setBackgroundColor(color); Loading
src/com/android/documentsui/DrawerController.java +6 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.app.Activity; import android.content.res.TypedArray; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.View; import androidx.annotation.ColorRes; Loading Loading @@ -264,9 +265,11 @@ public abstract class DrawerController implements DrawerListener { private static int fetchAccentColor(Activity activity) { TypedValue typedValue = new TypedValue(); TypedArray a = activity.obtainStyledAttributes(typedValue.data, new int[] { R.attr.colorAccent }); int color = a.getColor(0, 0); a.recycle(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(activity, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color return color; Loading
src/com/android/documentsui/files/LauncherActivity.java +6 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.provider.DocumentsContract; import androidx.annotation.Nullable; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import com.android.documentsui.R; Loading Loading @@ -180,9 +181,11 @@ 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 = a.getColor(0, 0); a.recycle(); ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(this, android.R.style.Theme_DeviceDefault_Light); contextThemeWrapper.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); int color = typedValue.data; Log.e("TAG", "accent Colour #"+Integer.toHexString(color)); //toolbar change color to accent color Loading