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

Commit 4fa43b57 authored by narinder Rana's avatar narinder Rana
Browse files

update color control normal and toggle icon color : bug fixed

parent 594114ac
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -68,13 +68,6 @@ public abstract class DrawerController implements DrawerListener {
        View drawer = activity.findViewById(R.id.drawer_roots);
        Toolbar toolbar = (Toolbar) activity.findViewById(R.id.roots_toolbar);

        accentColor=fetchAccentColor(activity, toolbar);

        if(accentColor!=0){
            toolbar.setBackgroundColor(accentColor);

        }

        drawer.getLayoutParams().width = calculateDrawerWidth(activity);

        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
@@ -84,6 +77,9 @@ public abstract class DrawerController implements DrawerListener {
                R.string.drawer_open,
                R.string.drawer_close);


        accentColor=fetchAccentColor(activity, toolbar, toggle);

        return new RuntimeDrawerController(layout, drawer, toggle, toolbar, activityConfig);
    }

@@ -277,11 +273,13 @@ public abstract class DrawerController implements DrawerListener {
     * get Accent color from OS
     * */

    private static int fetchAccentColor(Activity activity, Toolbar toolbar) {
    private static int fetchAccentColor(Activity activity, Toolbar toolbar, ActionBarDrawerToggle toggle) {

        int color=activity.getResources().getColor(R.color.accent);

        toolbar.setBackgroundColor(color);
        toolbar.setTitleTextColor(activity.getResources().getColor(R.color.color_default_foreground));
        mToggle.getDrawerArrowDrawable().setColor(activity.getResources().getColor(R.color.color_default_foreground));
        toggle.getDrawerArrowDrawable().setColor(activity.getResources().getColor(R.color.color_default_foreground));
        return color;
    }
}