Fixed ripple background issues

This commit is contained in:
Moez Bhatti
2016-07-07 21:44:37 -10:00
parent 9084f6ce92
commit e5403bc516
@@ -236,7 +236,7 @@ public class ThemeManager {
private static int mReceivedBubbleRes; private static int mReceivedBubbleRes;
private static int mReceivedBubbleAltRes; private static int mReceivedBubbleAltRes;
private static boolean mReceivedBubbleColored; private static boolean mReceivedBubbleColored;
private static Drawable mRippleBackground; private static int mRippleBackgroundRes;
private static Resources mResources; private static Resources mResources;
private static SharedPreferences mPrefs; private static SharedPreferences mPrefs;
@@ -290,21 +290,21 @@ public class ThemeManager {
mBackgroundColor = mResources.getColor(R.color.grey_light_mega_ultra); mBackgroundColor = mResources.getColor(R.color.grey_light_mega_ultra);
mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_light_text_primary); mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_light_text_primary);
mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_light_text_secondary); mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_light_text_secondary);
mRippleBackground = mResources.getDrawable(R.drawable.button_background_transparent); mRippleBackgroundRes = R.drawable.button_background_transparent;
break; break;
case DARK: case DARK:
mBackgroundColor = mResources.getColor(R.color.grey_material); mBackgroundColor = mResources.getColor(R.color.grey_material);
mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_dark_text_primary); mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_dark_text_primary);
mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_dark_text_secondary); mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_dark_text_secondary);
mRippleBackground = mResources.getDrawable(R.drawable.button_background_transparent_light); mRippleBackgroundRes = R.drawable.button_background_transparent_light;
break; break;
case BLACK: case BLACK:
mBackgroundColor = mResources.getColor(R.color.black); mBackgroundColor = mResources.getColor(R.color.black);
mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_dark_text_primary); mTextOnBackgroundPrimary = mResources.getColor(R.color.theme_dark_text_primary);
mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_dark_text_secondary); mtextOnBackgroundSecondary = mResources.getColor(R.color.theme_dark_text_secondary);
mRippleBackground = mResources.getDrawable(R.drawable.button_background_transparent_light); mRippleBackgroundRes = R.drawable.button_background_transparent_light;
break; break;
} }
@@ -450,7 +450,7 @@ public class ThemeManager {
} }
public static Drawable getRippleBackground() { public static Drawable getRippleBackground() {
return mRippleBackground; return mResources.getDrawable(mRippleBackgroundRes);
} }
public static int getColor() { public static int getColor() {
@@ -486,6 +486,8 @@ public class ThemeManager {
View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_color_picker_pager, null, false); View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_color_picker_pager, null, false);
ColorPickerViewHolder holder = new ColorPickerViewHolder(view); ColorPickerViewHolder holder = new ColorPickerViewHolder(view);
holder.mTab1.setBackgroundDrawable(getRippleBackground());
holder.mTab2.setBackgroundDrawable(getRippleBackground());
holder.mTab1.setOnClickListener(v -> holder.mPager.setCurrentItem(0)); holder.mTab1.setOnClickListener(v -> holder.mPager.setCurrentItem(0));
holder.mTab2.setOnClickListener(v -> holder.mPager.setCurrentItem(1)); holder.mTab2.setOnClickListener(v -> holder.mPager.setCurrentItem(1));