Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27b5317b authored by Narinder Rana's avatar Narinder Rana
Browse files

update Theme_DeviceDefault_Light

parent 31c4191b
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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);
+6 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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;
+6 −3
Original line number Diff line number Diff line
@@ -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;

@@ -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