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.common.AnalyticsManager;
import com.moez.QKSMS.common.LiveViewManager;
import com.moez.QKSMS.common.preferences.QKPreference;
import com.moez.QKSMS.common.utils.ColorUtils;
import com.moez.QKSMS.interfaces.LiveView;
import com.moez.QKSMS.receiver.IconColorReceiver;
@@ -36,8 +37,6 @@ import com.moez.QKSMS.ui.widget.WidgetProvider;
import java.util.Set;
import static com.moez.QKSMS.common.preferences.QKPreference.ACTIVE_THEME;
public class ThemeManager {
private final static String TAG = "ThemeManager";
@@ -532,11 +531,11 @@ public class ThemeManager {
}
public static int getColor() {
return sColor;
return sActiveColor;
}
public static int getActiveColor() {
return sActiveColor;
public static int getThemeColor() {
return sColor;
}
public static Theme getTheme() {
@@ -714,7 +713,7 @@ public class ThemeManager {
mWindow.setNavigationBarColor(ColorUtils.darken(color));
}
for (LiveView view : LiveViewManager.getViews(ACTIVE_THEME.getKey())) {
for (LiveView view : LiveViewManager.getViews(QKPreference.ACTIVE_THEME.getKey())) {
view.refresh();
}
}
@@ -790,7 +790,7 @@ public class MessageListFragment extends QKContentFragment implements ActivityLa
public void onMenuChanging(float percentOpen) {
if (mConversationPrefs != null) {
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);
} else {
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) {
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 {
@@ -36,7 +36,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.github.lzyzsd.circleprogress.DonutProgress;
import com.moez.QKSMS.common.preferences.*;
import com.moez.QKSMS.common.preferences.QKPreference;
import com.moez.QKSMS.mmssms.Transaction;
import com.moez.QKSMS.mmssms.Utils;
@@ -952,10 +951,10 @@ public class ComposeView extends LinearLayout implements View.OnClickListener, L
@Override
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);
mButtonBar2.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
mAttachmentPanel.setBackgroundColor(ThemeManager.getActiveColor());
mAttachmentPanel.setBackgroundColor(ThemeManager.getColor());
mAttach.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
mCamera.setColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.SRC_ATOP);
updateDelayButton();