Loading src/com/android/documentsui/DrawerController.java +7 −9 Original line number Diff line number Diff line Loading @@ -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( Loading @@ -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); } Loading Loading @@ -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; } } Loading
src/com/android/documentsui/DrawerController.java +7 −9 Original line number Diff line number Diff line Loading @@ -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( Loading @@ -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); } Loading Loading @@ -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; } }