界面修改
This commit is contained in:
@@ -209,6 +209,18 @@ public class IMLoginModel extends BaseModel {
|
||||
//礼物特效开关
|
||||
@SerializedName("gift_effect")
|
||||
private boolean giftEffect = false;
|
||||
//坐骑特效开关
|
||||
@SerializedName("mount_effect")
|
||||
private boolean mountEffect = false;
|
||||
|
||||
public boolean isMountEffect() {
|
||||
return mountEffect;
|
||||
}
|
||||
|
||||
public IMLoginModel setMountEffect(boolean mountEffect) {
|
||||
this.mountEffect = mountEffect;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isGiftEffect() {
|
||||
return giftEffect;
|
||||
|
||||
@@ -16,8 +16,8 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
* 特效设置页面
|
||||
*/
|
||||
public class EffectsSettingsDialog extends AbsDialogFragment {
|
||||
private ImageView specialSwitch;
|
||||
private boolean giftEffect;
|
||||
private ImageView specialSwitch, specialMountSwitch;
|
||||
private boolean giftEffect, mountEffect;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -39,12 +39,19 @@ public class EffectsSettingsDialog extends AbsDialogFragment {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo();
|
||||
specialSwitch = (ImageView) findViewById(R.id.special_switch);
|
||||
specialMountSwitch = (ImageView) findViewById(R.id.special_mount_switch);
|
||||
giftEffect = userInfo.isGiftEffect();
|
||||
mountEffect = userInfo.isMountEffect();
|
||||
if (giftEffect) {
|
||||
ImgLoader.display(getContext(), R.mipmap.special_icon_off, specialSwitch);
|
||||
} else {
|
||||
ImgLoader.display(getContext(), R.mipmap.special_icon_on, specialSwitch);
|
||||
}
|
||||
if (mountEffect) {
|
||||
ImgLoader.display(getContext(), R.mipmap.special_icon_off, specialMountSwitch);
|
||||
} else {
|
||||
ImgLoader.display(getContext(), R.mipmap.special_icon_on, specialMountSwitch);
|
||||
}
|
||||
//礼物特效开关
|
||||
ViewClicksAntiShake.clicksAntiShake(specialSwitch, () -> {
|
||||
giftEffect = !giftEffect;
|
||||
@@ -57,6 +64,18 @@ public class EffectsSettingsDialog extends AbsDialogFragment {
|
||||
IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setGiftEffect(giftEffect));
|
||||
}
|
||||
);
|
||||
//坐骑特效开关
|
||||
ViewClicksAntiShake.clicksAntiShake(specialMountSwitch, () -> {
|
||||
mountEffect = !mountEffect;
|
||||
if (mountEffect) {
|
||||
ImgLoader.display(getContext(), R.mipmap.special_icon_off, specialMountSwitch);
|
||||
} else {
|
||||
ImgLoader.display(getContext(), R.mipmap.special_icon_on, specialMountSwitch);
|
||||
}
|
||||
//更新特效开关
|
||||
IMLoginManager.get(getContext()).upDataUserInfo(userInfo.setMountEffect(mountEffect));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -166,6 +166,7 @@ public class ImgLoader {
|
||||
.apply(RequestOptions.bitmapTransform(sBlurTransformation))
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示模糊的毛玻璃图片
|
||||
*/
|
||||
@@ -175,9 +176,11 @@ public class ImgLoader {
|
||||
}
|
||||
Glide.with(context).asDrawable().load(url)
|
||||
.skipMemoryCache(SKIP_MEMORY_CACHE)
|
||||
.apply(RequestOptions.bitmapTransform(new BlurTransformation(95)))
|
||||
.apply(RequestOptions.bitmapTransform(new BlurTransformation(100)))
|
||||
.placeholder(R.mipmap.live_bg)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
private static boolean contextIsExist(Context context) {
|
||||
if (context == null) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user