No need for returning color and activeColor independently

This commit is contained in:
Moez Bhatti
2015-12-24 23:42:57 -05:00
parent ebc5762200
commit 249c986136
4 changed files with 10 additions and 12 deletions
@@ -24,6 +24,7 @@ import android.widget.LinearLayout;
import com.moez.QKSMS.R; import com.moez.QKSMS.R;
import com.moez.QKSMS.common.AnalyticsManager; import com.moez.QKSMS.common.AnalyticsManager;
import com.moez.QKSMS.common.LiveViewManager; import com.moez.QKSMS.common.LiveViewManager;
import com.moez.QKSMS.common.preferences.QKPreference;
import com.moez.QKSMS.common.utils.ColorUtils; import com.moez.QKSMS.common.utils.ColorUtils;
import com.moez.QKSMS.interfaces.LiveView; import com.moez.QKSMS.interfaces.LiveView;
import com.moez.QKSMS.receiver.IconColorReceiver; import com.moez.QKSMS.receiver.IconColorReceiver;
@@ -36,8 +37,6 @@ import com.moez.QKSMS.ui.widget.WidgetProvider;
import java.util.Set; import java.util.Set;
import static com.moez.QKSMS.common.preferences.QKPreference.ACTIVE_THEME;
public class ThemeManager { public class ThemeManager {
private final static String TAG = "ThemeManager"; private final static String TAG = "ThemeManager";
@@ -532,11 +531,11 @@ public class ThemeManager {
} }
public static int getColor() { public static int getColor() {
return sColor; return sActiveColor;
} }
public static int getActiveColor() { public static int getThemeColor() {
return sActiveColor; return sColor;
} }
public static Theme getTheme() { public static Theme getTheme() {
@@ -714,7 +713,7 @@ public class ThemeManager {
mWindow.setNavigationBarColor(ColorUtils.darken(color)); mWindow.setNavigationBarColor(ColorUtils.darken(color));
} }
for (LiveView view : LiveViewManager.getViews(ACTIVE_THEME.getKey())) { for (LiveView view : LiveViewManager.getViews(QKPreference.ACTIVE_THEME.getKey())) {
view.refresh(); view.refresh();
} }
} }
@@ -790,7 +790,7 @@ public class MessageListFragment extends QKContentFragment implements ActivityLa
public void onMenuChanging(float percentOpen) { public void onMenuChanging(float percentOpen) {
if (mConversationPrefs != null) { if (mConversationPrefs != null) {
ThemeManager.setActiveColor((int) mArgbEvaluator.evaluate( ThemeManager.setActiveColor((int) mArgbEvaluator.evaluate(
percentOpen, 0xFF000000 | mConversationPrefs.getColor(), 0xFF000000 | ThemeManager.getColor())); percentOpen, 0xFF000000 | mConversationPrefs.getColor(), 0xFF000000 | ThemeManager.getThemeColor()));
} }
} }
@@ -261,7 +261,7 @@ public class AvatarView extends ImageView implements View.OnClickListener, LiveV
getBackground().setColorFilter(0x00000000, PorterDuff.Mode.SRC_ATOP); getBackground().setColorFilter(0x00000000, PorterDuff.Mode.SRC_ATOP);
} else { } else {
super.setImageDrawable(TextUtils.isEmpty(mInitial) ? mDefaultDrawable : null); super.setImageDrawable(TextUtils.isEmpty(mInitial) ? mDefaultDrawable : null);
getBackground().setColorFilter(ThemeManager.getActiveColor(), PorterDuff.Mode.SRC_ATOP); getBackground().setColorFilter(ThemeManager.getColor(), PorterDuff.Mode.SRC_ATOP);
} }
} }
} }
@@ -285,7 +285,7 @@ public class AvatarView extends ImageView implements View.OnClickListener, LiveV
if (getBackground() == null) { if (getBackground() == null) {
setBackgroundResource(R.drawable.circle); setBackgroundResource(R.drawable.circle);
} }
getBackground().setColorFilter(ThemeManager.getActiveColor(), PorterDuff.Mode.SRC_ATOP); getBackground().setColorFilter(ThemeManager.getColor(), PorterDuff.Mode.SRC_ATOP);
} }
private class QueryHandler extends AsyncQueryHandler { private class QueryHandler extends AsyncQueryHandler {
@@ -36,7 +36,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Toast; import android.widget.Toast;
import com.github.lzyzsd.circleprogress.DonutProgress; import com.github.lzyzsd.circleprogress.DonutProgress;
import com.moez.QKSMS.common.preferences.*;
import com.moez.QKSMS.common.preferences.QKPreference; import com.moez.QKSMS.common.preferences.QKPreference;
import com.moez.QKSMS.mmssms.Transaction; import com.moez.QKSMS.mmssms.Transaction;
import com.moez.QKSMS.mmssms.Utils; import com.moez.QKSMS.mmssms.Utils;
@@ -952,10 +951,10 @@ public class ComposeView extends LinearLayout implements View.OnClickListener, L
@Override @Override
public void refresh() { public void refresh() {
mButtonBackground.setColorFilter(ThemeManager.getActiveColor(), PorterDuff.Mode.SRC_ATOP); mButtonBackground.setColorFilter(ThemeManager.getColor(), PorterDuff.Mode.SRC_ATOP);
mButtonBar1.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP); mButtonBar1.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
mButtonBar2.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP); mButtonBar2.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
mAttachmentPanel.setBackgroundColor(ThemeManager.getActiveColor()); mAttachmentPanel.setBackgroundColor(ThemeManager.getColor());
mAttach.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP); mAttach.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
mCamera.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP); mCamera.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
updateDelayButton(); updateDelayButton();