forked from upstream-mirrors/quik
Update avatars with active theme
This commit is contained in:
@@ -535,6 +535,10 @@ public class ThemeManager {
|
|||||||
return sColor;
|
return sColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getActiveColor() {
|
||||||
|
return sActiveColor;
|
||||||
|
}
|
||||||
|
|
||||||
public static Theme getTheme() {
|
public static Theme getTheme() {
|
||||||
return sTheme;
|
return sTheme;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ import android.widget.ImageView;
|
|||||||
import com.moez.QKSMS.R;
|
import com.moez.QKSMS.R;
|
||||||
import com.moez.QKSMS.common.LiveViewManager;
|
import com.moez.QKSMS.common.LiveViewManager;
|
||||||
import com.moez.QKSMS.common.TypefaceManager;
|
import com.moez.QKSMS.common.TypefaceManager;
|
||||||
|
import com.moez.QKSMS.common.preferences.QKPreference;
|
||||||
import com.moez.QKSMS.common.utils.ImageUtils;
|
import com.moez.QKSMS.common.utils.ImageUtils;
|
||||||
import com.moez.QKSMS.common.utils.Units;
|
import com.moez.QKSMS.common.utils.Units;
|
||||||
import com.moez.QKSMS.interfaces.LiveView;
|
import com.moez.QKSMS.interfaces.LiveView;
|
||||||
import com.moez.QKSMS.ui.ThemeManager;
|
import com.moez.QKSMS.ui.ThemeManager;
|
||||||
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
|
||||||
|
|
||||||
public class AvatarView extends ImageView implements View.OnClickListener, LiveView {
|
public class AvatarView extends ImageView implements View.OnClickListener, LiveView {
|
||||||
private final String TAG = "AvatarView";
|
private final String TAG = "AvatarView";
|
||||||
@@ -95,7 +95,7 @@ public class AvatarView extends ImageView implements View.OnClickListener, LiveV
|
|||||||
|
|
||||||
// Register this view for live updates.
|
// Register this view for live updates.
|
||||||
LiveViewManager.registerView(this);
|
LiveViewManager.registerView(this);
|
||||||
LiveViewManager.registerPreference(this, SettingsFragment.THEME);
|
LiveViewManager.registerPreference(this, QKPreference.ACTIVE_THEME.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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.getColor(), PorterDuff.Mode.SRC_ATOP);
|
getBackground().setColorFilter(ThemeManager.getActiveColor(), 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.getColor(), PorterDuff.Mode.SRC_ATOP);
|
getBackground().setColorFilter(ThemeManager.getActiveColor(), PorterDuff.Mode.SRC_ATOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class QueryHandler extends AsyncQueryHandler {
|
private class QueryHandler extends AsyncQueryHandler {
|
||||||
|
|||||||
Reference in New Issue
Block a user