private void changeSecondaryColor() { //disable search mode for tabLayout disableSearchMode(); TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout); tabLayout.setSelectedTabIndicatorColor(mSecondaryColor); mFab.setBackgroundTintList(ColorStateList.valueOf(mSecondaryColor)); if (rightDrawer != null) { mColorItem2.withIconColor(mSecondaryColor); rightDrawer.updateItem(mColorItem2); } RecyclerOnClickListener.setSecondaryColor(mSecondaryColor); }
@SuppressWarnings("ConstantConditions") private void changePrimaryColor() { //disable search mode for tabLayout disableSearchMode(); AppBarLayout appbar = (AppBarLayout) findViewById(R.id.appbar); mToolbar.setBackgroundColor(mPrimaryColor); tabLayout.setBackgroundColor(mPrimaryColor); appbar.setBackgroundColor(mPrimaryColor); if (Build.VERSION.SDK_INT >= 21) { getWindow().setStatusBarColor(darken(mPrimaryColor)); } if (rightDrawer != null) { mColorItem1.withIconColor(mPrimaryColor); rightDrawer.updateItem(mColorItem1); } RecyclerOnClickListener.setPrimaryColor(mPrimaryColor); }
private void changeTextColor() { //disable search mode for tabLayout disableSearchMode(); TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout); tabLayout.setTabTextColors(slightDarken(mTextColor), mTextColor); mToolbar.setTitleTextColor(mTextColor); Drawable myFabSrc = getResources().getDrawable(R.drawable.add); Drawable newColorDrawable = changeDrawableColor(myFabSrc, mTextColor); mFab.setImageDrawable(newColorDrawable); ToolbarColorizeHelper.colorizeToolbar(mToolbar, mTextColor, this); if (rightDrawer != null) { mColorItem3.withIconColor(mTextColor); rightDrawer.updateItem(mColorItem3); } }
.withName(R.string.primary_col) .withIcon(FontAwesome.Icon.faw_paint_brush) .withIconColor(mPrimaryColor).withSelectable(false); .withName(R.string.secondary_col) .withIcon(FontAwesome.Icon.faw_paint_brush) .withIconColor(mSecondaryColor) .withSelectable(false); .withName(R.string.text_col) .withIcon(FontAwesome.Icon.faw_paint_brush) .withIconColor(mTextColor) .withSelectable(false);