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

Commit eaede930 authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge branch 'pie_1721' into 'v1-pie'

Pie 1721

See merge request !10
parents 9791dca4 e9ff1d67
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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>
+6 −4
Original line number Diff line number Diff line
@@ -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;
@@ -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);
+5 −6
Original line number Diff line number Diff line
@@ -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;
+5 −4
Original line number Diff line number Diff line
@@ -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;

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