feat : 提测
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
package com.chwl.app.avroom.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.Layout
|
||||
import android.text.StaticLayout
|
||||
import android.text.TextPaint
|
||||
import android.view.LayoutInflater
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.avroom.helper.AnimHelper
|
||||
import com.chwl.app.databinding.RoomNotifyCpLevelUpBinding
|
||||
import com.chwl.app.ui.utils.CpUtils
|
||||
import com.chwl.app.ui.utils.loadFromAssets
|
||||
import com.chwl.app.utils.SpannableBuilder
|
||||
import com.chwl.core.gift.bean.CpMsgBean
|
||||
import com.chwl.core.utils.SpanUtils
|
||||
import com.example.lib_utils.ktx.getColor
|
||||
@@ -47,6 +41,7 @@ class RoomNotifyLevelUpDialog (private val context: Context) : BaseRoomNotifyDia
|
||||
shareParser().decodeFromAssets(svga, object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(svgaVideoEntity: SVGAVideoEntity) {
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
|
||||
// val textPaint = TextPaint()
|
||||
// textPaint.color = Color.WHITE //字体颜色
|
||||
// textPaint.textSize = 24f //字体大小
|
||||
|
@@ -272,6 +272,9 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
case RoomEvent.RECEIVE_NORMALE_GIFT://普通
|
||||
onReceiveGiftMsg(roomEvent.getGiftReceiveInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_NORMALE_GIFT_ALL_SERVICE:// 全服普通
|
||||
onReceiveGiftMsgAllService(roomEvent.getGiftReceiveInfo());
|
||||
break;
|
||||
case RoomEvent.RECEIVE_MUTLT_NORMALEI_GIFT://普通多人
|
||||
onReceiveMultiGiftMsg(roomEvent.getGiftMultiReceiverInfo());
|
||||
break;
|
||||
@@ -561,12 +564,25 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 普通
|
||||
*/
|
||||
private void onReceiveGiftMsg(GiftReceiveInfo giftReceiveInfo) {
|
||||
if (giftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftReceiveInfo.getGift() != null && giftReceiveInfo.getGift().getNotifyFull() == 1) return; //全服礼物交给 onReceiveGiftMsgAllService() 来处理
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveGiftMsg(giftReceiveInfo);
|
||||
gameMainBinding.giftComboLayout.onRoomCustomMsg(GiftToolbox.transformToGiftMultiReceiverInfo(giftReceiveInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通多人
|
||||
*/
|
||||
private void onReceiveMultiGiftMsg(GiftMultiReceiverInfo giftMultiReceiverInfo) {
|
||||
if (giftMultiReceiverInfo == null || !isResumed()) return;
|
||||
if (giftMultiReceiverInfo.getGift() != null && giftMultiReceiverInfo.getGift().getNotifyFull() == 1) return; //全服礼物交给 onReceiveGiftMsgAllService() 来处理
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
@@ -580,18 +596,18 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
*/
|
||||
private void onReceiveAllMicGiftMsg(MultiGiftReceiveInfo multiGiftReceiveInfo) {
|
||||
if (multiGiftReceiveInfo == null || !isResumed()) return;
|
||||
if (multiGiftReceiveInfo.getGift() != null && multiGiftReceiveInfo.getGift().getNotifyFull() == 1) return; //全服礼物交给 onReceiveGiftMsgAllService() 来处理
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
}
|
||||
giftView.onReceiveMultiGiftMsg(multiGiftReceiveInfo);
|
||||
gameMainBinding.giftComboLayout.onRoomCustomMsg(GiftToolbox.transformToGiftMultiReceiverInfo(multiGiftReceiveInfo));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通
|
||||
* 全服礼物
|
||||
*/
|
||||
private void onReceiveGiftMsg(GiftReceiveInfo giftReceiveInfo) {
|
||||
private void onReceiveGiftMsgAllService(GiftReceiveInfo giftReceiveInfo) {
|
||||
if (giftReceiveInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
giftView = (GiftV2View) mVsGift2View.inflate();
|
||||
@@ -600,6 +616,8 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
gameMainBinding.giftComboLayout.onRoomCustomMsg(GiftToolbox.transformToGiftMultiReceiverInfo(giftReceiveInfo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void onReceiveMagicMsg(MagicReceivedInfo magicReceivedInfo) {
|
||||
if (magicReceivedInfo == null || !isResumed()) return;
|
||||
if (giftView == null) {
|
||||
|
@@ -19,15 +19,19 @@ import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.utils.AnimLoadUtil;
|
||||
import com.chwl.core.gift.GiftModel;
|
||||
import com.chwl.core.gift.bean.GiftEffectInfo;
|
||||
import com.chwl.core.gift.bean.GiftInfo;
|
||||
import com.chwl.core.gift.bean.GiftReceiver;
|
||||
import com.chwl.core.gift.bean.ShowAvatarType;
|
||||
import com.chwl.core.initial.InitialModel;
|
||||
import com.chwl.core.initial.bean.InitInfo;
|
||||
import com.chwl.core.manager.AvRoomDataManager;
|
||||
import com.chwl.core.manager.IMNetEaseManager;
|
||||
import com.chwl.core.manager.RoomEvent;
|
||||
import com.chwl.library.common.glide.GlideUtils;
|
||||
import com.chwl.library.common.util.OtherExtKt;
|
||||
import com.example.lib_utils.log.LogUtil;
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
@@ -44,6 +48,7 @@ import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author chenran
|
||||
@@ -119,6 +124,7 @@ public class GiftEffectView extends RelativeLayout {
|
||||
objectAnimator1.start();
|
||||
}
|
||||
};
|
||||
|
||||
svgaImageView.setCallback(new SVGACallback() {
|
||||
@Override
|
||||
public void onPause() {
|
||||
@@ -151,6 +157,7 @@ public class GiftEffectView extends RelativeLayout {
|
||||
@Override
|
||||
public void onVideoStart() {
|
||||
log("onVideoStart");
|
||||
log("drawEffect vapAnimView.setAnimListener onVideoStart ");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,17 +167,21 @@ public class GiftEffectView extends RelativeLayout {
|
||||
@Override
|
||||
public void onVideoComplete() {
|
||||
log("onVideoComplete");
|
||||
log("drawEffect vapAnimView.setAnimListener onVideoComplete ");
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoDestroy() {
|
||||
log("onVideoDestroy");
|
||||
log("drawEffect vapAnimView.setAnimListener onVideoDestroy ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(int i, @androidx.annotation.Nullable String s) {
|
||||
log("onFailed i:" + i + " s:" + s);
|
||||
log("drawEffect vapAnimView.setAnimListener onFailed i:" + i + " s:" + s);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -193,9 +204,9 @@ public class GiftEffectView extends RelativeLayout {
|
||||
return;
|
||||
}
|
||||
if (giftInfo.getOtherViewType() == 1 && !TextUtils.isEmpty(giftInfo.getViewUrl())) {
|
||||
drawVAPEffect(giftInfo.getViewUrl().trim());
|
||||
drawVAPEffect(giftInfo.getViewUrl(),giftEffectInfo);
|
||||
} else if (giftInfo.isHasVggPic() && !StringUtil.isEmpty(giftInfo.getVggUrl())) {
|
||||
drawSvgaEffect(giftInfo.getVggUrl().trim());
|
||||
drawSvgaEffect(giftInfo.getVggUrl(),giftEffectInfo);
|
||||
} else {
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
}
|
||||
@@ -204,7 +215,7 @@ public class GiftEffectView extends RelativeLayout {
|
||||
}
|
||||
}
|
||||
|
||||
private void drawSvgaEffect(String url) {
|
||||
private void drawSvgaEffect(String url,GiftEffectInfo effectInfo) {
|
||||
log("drawEffect drawSvgaEffect url:" + url);
|
||||
|
||||
GlideUtils.instance().downloadFromUrl2(getContext(), url, new RequestListener<File>() {
|
||||
@@ -224,7 +235,7 @@ public class GiftEffectView extends RelativeLayout {
|
||||
String path = "";
|
||||
if (resource != null) {
|
||||
path = resource.getPath();
|
||||
drawSvgaEffectFile(path);
|
||||
drawSvgaEffectFile(path,effectInfo);
|
||||
} else {
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
}
|
||||
@@ -233,31 +244,29 @@ public class GiftEffectView extends RelativeLayout {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
// String filePath = PathHelper.INSTANCE.generateResourcesFilePath(url);
|
||||
// DownloadRequest request = DownloadRequest.Companion.build(url, filePath, DOWNLOAD_TAG, null, 60000L);
|
||||
// DownloadManager.INSTANCE.download(request, new FileDownloadListener() {
|
||||
// @Override
|
||||
// public void onDownloadCompleted(@NonNull DownloadTask task) {
|
||||
// String path = task.getRequest().getPath();
|
||||
// log("drawSvgaEffect onDownloadCompleted url:" + url + " path:" + path);
|
||||
// drawSvgaEffectFile(path);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onDownloadError(@NonNull DownloadException exception) {
|
||||
// log("drawSvgaEffect onDownloadError url:" + url);
|
||||
// effectHandler.sendEmptyMessage(0);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void drawSvgaEffectFile(String path) {
|
||||
private void drawSvgaEffectFile(String path,GiftEffectInfo effectInfo) {
|
||||
try {
|
||||
log("drawSvgaEffectFile path:" + path);
|
||||
BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(path));
|
||||
SVGAParser.Companion.shareParser().decodeFromInputStream(inputStream, path, parseCompletion, true, null, null);
|
||||
log("drawEffect drawSvgaEffectFile path:" + path);
|
||||
if (effectInfo != null && effectInfo.getShowAvatarType() != ShowAvatarType.def) {
|
||||
AnimLoadUtil.INSTANCE.loadSvga(svgaImageView, path,getImgMap(effectInfo), getTextMap(effectInfo), isSuccess -> {
|
||||
log("drawEffect drawSvgaEffectFile loadSvga isSuccess:" + isSuccess);
|
||||
if (isSuccess) {
|
||||
svgaBg.setVisibility(VISIBLE);
|
||||
ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(svgaBg, "alpha", 0.0F, 2.0F).setDuration(1250);
|
||||
objectAnimator1.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
objectAnimator1.start();
|
||||
} else {
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
} else {
|
||||
BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(path));
|
||||
SVGAParser.Companion.shareParser().decodeFromInputStream(inputStream, path, parseCompletion, true, null, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
@@ -266,58 +275,95 @@ public class GiftEffectView extends RelativeLayout {
|
||||
|
||||
|
||||
|
||||
private void drawVAPEffect(String url) {
|
||||
private void drawVAPEffect(String url, GiftEffectInfo effectInfo) {
|
||||
log("drawEffect drawVAPEffect url:" + url);
|
||||
|
||||
GlideUtils.instance().downloadFromUrl2(getContext(), url, new RequestListener<File>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<File> target, boolean isFirstResource) {
|
||||
String message = "";
|
||||
if (e != null) {
|
||||
message = e.getMessage();
|
||||
}
|
||||
log("drawEffect drawVAPEffect onDownloadError url:" + url + " error = "+message);
|
||||
effectHandler.sendEmptyMessageDelayed(0, 4000);
|
||||
return true;
|
||||
if (effectInfo != null && effectInfo.getShowAvatarType() != ShowAvatarType.def) {
|
||||
|
||||
if (url != null) {
|
||||
AnimLoadUtil.INSTANCE.loadVap(vapAnimView, url,getImgMap(effectInfo), getTextMap(effectInfo),isSuccess -> {
|
||||
if (!isSuccess) {
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
}
|
||||
log("drawEffect drawVAPEffect loadVap isSuccess = "+isSuccess);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
|
||||
String path = "";
|
||||
if (resource != null) {
|
||||
path = resource.getPath();
|
||||
vapAnimView.startPlay(resource);
|
||||
} else {
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
GlideUtils.instance().downloadFromUrl2(getContext(), url, new RequestListener<File>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<File> target, boolean isFirstResource) {
|
||||
String message = "";
|
||||
if (e != null) {
|
||||
message = e.getMessage();
|
||||
}
|
||||
log("drawEffect drawVAPEffect onDownloadError url:" + url + " error = "+message);
|
||||
effectHandler.sendEmptyMessageDelayed(0, 4000);
|
||||
return true;
|
||||
}
|
||||
log("drawEffect drawVAPEffect onDownloadCompleted url:" + url + " path:" + path);
|
||||
return true;
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
|
||||
String path = "";
|
||||
if (resource != null) {
|
||||
path = resource.getPath();
|
||||
vapAnimView.startPlay(resource);
|
||||
} else {
|
||||
effectHandler.sendEmptyMessage(0);
|
||||
}
|
||||
log("drawEffect drawVAPEffect onDownloadCompleted url:" + url + " path:" + path);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<String, String> getImgMap(GiftEffectInfo effectInfo) {
|
||||
HashMap<String, String> imgMap = new HashMap<>();
|
||||
if (effectInfo.getShowAvatarType() == ShowAvatarType.send){
|
||||
imgMap.put("avatar1", effectInfo.getAvatar());
|
||||
}else if (effectInfo.getShowAvatarType() == ShowAvatarType.recv){
|
||||
if (OtherExtKt.isVerify(0,effectInfo.getTargetUsers())) {
|
||||
GiftReceiver giftReceiver = effectInfo.getTargetUsers().get(0);
|
||||
imgMap.put("avatar1", giftReceiver.getAvatar());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// String filePath = PathHelper.INSTANCE.generateResourcesFilePath(url);
|
||||
// DownloadRequest request = DownloadRequest.Companion.build(url, filePath, DOWNLOAD_TAG, null, 60000L);
|
||||
// DownloadManager.INSTANCE.download(request, new FileDownloadListener() {
|
||||
// @Override
|
||||
// public void onDownloadCompleted(@NonNull DownloadTask task) {
|
||||
// String path = task.getRequest().getPath();
|
||||
// log("drawVAPEffect onDownloadCompleted url:" + url + " path:" + path);
|
||||
// vapAnimView.startPlay(new File(path));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onDownloadError(@NonNull DownloadException exception) {
|
||||
// log("drawVAPEffect onDownloadError url:" + url);
|
||||
// exception.printStackTrace();
|
||||
// effectHandler.sendEmptyMessageDelayed(0, 4000);
|
||||
// }
|
||||
// });
|
||||
|
||||
}else if (effectInfo.getShowAvatarType() == ShowAvatarType.sendRecv){
|
||||
imgMap.put("avatar1", effectInfo.getAvatar());
|
||||
if (OtherExtKt.isVerify(0,effectInfo.getTargetUsers())) {
|
||||
GiftReceiver giftReceiver = effectInfo.getTargetUsers().get(0);
|
||||
imgMap.put("avatar2", giftReceiver.getAvatar());
|
||||
}
|
||||
}
|
||||
return imgMap;
|
||||
}
|
||||
|
||||
//目前id 是 uid 不是 erban ,暂时注释
|
||||
private HashMap<String, String> getTextMap(GiftEffectInfo effectInfo) {
|
||||
HashMap<String, String> textMap = new HashMap<>();
|
||||
if (effectInfo.getShowAvatarType() == ShowAvatarType.send){
|
||||
textMap.put("name1", effectInfo.getNick());
|
||||
// textMap.put("id1", String.valueOf(effectInfo.getUid()));
|
||||
}else if (effectInfo.getShowAvatarType() == ShowAvatarType.recv){
|
||||
if (OtherExtKt.isVerify(0,effectInfo.getTargetUsers())) {
|
||||
GiftReceiver giftReceiver = effectInfo.getTargetUsers().get(0);
|
||||
textMap.put("name1", giftReceiver.getNick());
|
||||
// textMap.put("id1", String.valueOf(giftReceiver.getUid()));
|
||||
}
|
||||
}else if (effectInfo.getShowAvatarType() == ShowAvatarType.sendRecv){
|
||||
textMap.put("name1", effectInfo.getNick());
|
||||
// textMap.put("id1", String.valueOf(effectInfo.getUid()));
|
||||
if (OtherExtKt.isVerify(0,effectInfo.getTargetUsers())) {
|
||||
GiftReceiver giftReceiver = effectInfo.getTargetUsers().get(0);
|
||||
textMap.put("name2", giftReceiver.getNick());
|
||||
// textMap.put("id2", String.valueOf(giftReceiver.getUid()));
|
||||
}
|
||||
}
|
||||
return textMap;
|
||||
}
|
||||
|
||||
private void deleteAnim() {
|
||||
log("drawEffect 播放结束 deleteAnim ");
|
||||
if (isHideCarEffect) {
|
||||
isHideCarEffect = false;
|
||||
IMNetEaseManager.get().noticeRoomEvent(null, RoomEvent.ROOM_CAR_EFFECT_SHOW);
|
||||
|
@@ -23,20 +23,11 @@ import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.chwl.core.utils.ComboUtil;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.example.lib_utils.UiUtils;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.common.svga.SimpleSvgaParseCompletion;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.fansteam.bean.FansTeamMsgInfo;
|
||||
import com.chwl.core.gift.GiftModel;
|
||||
import com.chwl.core.gift.bean.GiftEffectInfo;
|
||||
@@ -54,8 +45,18 @@ import com.chwl.core.magic.bean.MagicReceivedInfo;
|
||||
import com.chwl.core.magic.bean.MultiMagicReceivedInfo;
|
||||
import com.chwl.core.manager.AvRoomDataManager;
|
||||
import com.chwl.core.room.bean.RoomInfo;
|
||||
import com.chwl.core.utils.ComboUtil;
|
||||
import com.chwl.core.utils.LogUtils;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.chwl.library.utils.ResolutionUtils;
|
||||
import com.example.lib_utils.UiUtils;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.opensource.svgaplayer.SVGACallback;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.net.MalformedURLException;
|
||||
@@ -153,17 +154,19 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
public void onReceiveMultiGiftMsg(MultiGiftReceiveInfo multiGiftReceiveInfo) {
|
||||
if (multiGiftReceiveInfo != null) {
|
||||
setVisibility(VISIBLE);
|
||||
List<Long> targetUids = multiGiftReceiveInfo.getTargetUids();
|
||||
List<GiftReceiver> targetUsers = multiGiftReceiveInfo.getTargetUsers();
|
||||
List<GiftReceiveInfo> giftReceiveInfos = new ArrayList<>();
|
||||
for (Long targetUid : targetUids) {
|
||||
for (GiftReceiver target : targetUsers) {
|
||||
GiftReceiveInfo giftReceiveInfo = new GiftReceiveInfo();
|
||||
giftReceiveInfo.setUid(multiGiftReceiveInfo.getUid());
|
||||
giftReceiveInfo.setGiftNum(multiGiftReceiveInfo.getGiftNum());
|
||||
giftReceiveInfo.setTargetUid(targetUid);
|
||||
giftReceiveInfo.setNick(multiGiftReceiveInfo.getNick());
|
||||
giftReceiveInfo.setGiftId(multiGiftReceiveInfo.getGiftId());
|
||||
giftReceiveInfo.setAvatar(multiGiftReceiveInfo.getAvatar());
|
||||
giftReceiveInfo.setTargetUid(target.getUid());
|
||||
giftReceiveInfo.setTargetNick(target.getNick());
|
||||
giftReceiveInfo.setTargetAvatar(target.getAvatar());
|
||||
giftReceiveInfo.setGiftId(multiGiftReceiveInfo.getGiftId());
|
||||
giftReceiveInfo.setGift(multiGiftReceiveInfo.getGift());
|
||||
giftReceiveInfo.setGiftNum(multiGiftReceiveInfo.getGiftNum());
|
||||
//礼物值
|
||||
giftReceiveInfo.setGiftValueVos(multiGiftReceiveInfo.getGiftValueVos());
|
||||
giftReceiveInfo.setCurrentTime(multiGiftReceiveInfo.getCurrentTime());
|
||||
@@ -305,6 +308,9 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
giftEffectInfo.setGift(giftInfo);
|
||||
giftEffectInfo.setTargetUsers(targetUsers);
|
||||
giftEffectInfo.setGiftReceiveType(giftReceiveType);
|
||||
//- 嵌套头像礼物所用字段
|
||||
giftEffectInfo.setShowAvatarType(giftInfo.getShowAvatarType());
|
||||
|
||||
msg.obj = giftEffectInfo;
|
||||
handler.sendMessageDelayed(msg, 200);
|
||||
}
|
||||
@@ -394,6 +400,10 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
giftEffectInfo.setGift(giftInfo);
|
||||
giftEffectInfo.setTargetUsers(targetUsers);
|
||||
giftEffectInfo.setGiftReceiveType(giftReceiveType);
|
||||
|
||||
//- 嵌套头像礼物所用字段
|
||||
giftEffectInfo.setShowAvatarType(giftInfo.getShowAvatarType());
|
||||
|
||||
msg.obj = giftEffectInfo;
|
||||
handler.sendMessageDelayed(msg, 200);
|
||||
}
|
||||
@@ -437,6 +447,8 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
giftReceiveInfo.setUid(giftMultiReceiverInfo.getUid());
|
||||
giftReceiveInfo.setGiftNum(giftMultiReceiverInfo.getGiftNum());
|
||||
giftReceiveInfo.setTargetUid(targetUser.getUid());
|
||||
giftReceiveInfo.setTargetNick(targetUser.getNick());
|
||||
giftReceiveInfo.setTargetAvatar(targetUser.getAvatar());
|
||||
giftReceiveInfo.setNick(giftMultiReceiverInfo.getNick());
|
||||
giftReceiveInfo.setGiftId(giftMultiReceiverInfo.getGiftId());
|
||||
giftReceiveInfo.setAvatar(giftMultiReceiverInfo.getAvatar());
|
||||
@@ -571,6 +583,7 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
|
||||
private void drawGiftEffect(GiftEffectInfo giftEffectInfo) {
|
||||
giftEffectInfoList.add(giftEffectInfo);
|
||||
LogUtils.d("GiftV2View drawEffect drawGiftEffect 特效礼物 进入播放队列 GiftId = "+giftEffectInfo.getGiftId() + "effectInfoList.Size = "+giftEffectInfoList.size());
|
||||
if (!giftEffectView.isAnim()) {
|
||||
giftEffectView.startGiftEffect(giftEffectInfo);
|
||||
giftEffectInfoList.remove(0);
|
||||
|
@@ -10,6 +10,7 @@ import com.chwl.app.decoration.util.DressUpUtil
|
||||
import com.chwl.core.decoration.bean.DressUpInfo
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.common.util.toColor
|
||||
import com.example.lib_utils.ktx.getString
|
||||
|
||||
class DressUpAdapter : BaseBindingAdapter<ItemDressUpLayoutBinding, DressUpInfo>() {
|
||||
@@ -59,20 +60,36 @@ class DressUpAdapter : BaseBindingAdapter<ItemDressUpLayoutBinding, DressUpInfo>
|
||||
binding.btnPlay.setVis(false)
|
||||
}
|
||||
|
||||
|
||||
binding.limit.setVis(true)
|
||||
if (item.isMy) {
|
||||
if (item.isHasExpired) {
|
||||
binding.limit.setVis(true)
|
||||
binding.limit.changeGradientColor(
|
||||
"#C1CDDB".toColor(),
|
||||
-1,
|
||||
"#C1CDDB".toColor()
|
||||
)
|
||||
binding.limit.text = R.string.Expired.getString()
|
||||
} else {
|
||||
if (item.expireDays != -1) {
|
||||
binding.limit.changeGradientColor(
|
||||
"#A1CAFD".toColor(),
|
||||
-1,
|
||||
"#A1CAFD".toColor()
|
||||
)
|
||||
if (item.expireDays > 0) {
|
||||
binding.limit.text = R.string.sDays.getString(item.expireDays)
|
||||
} else {
|
||||
binding.limit.text = R.string.unDay.getString()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.limit.changeGradientColor(
|
||||
"#FFE3B2".toColor(),
|
||||
-1,
|
||||
"#E9A71D".toColor()
|
||||
)
|
||||
if (item.dressLimitStatus != 0) {
|
||||
binding.limit.setVis(true)
|
||||
binding.limit.text = R.string.limit.getString()
|
||||
} else {
|
||||
binding.limit.setVis(false)
|
||||
}
|
||||
|
@@ -7,9 +7,11 @@ import com.chwl.app.databinding.DialogDressUpBinding
|
||||
import com.chwl.app.decoration.util.DressUpUtil
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.decoration.bean.DressUpInfo
|
||||
import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.doToast
|
||||
import com.chwl.library.common.util.toColor
|
||||
import com.chwl.library.net.rxnet.RxNet
|
||||
import com.example.lib_utils.ktx.dp
|
||||
import com.example.lib_utils.ktx.getString
|
||||
@@ -26,15 +28,17 @@ class DressUpDialog : BaseDialogFragment<DialogDressUpBinding>() {
|
||||
override var dimAmount = 0.3f
|
||||
override var gravity = Gravity.CENTER
|
||||
|
||||
|
||||
var isMy = false
|
||||
var mDressUpInfo : DressUpInfo? = null
|
||||
var mTargetUid = -1L
|
||||
|
||||
override fun init() {
|
||||
val cacheLoginUserInfo = UserModel.get().cacheLoginUserInfo
|
||||
val vipLevel = cacheLoginUserInfo?.userVipInfoVO?.vipLevel?: 0
|
||||
|
||||
mDressUpInfo?.let {
|
||||
binding.name.text = it.name
|
||||
if (it.vipLimit == 0 && it.obtainWay == 1){
|
||||
if (it.vipLimit <= vipLevel && it.obtainWay != 2){
|
||||
DressUpUtil.setTextPrice(binding.price,it)
|
||||
}else{
|
||||
if (it.obtainWay != 1) {
|
||||
@@ -47,13 +51,28 @@ class DressUpDialog : BaseDialogFragment<DialogDressUpBinding>() {
|
||||
DressUpUtil.setItemPic(it,binding.picLayout)
|
||||
|
||||
}
|
||||
|
||||
binding.btnBuy.text = if (mTargetUid != -1L) R.string.fairy_give.getString() else R.string.buy.getString()
|
||||
if (mTargetUid != -1L) {
|
||||
binding.btnBuy.text = R.string.fairy_give.getString()
|
||||
binding.btnBuy.setGradientDrawable(
|
||||
"#b2fcff".toColor(),
|
||||
-1,
|
||||
"#4da2ea".toColor(),
|
||||
-1,-1f
|
||||
)
|
||||
} else {
|
||||
binding.btnBuy.text = R.string.buy.getString()
|
||||
binding.btnBuy.setGradientDrawable(
|
||||
"#FFE3b2".toColor(),
|
||||
-1,
|
||||
"#e9a71d".toColor(),
|
||||
-1,-1f
|
||||
)
|
||||
}
|
||||
|
||||
binding.btnBuy.click {
|
||||
mDressUpInfo?.let {
|
||||
if (mTargetUid != -1L) {
|
||||
postShopGive(it.dressType,it.id,mTargetUid)
|
||||
postShopGive(it.dressType,it.dressId,mTargetUid)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess{
|
||||
ToastUtils.show(R.string.doSuccess)
|
||||
@@ -64,10 +83,11 @@ class DressUpDialog : BaseDialogFragment<DialogDressUpBinding>() {
|
||||
}
|
||||
.subscribe()
|
||||
} else {
|
||||
postShopBuy(it.dressType,it.id)
|
||||
postShopBuy(it.dressType,it.dressId)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess{
|
||||
ToastUtils.show(R.string.doSuccess)
|
||||
mActionCallBack?.onAction(0,true)
|
||||
dismiss()
|
||||
}
|
||||
.doOnError {
|
||||
|
@@ -138,10 +138,18 @@ class DressUpTabActivity : BaseViewBindingActivity<ActivityDressUpTabBinding>()
|
||||
override fun onPageSelected(position: Int) {
|
||||
selectTab(position)
|
||||
mDressUpInfo = null
|
||||
binding.bottomView.visibility = View.INVISIBLE
|
||||
|
||||
if (isMy) {
|
||||
binding.bottomView.setVis(false)
|
||||
} else {
|
||||
binding.bottomView.visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
binding.bottomView.setVis(!isMy)
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
@@ -149,6 +157,7 @@ class DressUpTabActivity : BaseViewBindingActivity<ActivityDressUpTabBinding>()
|
||||
mDressUpInfo?.let {
|
||||
val dressUpDialog = DressUpDialog()
|
||||
dressUpDialog.mDressUpInfo = it
|
||||
dressUpDialog.isMy = isMy
|
||||
dressUpDialog.show(context)
|
||||
}
|
||||
|
||||
@@ -188,13 +197,15 @@ class DressUpTabActivity : BaseViewBindingActivity<ActivityDressUpTabBinding>()
|
||||
val data = event.data
|
||||
when (event.action) {
|
||||
DressUpEvent.Action.Select -> {
|
||||
|
||||
mDressUpInfo = data
|
||||
binding.bottomView.setVis(true)
|
||||
DressUpUtil.setTextPrice(binding.price,data)
|
||||
if (isMy) {
|
||||
if (data.dressType == TAB_HEAD_WEAR) {
|
||||
binding.avatarHead.loadUrl(data.effect)
|
||||
}
|
||||
} else {
|
||||
binding.bottomView.setVis(true)
|
||||
DressUpUtil.setTextPrice(binding.price,data)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -5,10 +5,12 @@ import android.view.View
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseDialogFragment
|
||||
import com.chwl.app.base.BaseListFragment
|
||||
import com.chwl.app.bindadapter.BaseBindingAdapter
|
||||
import com.chwl.app.common.EmptyViewHelper
|
||||
import com.chwl.app.decoration.adapter.DressUpAdapter
|
||||
import com.chwl.app.decoration.ui.DressUpDialog
|
||||
import com.chwl.app.decoration.ui.activity.DressUpTabActivity
|
||||
import com.chwl.app.decoration.util.DressUpUtil
|
||||
import com.chwl.app.event.DressUpEvent
|
||||
@@ -20,8 +22,6 @@ import com.chwl.core.decoration.car.bean.CarInfo
|
||||
import com.chwl.core.decoration.headwear.bean.ChatBubbleInfo
|
||||
import com.chwl.core.decoration.headwear.bean.UserCardWearInfo
|
||||
import com.chwl.core.decoration.nameplate.bean.NamePlateInfo
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.manager.IMNetEaseManager
|
||||
import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.doToast
|
||||
@@ -191,84 +191,91 @@ class DressUpMyFragment : BaseListFragment<DressUpInfo>() {
|
||||
|
||||
}
|
||||
|
||||
private fun userByType(
|
||||
data: DressUpInfo,
|
||||
adapter: BaseBindingAdapter<*, DressUpInfo>?,
|
||||
position: Int
|
||||
) {
|
||||
when (mDressType) {
|
||||
private fun userByType(data: DressUpInfo, adapter: BaseBindingAdapter<*, DressUpInfo>?, position: Int) {
|
||||
// when (mDressType) {
|
||||
//
|
||||
// DressUpTabActivity.TAB_CHAT_BUBBLE -> {
|
||||
// userChatBubble(data.id)
|
||||
// .compose(bindToLifecycle())
|
||||
// .doOnSuccess {
|
||||
// //更新用户信息
|
||||
// UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
// setSelect(adapter, position)
|
||||
// }
|
||||
// .doOnError {
|
||||
// it?.message?.doToast()
|
||||
// }.subscribe()
|
||||
// }
|
||||
//
|
||||
// DressUpTabActivity.TAB_USER_CARD -> {
|
||||
// userMyUserCardWear(data.id)
|
||||
// .compose(bindToLifecycle())
|
||||
// .doOnSuccess {
|
||||
// //更新用户信息
|
||||
// UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
// setSelect(adapter, position)
|
||||
// }
|
||||
// .doOnError {
|
||||
// it?.message?.doToast()
|
||||
// }.subscribe()
|
||||
// }
|
||||
//
|
||||
// DressUpTabActivity.TAB_NAMEPLATE -> {
|
||||
// useMyNamePlate(data.id,data.word)
|
||||
// .compose(bindToLifecycle())
|
||||
// .doOnSuccess {
|
||||
// if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
// // 更新房间信息
|
||||
// IMNetEaseManager.get().updateMyRoomRole()
|
||||
// }
|
||||
// //更新用户信息
|
||||
// UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
// setSelect(adapter, position)
|
||||
// }
|
||||
// .doOnError {
|
||||
// it?.message?.doToast()
|
||||
// }.subscribe()
|
||||
// }
|
||||
//
|
||||
// DressUpTabActivity.TAB_HEAD_WEAR , DressUpTabActivity.TAB_USER_INFO_BG-> {
|
||||
// postOptDress(data.dressType, data.id)
|
||||
// .compose(bindToLifecycle())
|
||||
// .doOnSuccess {
|
||||
// //更新用户信息
|
||||
// UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
// setSelect(adapter, position)
|
||||
// }
|
||||
// .doOnError {
|
||||
// it?.message?.doToast()
|
||||
// }.subscribe()
|
||||
// }
|
||||
//
|
||||
// DressUpTabActivity.TAB_CAR -> {
|
||||
// driveThisCar(data.id)
|
||||
// .compose(bindToLifecycle())
|
||||
// .doOnSuccess {
|
||||
// //更换座驾状态,需要更新缓存
|
||||
// UserModel.get().onlyUpdateLoginUserInfoCache()
|
||||
// setSelect(adapter, position)
|
||||
// }
|
||||
// .doOnError {
|
||||
// it?.message?.doToast()
|
||||
// }.subscribe()
|
||||
// }
|
||||
//
|
||||
// else -> {}
|
||||
// }
|
||||
|
||||
DressUpTabActivity.TAB_CHAT_BUBBLE -> {
|
||||
userChatBubble(data.dressId)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
//更新用户信息
|
||||
UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
setSelect(adapter, position)
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
postOptDress(data.dressType, data.id)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
//更新用户信息
|
||||
UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
setSelect(adapter, position)
|
||||
}
|
||||
|
||||
DressUpTabActivity.TAB_USER_CARD -> {
|
||||
userMyUserCardWear(data.dressId)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
//更新用户信息
|
||||
UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
setSelect(adapter, position)
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
DressUpTabActivity.TAB_NAMEPLATE -> {
|
||||
useMyNamePlate(data.id,data.word)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
// 更新房间信息
|
||||
IMNetEaseManager.get().updateMyRoomRole()
|
||||
}
|
||||
//更新用户信息
|
||||
UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
setSelect(adapter, position)
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
DressUpTabActivity.TAB_HEAD_WEAR , DressUpTabActivity.TAB_USER_INFO_BG-> {
|
||||
postOptDress(data.dressType, data.dressId)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
//更新用户信息
|
||||
UserModel.get().updateCurrentUserInfo().subscribe()
|
||||
setSelect(adapter, position)
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
DressUpTabActivity.TAB_CAR -> {
|
||||
driveThisCar(data.dressId)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
//更换座驾状态,需要更新缓存
|
||||
UserModel.get().onlyUpdateLoginUserInfoCache()
|
||||
setSelect(adapter, position)
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
private fun setData(newData:MutableList<DressUpInfo>) {
|
||||
@@ -281,12 +288,18 @@ class DressUpMyFragment : BaseListFragment<DressUpInfo>() {
|
||||
mAdapter.addData(newData)
|
||||
}
|
||||
|
||||
if (newData.size >= mPageSize) {
|
||||
mPage++
|
||||
binding.srlLayout.isEnableLoadmore = true
|
||||
} else {
|
||||
|
||||
if (mDressType == DressUpTabActivity.TAB_CAR) {
|
||||
binding.srlLayout.isEnableLoadmore = false
|
||||
} else {
|
||||
if (newData.size >= mPageSize) {
|
||||
mPage++
|
||||
binding.srlLayout.isEnableLoadmore = true
|
||||
} else {
|
||||
binding.srlLayout.isEnableLoadmore = false
|
||||
}
|
||||
}
|
||||
|
||||
stopAnim()
|
||||
}
|
||||
|
||||
@@ -325,9 +338,25 @@ class DressUpMyFragment : BaseListFragment<DressUpInfo>() {
|
||||
position: Int
|
||||
) {
|
||||
adapter?.data?.getOrNull(position)?.let { data ->
|
||||
EventBus.getDefault().post(DressUpEvent(DressUpEvent.Action.Select, data))
|
||||
if (!data.isSelect() && !data.isHasExpired){
|
||||
userByType(data,adapter, position)
|
||||
if (data.dressId != 0) {
|
||||
EventBus.getDefault().post(DressUpEvent(DressUpEvent.Action.Select, data))
|
||||
}
|
||||
|
||||
if (data.isHasExpired) {
|
||||
//弹出购买弹窗
|
||||
val dressUpDialog = DressUpDialog()
|
||||
dressUpDialog.mDressUpInfo = data
|
||||
dressUpDialog.isMy = true
|
||||
dressUpDialog.mActionCallBack = object : BaseDialogFragment.Action {
|
||||
override fun <D : Any> onAction(type: Int, data: D?) {
|
||||
onRefresh()
|
||||
}
|
||||
}
|
||||
dressUpDialog.show(context)
|
||||
} else {
|
||||
if (!data.isSelect() ){
|
||||
userByType(data,adapter, position)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,15 +397,7 @@ class DressUpMyFragment : BaseListFragment<DressUpInfo>() {
|
||||
private fun useMyNamePlate(id: Int,word: String): Single<String> {
|
||||
val ticket = AuthModel.get().ticket
|
||||
val uid = AuthModel.get().currentUid
|
||||
return api.useMyNamePlate(ticket, uid.toString(), id.toString(),word)
|
||||
.compose(RxHelper.handleStringData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private fun userMyHeadWear(id: Int): Single<String> {
|
||||
val ticket = AuthModel.get().ticket
|
||||
val uid = AuthModel.get().currentUid
|
||||
return api.userMyHeadWear(ticket, uid.toString(), id.toString())
|
||||
return api.useMyNamePlate(uid.toString(),ticket, id.toString(),word)
|
||||
.compose(RxHelper.handleStringData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
@@ -393,7 +414,6 @@ class DressUpMyFragment : BaseListFragment<DressUpInfo>() {
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
|
||||
private fun getChatBubbleInfoList(): Single<List<ChatBubbleInfo>> {
|
||||
return api.getChatBubbleInfoList(mPage,mPageSize)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
@@ -443,11 +463,6 @@ class DressUpMyFragment : BaseListFragment<DressUpInfo>() {
|
||||
@GET("car/carport/v2/list")
|
||||
fun requestMyCarsV2(@Query("uid") uid: Long): Single<ServiceResult<List<CarInfo>>>
|
||||
|
||||
/**
|
||||
* 使用头饰
|
||||
*/
|
||||
@POST("v1/user/headwear/use")
|
||||
fun userMyHeadWear(@Query("ticket") ticket: String?,@Query("uid") uid: String?, @Query("headwearId") headwear_id: String?): Single<ServiceResult<String>>
|
||||
|
||||
/**
|
||||
* 获取铭牌列表
|
||||
|
@@ -17,9 +17,11 @@ import com.chwl.core.decoration.car.bean.CarInfo
|
||||
import com.chwl.core.decoration.headwear.bean.ChatBubbleInfo
|
||||
import com.chwl.core.decoration.headwear.bean.UserCardWearInfo
|
||||
import com.chwl.core.decoration.nameplate.bean.NamePlateInfo
|
||||
import com.chwl.core.user.bean.EffectType
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setViewWH
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.common.util.toNumString
|
||||
import com.chwl.library.widget.SVGAView
|
||||
import com.chwl.library.widget.text.DrawableTextView
|
||||
import com.example.lib_utils.ktx.getColor
|
||||
@@ -40,103 +42,30 @@ class DressUpUtil {
|
||||
return outData
|
||||
}
|
||||
|
||||
//商城
|
||||
fun tranData(inData: DecorationInfo): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
|
||||
outData.dressLimitStatus = inData.dressLimitStatus
|
||||
outData.id = inData.id
|
||||
outData.discount = inData.discount
|
||||
outData.originalPrice = inData.dressPrice
|
||||
outData.originalPrice = inData.dressPrice.toNumString()
|
||||
outData.buyDay = inData.dressDay
|
||||
outData.price = inData.discountPrice.toInt()
|
||||
outData.price = inData.discountPrice.toNumString()
|
||||
outData.name = inData.name
|
||||
outData.pic = inData.pic
|
||||
outData.effect = inData.effect
|
||||
outData.effectType = inData.effectType
|
||||
outData.dressType = inData.dressType
|
||||
outData.vipLimit = inData.vipLimit
|
||||
outData.dressId = inData.dressId
|
||||
outData.id = inData.dressId
|
||||
outData.dressId = inData.id
|
||||
outData.obtainWay = inData.obtainWay
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
// 个人主页 , 头饰
|
||||
fun tranData(inData: ShopMine): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isUsed
|
||||
outData.name = inData.name
|
||||
outData.pic = inData.pic
|
||||
outData.effect = inData.effect
|
||||
outData.effectType = inData.effectType
|
||||
outData.dressType = inData.dressType
|
||||
outData.dressId = inData.dressId
|
||||
outData.obtainWay = inData.obtainWay
|
||||
|
||||
outData.hasExpired = inData.hasExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
fun tranData(inData: ChatBubbleInfo): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isHasUsed
|
||||
outData.name = inData.name
|
||||
outData.pic = inData.bubbleUrl
|
||||
outData.dressType = DressUpTabActivity.TAB_CHAT_BUBBLE
|
||||
if (inData.bubbleId.isVerify()) {
|
||||
outData.dressId = inData.bubbleId.toInt()
|
||||
}
|
||||
outData.hasExpired = inData.isHasExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
fun tranData(inData: UserCardWearInfo): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isUsed
|
||||
outData.name = inData.name
|
||||
outData.pic = inData.pic
|
||||
outData.effect = inData.pic
|
||||
outData.effectType = DressUpInfo.EffectType.MP4
|
||||
outData.dressType = DressUpTabActivity.TAB_USER_CARD
|
||||
if (inData.cardId.isVerify()) {
|
||||
outData.dressId = inData.cardId.toInt()
|
||||
}
|
||||
|
||||
outData.hasExpired = inData.isHasExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
fun tranData(inData: NamePlateInfo.NameplateListBean): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isUsing
|
||||
outData.name = inData.nameplateName
|
||||
outData.word = inData.word
|
||||
outData.pic = inData.nameplateImage
|
||||
outData.dressType = DressUpTabActivity.TAB_NAMEPLATE
|
||||
outData.dressId = inData.nameplateId
|
||||
outData.id = inData.id
|
||||
|
||||
outData.hasExpired = inData.isExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
//座驾
|
||||
fun tranData(inData: CarInfo): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
@@ -152,7 +81,12 @@ class DressUpUtil {
|
||||
outData.effectType = inData.otherViewType
|
||||
}
|
||||
outData.dressType = DressUpTabActivity.TAB_CAR
|
||||
outData.dressId = inData.carId
|
||||
outData.dressId = inData.dressShopId
|
||||
outData.id = inData.carId
|
||||
|
||||
outData.price = inData.discountPrice.toNumString()
|
||||
outData.originalPrice = inData.dressPrice.toNumString()
|
||||
outData.buyDay = inData.dressDay
|
||||
|
||||
outData.hasExpired = inData.status != CarInfo.STATUS_USER_CAN_USE
|
||||
|
||||
@@ -165,24 +99,125 @@ class DressUpUtil {
|
||||
// // dDay天后过期
|
||||
// }
|
||||
|
||||
outData.expireDays = inData.days
|
||||
outData.expireDays = inData.remainingDay
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
// 个人主页 , 头饰
|
||||
fun tranData(inData: ShopMine): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isUsed
|
||||
outData.name = inData.name
|
||||
outData.pic = inData.pic
|
||||
outData.effect = inData.effect
|
||||
outData.effectType = inData.effectType
|
||||
outData.dressType = inData.dressType
|
||||
outData.id = inData.dressId
|
||||
outData.dressId = inData.id
|
||||
outData.obtainWay = inData.obtainWay
|
||||
|
||||
outData.hasExpired = inData.hasExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
outData.price = inData.discountPrice.toNumString()
|
||||
outData.originalPrice = inData.dressPrice.toNumString()
|
||||
outData.buyDay = inData.dressDay
|
||||
return outData
|
||||
}
|
||||
|
||||
//铭牌
|
||||
fun tranData(inData: NamePlateInfo.NameplateListBean): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isUsing
|
||||
outData.name = inData.nameplateName
|
||||
outData.word = inData.word
|
||||
outData.pic = inData.nameplateImage
|
||||
outData.dressType = DressUpTabActivity.TAB_NAMEPLATE
|
||||
outData.id = inData.id
|
||||
|
||||
outData.dressId = inData.dressShopId
|
||||
outData.price = inData.discountPrice.toNumString()
|
||||
outData.originalPrice = inData.dressPrice.toNumString()
|
||||
outData.buyDay = inData.dressDay
|
||||
outData.hasExpired = inData.isExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
//用户弹窗背景
|
||||
fun tranData(inData: UserCardWearInfo): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isUsed
|
||||
outData.name = inData.name
|
||||
outData.pic = inData.pic
|
||||
outData.effect = if (inData.effect.isVerify()) inData.effect else inData.pic
|
||||
outData.effectType = EffectType.MP4
|
||||
outData.dressType = DressUpTabActivity.TAB_USER_CARD
|
||||
if (inData.cardId.isVerify()) {
|
||||
outData.id = inData.cardId.toInt()
|
||||
}
|
||||
|
||||
outData.dressId = inData.dressShopId
|
||||
outData.price = inData.discountPrice.toNumString()
|
||||
outData.originalPrice = inData.dressPrice.toNumString()
|
||||
outData.buyDay = inData.dressDay
|
||||
outData.hasExpired = inData.isHasExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
//聊天气泡
|
||||
fun tranData(inData: ChatBubbleInfo): DressUpInfo {
|
||||
|
||||
val outData = DressUpInfo()
|
||||
outData.isMy = true
|
||||
outData.isSelect = inData.isHasUsed
|
||||
outData.name = inData.name
|
||||
outData.pic = inData.bubbleUrl
|
||||
outData.dressType = DressUpTabActivity.TAB_CHAT_BUBBLE
|
||||
if (inData.bubbleId.isVerify()) {
|
||||
outData.id = inData.bubbleId.toInt()
|
||||
}
|
||||
|
||||
outData.dressId = inData.dressShopId
|
||||
outData.price = inData.discountPrice.toNumString()
|
||||
outData.originalPrice = inData.dressPrice.toNumString()
|
||||
outData.buyDay = inData.dressDay
|
||||
|
||||
outData.hasExpired = inData.isHasExpired
|
||||
outData.expireDays = inData.expireDays
|
||||
|
||||
return outData
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fun setTextPrice(textView: DrawableTextView, item: DressUpInfo) {
|
||||
val message = R.string.s_sDays_s.getString(item.price, item.buyDay, item.originalPrice)
|
||||
val message = R.string.s_sDays_s.getString(item.price, item.buyDay.toString(), item.originalPrice)
|
||||
SpannableTextBuilder(textView).appendText(message)
|
||||
.setTextStyle(
|
||||
text = item.price.toString(),
|
||||
text = item.price,
|
||||
textStyle = Typeface.BOLD
|
||||
).setTextStyle(
|
||||
text = item.buyDay.toString(),
|
||||
textStyle = Typeface.NORMAL
|
||||
).setTextStyle(
|
||||
text = item.originalPrice.toString(),
|
||||
text = item.originalPrice,
|
||||
textColor = R.color.color_d9e7f7.getColor(),
|
||||
delLine = true
|
||||
).apply()
|
||||
@@ -222,7 +257,7 @@ class DressUpUtil {
|
||||
layout.setVis(true)
|
||||
layout.removeAllViews()
|
||||
|
||||
if (data.effectType == DressUpInfo.EffectType.MP4) {
|
||||
if (data.effectType == EffectType.MP4) {
|
||||
animView = AnimView(layout.context)
|
||||
layout.addView(animView)
|
||||
animView.setLoop(Int.MAX_VALUE)
|
||||
@@ -251,7 +286,6 @@ class DressUpUtil {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
animView?.loadAnim2(data.effect,false)
|
||||
svgaView?.loadUrl(data.effect,true)
|
||||
}
|
||||
|
@@ -21,8 +21,10 @@ import com.chwl.core.home.bean.BannerInfo
|
||||
import com.chwl.core.home.bean.HomeRoomInfo
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.widget.text.DrawableTextView
|
||||
import com.example.lib_utils.AppUtils
|
||||
import com.example.lib_utils.UiUtils
|
||||
import com.example.lib_utils.ktx.getDrawable
|
||||
import com.opensource.svgaplayer.SVGADrawable
|
||||
import com.opensource.svgaplayer.SVGAImageView
|
||||
import com.tencent.qgame.animplayer.AnimView
|
||||
@@ -153,6 +155,16 @@ class HomeRoomAdapter : BaseMultiItemQuickAdapter<HomeRoomInfo, BaseViewHolder>
|
||||
}
|
||||
}
|
||||
|
||||
//todo do 标签
|
||||
val title = helper.getView<DrawableTextView>(R.id.tv_room_title)
|
||||
if (item.homeRoomType == 0) {
|
||||
title.setDrawableEmpty(null,null,R.drawable.transparent_draw.getDrawable(),null)
|
||||
}else if (item.homeRoomType == 1) {
|
||||
title.setDrawableEmpty(null,null,R.drawable.transparent_draw.getDrawable(),null)
|
||||
}else if (item.homeRoomType == 2) {
|
||||
title.setDrawableEmpty(null,null,R.drawable.transparent_draw.getDrawable(),null)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (item.bannerVoList.isVerify()){
|
||||
|
@@ -21,7 +21,6 @@ import com.chwl.app.avroom.dialog.RoomBgSetDialog
|
||||
import com.chwl.app.base.BaseActivity
|
||||
import com.chwl.app.base.BaseFragment
|
||||
import com.chwl.app.databinding.FragmentMeBinding
|
||||
import com.chwl.app.decoration.ui.activity.DressUpTabActivity
|
||||
import com.chwl.app.home.HomeViewModel
|
||||
import com.chwl.app.home.MeViewModel
|
||||
import com.chwl.app.home.activity.AssociationActivity
|
||||
@@ -37,6 +36,7 @@ import com.chwl.app.ui.relation.FansListActivity
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils
|
||||
import com.chwl.app.ui.wallet.WalletActivity
|
||||
import com.chwl.app.ui.webview.CommonWebViewActivity
|
||||
import com.chwl.app.ui.widget.UserInfoDialog
|
||||
import com.chwl.app.utils.HomeUIManager
|
||||
import com.chwl.app.view.GenderAgeTextView
|
||||
import com.chwl.app.vip.VipCenterActivity
|
||||
@@ -374,7 +374,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
R.id.tv_user_name -> {
|
||||
//todo do 测试按钮
|
||||
if (BuildConfig.DEBUG) {
|
||||
DressUpTabActivity.start(requireActivity(),false)
|
||||
UserInfoDialog.showNewUserInfoDialog(context,AuthModel.get().currentUid)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -44,6 +44,7 @@ import com.chwl.app.ui.user.fragment.UserInfoDynamicFragment;
|
||||
import com.chwl.app.ui.user.viewmodel.UserInfoViewModel;
|
||||
import com.chwl.app.ui.utils.CpUtils;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.app.ui.utils.VipUtil;
|
||||
import com.chwl.app.ui.widget.ButtonItem;
|
||||
import com.chwl.app.ui.widget.ObservableScrollView;
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
@@ -267,9 +268,11 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
|
||||
private void initUserInfoDetailObserver() {
|
||||
viewModel.getUserInfoDetailData().observe(this, dataBean -> {
|
||||
if (dataBean == null) return;
|
||||
initPhoto(dataBean.getPrivatePhoto());
|
||||
setWhereVisible();
|
||||
setCpInfo(dataBean);
|
||||
setUserBgInfo(dataBean);
|
||||
setUserNameplateList(dataBean);
|
||||
});
|
||||
viewModel.getUserInfoDetailError().observe(this, String -> {
|
||||
@@ -485,6 +488,13 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
||||
|
||||
}
|
||||
|
||||
//userBg
|
||||
private void setUserBgInfo(UserDetailInfo.DataBean dataBean) {
|
||||
VipUtil.INSTANCE.setUserBg(dataBean.getUsingPersonalBackground(),mBinding.userInfoLayoutBg,aBoolean -> {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
private void setMarginTop(View view, int top) {
|
||||
if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
|
||||
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
|
@@ -2,8 +2,6 @@ package com.chwl.app.ui.utils
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.view.View
|
||||
import android.view.View.OnAttachStateChangeListener
|
||||
import androidx.core.view.isVisible
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
import com.bumptech.glide.request.RequestFutureTarget
|
||||
@@ -11,16 +9,12 @@ import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.application.App
|
||||
import com.chwl.app.application.GlobalHandleManager
|
||||
import com.chwl.core.utils.LogUtils
|
||||
import com.chwl.library.utils.ResUtil
|
||||
import com.netease.nim.uikit.support.glide.GlideApp
|
||||
import com.tencent.qgame.animplayer.AnimConfig
|
||||
import com.tencent.qgame.animplayer.AnimView
|
||||
import com.tencent.qgame.animplayer.inter.IAnimListener
|
||||
import com.tencent.qgame.animplayer.inter.IFetchResource
|
||||
import com.tencent.qgame.animplayer.mix.Resource
|
||||
import com.tencent.qgame.animplayer.util.ScaleType
|
||||
|
||||
object CpUtils {
|
||||
|
||||
@@ -165,4 +159,6 @@ object CpUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -173,15 +173,18 @@ fun AnimView.loadAnim(url: String) {
|
||||
})
|
||||
}
|
||||
|
||||
fun AnimView.loadAnim2(url: String,isSafe:Boolean = true) {
|
||||
fun AnimView.loadAnim2(url: String,isSafe:Boolean = true,callBack: (isSuccess: Boolean) -> Unit ={_->}) {
|
||||
if (context.isDestroyed()) return
|
||||
GlideUtils.instance().downloadFromUrl2(context,url.trim(),object : RequestListener<File?> {
|
||||
LogUtils.d("AnimLoadUtil drawEffect loadAnim2 url = $url")
|
||||
GlideUtils.instance().downloadFromUrl2(context,url,object : RequestListener<File?> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
model: Any?,
|
||||
target: Target<File?>?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
callBack(false)
|
||||
LogUtils.d("AnimLoadUtil drawEffect loadAnim2 onLoadFailed url = $url")
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -200,7 +203,8 @@ fun AnimView.loadAnim2(url: String,isSafe:Boolean = true) {
|
||||
} else {
|
||||
this@loadAnim2.startPlay(resource)
|
||||
}
|
||||
|
||||
callBack(true)
|
||||
LogUtils.d("AnimLoadUtil drawEffect loadAnim2 onResourceReady url = $url")
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
@@ -1,6 +1,17 @@
|
||||
package com.chwl.app.ui.utils
|
||||
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.avroom.widget.GalleryLayoutManager.LayoutParams
|
||||
import com.chwl.core.user.bean.EffectType
|
||||
import com.chwl.core.user.bean.UserBgVO
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setViewWH
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.widget.SVGAView
|
||||
import com.tencent.qgame.animplayer.AnimView
|
||||
import com.tencent.qgame.animplayer.util.ScaleType
|
||||
|
||||
object VipUtil {
|
||||
|
||||
@@ -19,4 +30,54 @@ object VipUtil {
|
||||
fun getVipIcon(level: Int) {
|
||||
vipIcons.getOrNull(level)?:R.drawable.vip_center_identification_vipidentity_lv1
|
||||
}
|
||||
|
||||
|
||||
fun setUserBg(
|
||||
data: UserBgVO?,
|
||||
layout: ViewGroup,
|
||||
callBack: (isSuccess: Boolean) -> Unit ={_->}
|
||||
){
|
||||
if (data != null) {
|
||||
layout.setVis(true)
|
||||
layout.removeAllViews()
|
||||
|
||||
if (data.effectType == EffectType.IMG) {
|
||||
val url = if (data.effect.isVerify()) data.effect else data.pic
|
||||
val image = ImageView(layout.context)
|
||||
layout.addView(image)
|
||||
image.setViewWH(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, false)
|
||||
image.setScaleType(ImageView.ScaleType.FIT_XY)
|
||||
image.loadImage(url)
|
||||
callBack(true)
|
||||
}else {
|
||||
if (data.effect.isVerify()) {
|
||||
var animView : AnimView?=null
|
||||
var svgaView : SVGAView?=null
|
||||
|
||||
if (data.effectType == EffectType.MP4) {
|
||||
animView = AnimView(layout.context)
|
||||
layout.addView(animView)
|
||||
animView.setLoop(Int.MAX_VALUE)
|
||||
animView.setScaleType(ScaleType.FIT_XY)
|
||||
callBack(true)
|
||||
} else if (data.effectType == EffectType.SVGA) {
|
||||
svgaView = SVGAView(layout.context)
|
||||
layout.addView(svgaView)
|
||||
svgaView.loops = Int.MAX_VALUE
|
||||
svgaView.setScaleType(ImageView.ScaleType.FIT_XY)
|
||||
callBack(true)
|
||||
} else {
|
||||
callBack(false)
|
||||
}
|
||||
|
||||
animView?.setViewWH(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, false)
|
||||
svgaView?.setViewWH(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT,false)
|
||||
|
||||
animView?.loadAnim2(data.effect,false)
|
||||
svgaView?.loadUrl(data.effect,true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -4,7 +4,6 @@ import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_DRAGON_BA
|
||||
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_DRAGON_BAR_CANCEL;
|
||||
import static com.chwl.core.manager.RoomEvent.DRAGON_BAR_CANCEL;
|
||||
import static com.chwl.library.utils.ResUtil.getString;
|
||||
import static com.netease.nim.uikit.common.util.log.LogUtil.log;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ClipData;
|
||||
@@ -22,18 +21,12 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatDialog;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.UIHelper;
|
||||
import com.chwl.app.avroom.ButtonItemFactory;
|
||||
@@ -46,6 +39,7 @@ import com.chwl.app.ui.user.activity.UserInfoActivity;
|
||||
import com.chwl.app.ui.user.adapter.SkillPicsAdapter;
|
||||
import com.chwl.app.ui.user.decorationsend.UserInfoSkillDecoration;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.app.ui.utils.VipUtil;
|
||||
import com.chwl.app.utils.AvatarHelper;
|
||||
import com.chwl.app.utils.RegexUtil;
|
||||
import com.chwl.app.view.GenderAgeTextView;
|
||||
@@ -89,29 +83,24 @@ import com.chwl.core.utils.net.BeanObserver;
|
||||
import com.chwl.core.utils.net.DontWarnObserver;
|
||||
import com.chwl.core.utils.net.RxHelper;
|
||||
import com.chwl.core.vip.bean.UserVipInfo;
|
||||
import com.chwl.library.common.glide.GlideUtils;
|
||||
import com.chwl.library.net.rxnet.callback.CallBack;
|
||||
import com.chwl.library.utils.ListUtils;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.chwl.library.utils.SingleToastUtil;
|
||||
import com.chwl.library.utils.config.BasicConfig;
|
||||
import com.chwl.library.widget.SVGAView;
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.google.android.flexbox.FlexboxLayout;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomKickOutEvent;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.tencent.qgame.animplayer.AnimConfig;
|
||||
import com.tencent.qgame.animplayer.AnimView;
|
||||
import com.tencent.qgame.animplayer.inter.IAnimListener;
|
||||
import com.tencent.qgame.animplayer.util.ScaleType;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -142,6 +131,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
* 头像高斯模糊背景
|
||||
*/
|
||||
private ImageView ivAvatarBg;
|
||||
private SuperTextView ivAvatarBgMask;
|
||||
private ImageView ivBadge;
|
||||
private ImageView ivVipIcon;
|
||||
private TextView nick;
|
||||
@@ -155,8 +145,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
private AppCompatImageView mIvGoodNumber;
|
||||
private AppCompatImageView mIvUserLevel;
|
||||
private AppCompatImageView mIvUserCharm;
|
||||
private ImageView ivUserCardWear;
|
||||
private AnimView ivUserCardWearMP4;
|
||||
private FrameLayout mUserCardWearLayout;
|
||||
private TextView tvFamilyNameLabel;
|
||||
private TextView tvFamilyName;
|
||||
private FlexboxLayout flexbox;
|
||||
@@ -253,6 +242,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
avatarLayout = findViewById(R.id.fl_avatar_layout);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
ivAvatarBg = findViewById(R.id.iv_avatar_bg);
|
||||
ivAvatarBgMask = findViewById(R.id.transition_mask);
|
||||
nick = findViewById(R.id.nick);
|
||||
erbanId = findViewById(R.id.tv_erban_id);
|
||||
ivCopy = findViewById(R.id.iv_copy);
|
||||
@@ -274,42 +264,8 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
mIvGoodNumber = findViewById(R.id.iv_good_number);
|
||||
mIvUserLevel = findViewById(R.id.iv_user_level);
|
||||
mIvUserCharm = findViewById(R.id.iv_user_charm);
|
||||
ivUserCardWear = findViewById(R.id.iv_user_card_wear);
|
||||
|
||||
ivUserCardWearMP4 = findViewById(R.id.iv_user_card_wear_mp4);
|
||||
ivUserCardWearMP4.setScaleType(ScaleType.CENTER_CROP);
|
||||
ivUserCardWearMP4.setLoop(Integer.MAX_VALUE);
|
||||
ivUserCardWearMP4.setAnimListener(new IAnimListener() {
|
||||
@Override
|
||||
public boolean onVideoConfigReady(@NonNull AnimConfig animConfig) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoStart() {
|
||||
log( "onVideoStart: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoRender(int i, @Nullable AnimConfig animConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoComplete() {
|
||||
log( "onVideoComplete: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoDestroy() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(int i, @Nullable String s) {
|
||||
|
||||
}
|
||||
});
|
||||
mUserCardWearLayout = findViewById(R.id.userCardWearLayout);
|
||||
|
||||
|
||||
tvFamilyNameLabel = (TextView) findViewById(R.id.tv_family_name_label);
|
||||
@@ -602,14 +558,6 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
setOfficialMask(null, null);
|
||||
}
|
||||
|
||||
//资料卡装扮
|
||||
if (!TextUtils.isEmpty(userInfo.getUserInfoCardPic())) {
|
||||
drawVAPEffect(userInfo.getUserInfoCardPic());
|
||||
// drawVAPEffect("https://image.pekolive.com/v7.mp4");
|
||||
} else {
|
||||
ivUserCardWear.setImageDrawable(null);
|
||||
ivUserCardWearMP4.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (null != findHimView) {
|
||||
//获取用户房间信息
|
||||
@@ -665,41 +613,6 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
}
|
||||
}
|
||||
|
||||
private void drawVAPEffect(String url) {
|
||||
|
||||
GlideUtils.instance().downloadFromUrl2(getContext(), url, new RequestListener<File>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<File> target, boolean isFirstResource) {
|
||||
ImageLoadUtils.loadImage(context, userInfo.getUserInfoCardPic(), ivUserCardWear);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
|
||||
if (resource != null) {
|
||||
ivUserCardWearMP4.startPlay(resource);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// String filePath = PathHelper.INSTANCE.generateResourcesFilePath(url);
|
||||
// DownloadRequest request = DownloadRequest.Companion.build(url, filePath, "gift_effect_download", null, 60000L);
|
||||
// DownloadManager.INSTANCE.download(request, new FileDownloadListener() {
|
||||
// @Override
|
||||
// public void onDownloadCompleted(@NonNull DownloadTask task) {
|
||||
// String path = task.getRequest().getPath();
|
||||
// ivUserCardWearMP4.startPlay(new File(path));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onDownloadError(@NonNull DownloadException exception) {
|
||||
// ImageLoadUtils.loadImage(context, userInfo.getUserInfoCardPic(), ivUserCardWear);
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
private void copyName() {
|
||||
try {
|
||||
ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
@@ -800,22 +713,30 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
||||
AvatarHelper.loadAvatarFrame(ivAvatarHeadWear, avatarFrame, userHeadwear.getType());
|
||||
}
|
||||
}
|
||||
if (vipInfo != null && !vipInfo.getUserCardBG().isEmpty()) {
|
||||
// findViewById(R.id.transition_mask).setVisibility(View.GONE);
|
||||
ivAvatarBg.setScaleType(ImageView.ScaleType.MATRIX);
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
vipInfo.getUserCardBG().replace("\n",""),
|
||||
ivAvatarBg,
|
||||
R.drawable.default_avatar
|
||||
);
|
||||
} else {
|
||||
if (avatarBg == null || !avatarBg.equals(userInfo.getAvatar())) {
|
||||
avatarBg = userInfo.getAvatar();
|
||||
ImageLoadUtils.loadImageWithBlur(context, userInfo.getAvatar(), ivAvatarBg, 10, 1);
|
||||
}
|
||||
|
||||
|
||||
if (userInfo != null) {
|
||||
//资料卡装扮
|
||||
ivAvatarBgMask.setVisibility(View.INVISIBLE);
|
||||
ivAvatarBg.setVisibility(View.INVISIBLE);
|
||||
|
||||
VipUtil.INSTANCE.setUserBg(userInfo.getInfoCardVo(),mUserCardWearLayout, callBack -> {
|
||||
if (callBack) {
|
||||
ivAvatarBgMask.setVisibility(View.INVISIBLE);
|
||||
ivAvatarBg.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
if (avatarBg == null || !avatarBg.equals(userInfo.getAvatar())) {
|
||||
avatarBg = userInfo.getAvatar();
|
||||
ImageLoadUtils.loadImageWithBlur(context, userInfo.getAvatar(), ivAvatarBg, 10, 1);
|
||||
ivAvatarBgMask.setVisibility(View.VISIBLE);
|
||||
ivAvatarBg.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// if (nobleInfo == null || TextUtils.isEmpty(nobleInfo.getCardBg())) {
|
||||
// //如果没贵族信息,就加载头像作为背景
|
||||
// if (avatarBg == null || !avatarBg.equals(userInfo.getAvatar())) {
|
||||
|
277
app/src/main/java/com/chwl/app/utils/AnimLoadUtil.kt
Normal file
277
app/src/main/java/com/chwl/app/utils/AnimLoadUtil.kt
Normal file
@@ -0,0 +1,277 @@
|
||||
package com.chwl.app.utils
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.Color
|
||||
import android.text.Layout
|
||||
import android.text.StaticLayout
|
||||
import android.text.TextPaint
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
import com.bumptech.glide.request.RequestFutureTarget
|
||||
import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.application.App
|
||||
import com.chwl.app.ui.utils.loadAnim2
|
||||
import com.chwl.core.utils.LogUtils
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.netease.nim.uikit.support.glide.GlideApp
|
||||
import com.opensource.svgaplayer.SVGADrawable
|
||||
import com.opensource.svgaplayer.SVGADynamicEntity
|
||||
import com.opensource.svgaplayer.SVGAImageView
|
||||
import com.opensource.svgaplayer.SVGAParser
|
||||
import com.opensource.svgaplayer.SVGAParser.Companion.shareParser
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity
|
||||
import com.tencent.qgame.animplayer.AnimView
|
||||
import com.tencent.qgame.animplayer.inter.IFetchResource
|
||||
import com.tencent.qgame.animplayer.mix.Resource
|
||||
import java.io.BufferedInputStream
|
||||
import java.io.FileInputStream
|
||||
|
||||
object AnimLoadUtil {
|
||||
|
||||
|
||||
fun loadVap(
|
||||
animView: AnimView,
|
||||
url: String?,
|
||||
imgUrlMap: HashMap<String, String>? = null,
|
||||
textMap: HashMap<String, String>? = null,
|
||||
callBack: (isSuccess: Boolean) -> Unit
|
||||
) {
|
||||
LogUtils.d("AnimLoadUtil drawEffect loadVap 准备开始 imgUrlMap = $imgUrlMap textMap = $textMap url = $url}")
|
||||
if (url == null) {
|
||||
callBack(false)
|
||||
return
|
||||
}
|
||||
animView.visibility = View.VISIBLE
|
||||
var index = 0
|
||||
val bitmapMap = hashMapOf<String, Bitmap?>()
|
||||
|
||||
if (!imgUrlMap.isNullOrEmpty()) {
|
||||
imgUrlMap.keys.forEach { key ->
|
||||
|
||||
if (!imgUrlMap[key].isVerify()){
|
||||
callBack(false)
|
||||
return
|
||||
}
|
||||
|
||||
downLoadAvatar(imgUrlMap[key]) { resource ->
|
||||
if (resource == null) {
|
||||
callBack(false)
|
||||
} else {
|
||||
index++
|
||||
bitmapMap[key] = resource
|
||||
if (index == imgUrlMap.keys.size) {
|
||||
animView.setFetchResource(object : IFetchResource {
|
||||
override fun fetchImage(
|
||||
resource: Resource,
|
||||
result: (Bitmap?) -> Unit
|
||||
) {
|
||||
LogUtils.d("AnimLoadUtil drawEffect loadVap animView.setFetchResource fetchImage resource.tag = ${resource.tag}")
|
||||
if (bitmapMap.isEmpty()) {
|
||||
result(null)
|
||||
} else {
|
||||
var bitmap: Bitmap? = null
|
||||
bitmapMap.keys.forEach {
|
||||
if (resource.tag == it) {
|
||||
bitmap = bitmapMap[it]
|
||||
}
|
||||
}
|
||||
result(bitmap)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fetchText(
|
||||
resource: Resource,
|
||||
result: (String?) -> Unit
|
||||
) {
|
||||
var text = " "
|
||||
if (textMap.isNullOrEmpty()) {
|
||||
result(text)
|
||||
} else {
|
||||
textMap.keys.forEach {
|
||||
if (resource.tag == it) {
|
||||
text = textMap[it].toString()
|
||||
}
|
||||
}
|
||||
result(text)
|
||||
}
|
||||
LogUtils.d("AnimLoadUtil drawEffect loadVap animView.setFetchResource fetchText text.key = ${resource.tag} text.value = $text")
|
||||
}
|
||||
|
||||
override fun releaseResource(resources: List<Resource>) {
|
||||
resources?.forEach {
|
||||
it?.bitmap?.recycle()
|
||||
}
|
||||
}
|
||||
})
|
||||
LogUtils.d("AnimLoadUtil drawEffect animViewSetAnimListener startPlay url = $url")
|
||||
animView.loadAnim2(url,false){ isSuccess ->
|
||||
callBack(isSuccess)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
animView.loadAnim2(url){ isSuccess ->
|
||||
callBack(isSuccess)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun downLoadAvatar(url: String?, onResourceReady: (resource: Bitmap?) -> Unit) {
|
||||
if (url.isNullOrEmpty()) {
|
||||
onResourceReady(null)
|
||||
return
|
||||
}
|
||||
try {
|
||||
val futureTarget =
|
||||
RequestFutureTarget<Bitmap>(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
|
||||
GlideApp.with(App.instance())
|
||||
.asBitmap()
|
||||
.circleCrop()
|
||||
.load(url)
|
||||
.addListener(object : RequestListener<Bitmap?> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
model: Any?,
|
||||
target: Target<Bitmap?>?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
onResourceReady(null)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onResourceReady(
|
||||
resource: Bitmap?,
|
||||
model: Any?,
|
||||
target: Target<Bitmap?>?,
|
||||
dataSource: DataSource?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
onResourceReady(resource)
|
||||
return true
|
||||
}
|
||||
})
|
||||
.into(futureTarget)
|
||||
.get()
|
||||
} catch (e: Exception) {
|
||||
// onResourceReady(null)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun loadSvga(
|
||||
svgaView: SVGAImageView,
|
||||
path: String,
|
||||
imgUrlMap: HashMap<String, String>? = null,
|
||||
textMap: HashMap<String, String>? = null,
|
||||
callBack: (isSuccess: Boolean) -> Unit
|
||||
) {
|
||||
|
||||
val inputStream = BufferedInputStream(FileInputStream(path))
|
||||
shareParser().decodeFromInputStream(inputStream, path, object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(svgaVideoEntity: SVGAVideoEntity) {
|
||||
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
|
||||
if (!imgUrlMap.isNullOrEmpty()) {
|
||||
imgUrlMap.keys.forEach { key ->
|
||||
addDynamicImage(
|
||||
svgaView,
|
||||
dynamicEntity,
|
||||
imgUrlMap[key],
|
||||
key
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (!textMap.isNullOrEmpty()) {
|
||||
textMap.keys.forEach { key ->
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字体颜色
|
||||
textPaint.textSize = 24f //字体大小
|
||||
dynamicEntity.setDynamicText(
|
||||
StaticLayout(
|
||||
textMap[key],
|
||||
0,
|
||||
textMap[key]!!.length,
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_CENTER,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), key
|
||||
)
|
||||
}
|
||||
}
|
||||
val drawable = SVGADrawable(svgaVideoEntity, dynamicEntity)
|
||||
svgaView.setImageDrawable(drawable)
|
||||
svgaView.stepToFrame(0, true)
|
||||
|
||||
callBack(true)
|
||||
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
callBack(false)
|
||||
}
|
||||
}, true, null, null)
|
||||
}
|
||||
|
||||
private fun addDynamicImage(
|
||||
view: View,
|
||||
dynamicEntity: SVGADynamicEntity,
|
||||
url: String?,
|
||||
forKey: String?
|
||||
) {
|
||||
if (TextUtils.isEmpty(url) || TextUtils.isEmpty(forKey)) {
|
||||
LogUtils.d("AnimLoadUtil drawEffect addDynamicImage: url or forKey is null or empty")
|
||||
return
|
||||
}
|
||||
GlideApp.with(App.instance())
|
||||
.asBitmap()
|
||||
.circleCrop()
|
||||
.load(url)
|
||||
.addListener(object : RequestListener<Bitmap?> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
model: Any,
|
||||
target: Target<Bitmap?>,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
view.post {
|
||||
dynamicEntity.setDynamicImage(
|
||||
BitmapFactory.decodeResource(view.resources, R.drawable.default_avatar),
|
||||
forKey!!
|
||||
)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onResourceReady(
|
||||
resource: Bitmap?,
|
||||
model: Any,
|
||||
target: Target<Bitmap?>,
|
||||
dataSource: DataSource,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
view.post {
|
||||
dynamicEntity.setDynamicImage(
|
||||
resource!!,
|
||||
forKey!!
|
||||
)
|
||||
}
|
||||
return false
|
||||
}
|
||||
})
|
||||
.submit()
|
||||
}
|
||||
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/bg_white.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/bg_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
@@ -59,13 +59,28 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<!-- 用户信息背景 layout-->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/userInfoLayout"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="#08151a"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<!-- 装扮背景 layout-->
|
||||
<FrameLayout
|
||||
android:id="@+id/userInfoLayoutBg"
|
||||
android:layout_width="match_parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/ivHeadWear"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_370"/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/userInfoLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_57"
|
||||
android:background="#08151a"
|
||||
app:layout_constraintTop_toTopOf="@id/ivHeadWear">
|
||||
|
||||
<TextView
|
||||
|
@@ -43,7 +43,7 @@
|
||||
android:textSize="18sp"
|
||||
android:visibility="gone"
|
||||
app:dt_drawableLeftHeight="18dp"
|
||||
app:dt_drawableLeftSrc="@drawable/ic_gif"
|
||||
app:dt_drawableLeftSrc="@drawable/ic_coin_84"
|
||||
app:dt_drawableLeftWidth="18dp"
|
||||
app:dt_drawableType="shape"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@@ -12,32 +12,39 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<!-- 顶部默认背景-->
|
||||
<View
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="110dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:background="@color/white"/>
|
||||
|
||||
<!-- 用户装扮资料卡-->
|
||||
<FrameLayout
|
||||
android:id="@+id/userCardWearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
tools:visibility="visible"
|
||||
tools:background="@drawable/bg_user_card_wear" />
|
||||
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_userinfo"
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="110dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
tools:background="@color/appColor_tran_10">
|
||||
android:layout_gravity="bottom|center_horizontal">
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:corner="11dp"
|
||||
app:left_bottom_corner="false"
|
||||
app:left_top_corner="true"
|
||||
app:right_bottom_corner="false"
|
||||
app:right_top_corner="true"
|
||||
app:solid="@color/color_f5f5f5"
|
||||
tools:contentDescription="@string/layout_dialog_user_info_01"
|
||||
tools:visibility="invisible" />
|
||||
|
||||
<!-- 用户没有装扮时 加载 头像为背景-->
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_avatar_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/default_banner"
|
||||
android:src="@drawable/bg_white"
|
||||
android:visibility="invisible"
|
||||
app:riv_corner_radius_top_left="@dimen/dp_10"
|
||||
app:riv_corner_radius_top_right="@dimen/dp_10"
|
||||
tools:contentDescription="@string/layout_dialog_user_info_02" />
|
||||
@@ -48,6 +55,7 @@
|
||||
android:layout_height="match_parent"
|
||||
app:corner="@dimen/dp_10"
|
||||
app:left_bottom_corner="false"
|
||||
android:visibility="invisible"
|
||||
app:left_top_corner="true"
|
||||
app:right_bottom_corner="false"
|
||||
app:right_top_corner="true"
|
||||
@@ -320,18 +328,6 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_card_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
tools:visibility="gone"
|
||||
tools:background="@drawable/bg_user_card_wear" />
|
||||
<com.tencent.qgame.animplayer.AnimView
|
||||
android:id="@+id/iv_user_card_wear_mp4"
|
||||
android:layout_width="match_parent"
|
||||
tools:visibility="gone"
|
||||
android:layout_height="180dp"
|
||||
tools:background="@drawable/bg_user_card_wear" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
@@ -52,9 +52,13 @@
|
||||
tools:src="@color/color_313131"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/tv_room_title"
|
||||
android:layout_width="0dp"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
app:dt_drawableRightWidth="@dimen/dp_14"
|
||||
app:dt_drawableRightHeight="@dimen/dp_14"
|
||||
app:dt_drawableRightSrc="@drawable/transparent_draw"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:ellipsize="end"
|
||||
|
@@ -5354,6 +5354,7 @@ You cannot join again within 24 hours after leaving</string>
|
||||
<string name="Not_used">Not used</string>
|
||||
<string name="userInfoBg">userInfoBg</string>
|
||||
<string name="My_Dress">My Dress</string>
|
||||
<string name="limit">limit</string>
|
||||
<string name="vipLimit">VIP限制 %s</string>
|
||||
<string name="obtainWayAction">活动获取 不可购买</string>
|
||||
<string name="s_sDays_s">%s/%sDays %s</string>
|
||||
|
@@ -3,7 +3,7 @@ package com.chwl.core.decoration.bean
|
||||
data class DecorationInfo(
|
||||
val dressDay: Int = 0,
|
||||
val dressId: Int = 0,
|
||||
val dressPrice: Int = 0,
|
||||
val dressPrice: Double = 0.0,
|
||||
val dressSeq: Int = 0,
|
||||
val dressType: Int = 0,
|
||||
val id: Int = 0,
|
||||
|
@@ -12,9 +12,9 @@ public class DressUpInfo {
|
||||
public String pic;
|
||||
public String name;
|
||||
public String word;
|
||||
public int price;
|
||||
public String price="";
|
||||
public String originalPrice="";
|
||||
public int buyDay;
|
||||
public int originalPrice;
|
||||
|
||||
public String effect; //装扮动效图片
|
||||
/**
|
||||
@@ -22,8 +22,15 @@ public class DressUpInfo {
|
||||
*/
|
||||
public int effectType;
|
||||
public int dressType; // 商品类型
|
||||
/**
|
||||
* 请求使用接口时 用
|
||||
*/
|
||||
public int id; //商品类型id
|
||||
/**
|
||||
* 请求购买 赠送 续费接口时用
|
||||
*/
|
||||
public int dressId; // 商品类型
|
||||
public int discountPrice; //折扣价格
|
||||
// public int discountPrice; //折扣价格
|
||||
public int vipLevel; //当前用户VIP等级
|
||||
public int discount; // 折扣百分比
|
||||
public int vipLimit; //VIP等级限定 ,0=不限定
|
||||
@@ -31,15 +38,9 @@ public class DressUpInfo {
|
||||
* //1-普通 2-活动
|
||||
*/
|
||||
public int obtainWay;
|
||||
public int id; //商品类型id
|
||||
|
||||
|
||||
public int expireDays; //剩余天数
|
||||
public int expireDays = -1; //剩余天数
|
||||
public boolean hasExpired; //是否过期
|
||||
|
||||
public @interface EffectType{
|
||||
int MP4 = 1;
|
||||
int SVGA = 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -4,7 +4,8 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ShopMine {
|
||||
public int dressId; //装扮id
|
||||
public int id; //装扮id 使用
|
||||
public int dressId; //装扮id 购买
|
||||
public int dressType; //装扮类型
|
||||
public int obtainWay; //获取方式 1-普通 2-活动
|
||||
|
||||
@@ -14,7 +15,11 @@ public class ShopMine {
|
||||
public boolean used;
|
||||
public int expireDays = -1; //剩余天数
|
||||
public int effectType;
|
||||
public int dressDay;
|
||||
public boolean hasExpired; //是否过期
|
||||
|
||||
public double discountPrice; //
|
||||
public double dressPrice; //
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.chwl.core.decoration.car.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.chwl.core.decoration.bean.BaseDecoration;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
@@ -48,7 +48,8 @@ public class CarInfo extends BaseDecoration implements Serializable {
|
||||
*/
|
||||
public int status = STATUS_INVALID;
|
||||
@SerializedName("id")
|
||||
private int carId;
|
||||
private int carId; //使用 用 id
|
||||
private int dressShopId; // 购买续费 用 dressShopId
|
||||
/**
|
||||
* 座驾的封面
|
||||
*/
|
||||
@@ -76,6 +77,10 @@ public class CarInfo extends BaseDecoration implements Serializable {
|
||||
*/
|
||||
private int days = -1;
|
||||
private int nobleId;
|
||||
|
||||
private double dressPrice;
|
||||
private double discountPrice;
|
||||
private int dressDay;
|
||||
/**
|
||||
* 标签类型(0、无 1、新品 2、折扣 3、限定 4、专属)
|
||||
*/
|
||||
|
@@ -13,4 +13,14 @@ public class ChatBubbleInfo {
|
||||
private String bubbleUrl;
|
||||
private boolean hasUsed;
|
||||
private int labelType;
|
||||
|
||||
private int dressShopId;
|
||||
private double dressPrice;
|
||||
private double discountPrice;
|
||||
private String discount;
|
||||
private int vipLevel;
|
||||
private String effect;
|
||||
private int effectType;
|
||||
private int dressDay;
|
||||
|
||||
}
|
||||
|
@@ -13,4 +13,15 @@ public class UserCardWearInfo {
|
||||
private String pic;
|
||||
private boolean used;
|
||||
private int labelType;
|
||||
|
||||
private int dressShopId;
|
||||
private double dressPrice;
|
||||
private double discountPrice;
|
||||
private String discount;
|
||||
private int vipLevel;
|
||||
private String effect;
|
||||
private int effectType;
|
||||
private int dressDay;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -59,6 +59,42 @@ public class NamePlateInfo {
|
||||
private int expireDays;
|
||||
private boolean isUsing;
|
||||
private String word;
|
||||
private double discountPrice;
|
||||
private double dressPrice;
|
||||
private int dressShopId;
|
||||
private int dressDay;
|
||||
|
||||
public int getDressDay() {
|
||||
return dressDay;
|
||||
}
|
||||
|
||||
public void setDressDay(int dressDay) {
|
||||
this.dressDay = dressDay;
|
||||
}
|
||||
|
||||
public double getDiscountPrice() {
|
||||
return discountPrice;
|
||||
}
|
||||
|
||||
public void setDiscountPrice(double discountPrice) {
|
||||
this.discountPrice = discountPrice;
|
||||
}
|
||||
|
||||
public double getDressPrice() {
|
||||
return dressPrice;
|
||||
}
|
||||
|
||||
public void setDressPrice(double dressPrice) {
|
||||
this.dressPrice = dressPrice;
|
||||
}
|
||||
|
||||
public int getDressShopId() {
|
||||
return dressShopId;
|
||||
}
|
||||
|
||||
public void setDressShopId(int dressShopId) {
|
||||
this.dressShopId = dressShopId;
|
||||
}
|
||||
|
||||
public String getWord() {
|
||||
return word;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.chwl.core.gift;
|
||||
|
||||
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_ALL_MIC_LUCKY_GIFT;
|
||||
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_ALL_SERVICE_GIFT;
|
||||
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT;
|
||||
import static com.chwl.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_MULTI_LUCK_GIFT;
|
||||
import static com.chwl.core.utils.extension.StringExtensionKt.toast;
|
||||
@@ -12,14 +13,6 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chwl.core.gift.bean.GiftPanelInfo;
|
||||
import com.chwl.core.gift.bean.TagsInfo;
|
||||
import com.chwl.core.home.bean.TabInfo;
|
||||
import com.chwl.core.pay.event.UpdateWalletInfoEvent;
|
||||
import com.chwl.core.utils.ComboUtil;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
||||
import com.chwl.core.Constants;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.base.BaseModel;
|
||||
@@ -28,12 +21,14 @@ import com.chwl.core.gift.bean.GiftFreeInfo;
|
||||
import com.chwl.core.gift.bean.GiftInfo;
|
||||
import com.chwl.core.gift.bean.GiftListInfo;
|
||||
import com.chwl.core.gift.bean.GiftMultiReceiverInfo;
|
||||
import com.chwl.core.gift.bean.GiftPanelInfo;
|
||||
import com.chwl.core.gift.bean.GiftSendType;
|
||||
import com.chwl.core.gift.bean.GiftSource;
|
||||
import com.chwl.core.gift.bean.GiftType;
|
||||
import com.chwl.core.gift.bean.LuckyBagGifts;
|
||||
import com.chwl.core.gift.bean.LuckyBagNoticeInfo;
|
||||
import com.chwl.core.gift.bean.MultiGiftReceiveInfo;
|
||||
import com.chwl.core.gift.bean.TagsInfo;
|
||||
import com.chwl.core.gift.event.RoomFreeGiftEvent;
|
||||
import com.chwl.core.gift.event.UpdateKnapEvent;
|
||||
import com.chwl.core.gift.event.UpdateKnapFreeGiftEvent;
|
||||
@@ -41,6 +36,7 @@ import com.chwl.core.gift.event.UpdateKnapFreeGiftNumEvent;
|
||||
import com.chwl.core.gift.exception.GiftOutOfDateException;
|
||||
import com.chwl.core.gift.toolbox.GiftToolbox;
|
||||
import com.chwl.core.im.custom.bean.CustomAttachment;
|
||||
import com.chwl.core.im.custom.bean.GiftAllServiceAttachment;
|
||||
import com.chwl.core.im.custom.bean.GiftAttachment;
|
||||
import com.chwl.core.im.custom.bean.GiftBatchAttachment;
|
||||
import com.chwl.core.im.custom.bean.MultiGiftAttachment;
|
||||
@@ -50,9 +46,11 @@ import com.chwl.core.manager.AvRoomDataManager;
|
||||
import com.chwl.core.manager.IMNetEaseManager;
|
||||
import com.chwl.core.manager.RoomEvent;
|
||||
import com.chwl.core.pay.PayModel;
|
||||
import com.chwl.core.pay.event.UpdateWalletInfoEvent;
|
||||
import com.chwl.core.room.bean.RoomInfo;
|
||||
import com.chwl.core.room.giftvalue.bean.GiftValueCommonUpdate;
|
||||
import com.chwl.core.room.giftvalue.helper.GiftValueMrg;
|
||||
import com.chwl.core.utils.ComboUtil;
|
||||
import com.chwl.core.utils.CoreLogger;
|
||||
import com.chwl.core.utils.net.BalanceNotEnoughExeption;
|
||||
import com.chwl.core.utils.net.RadishNotEnoughException;
|
||||
@@ -62,6 +60,9 @@ import com.chwl.library.common.util.SPUtils;
|
||||
import com.chwl.library.net.rxnet.RxNet;
|
||||
import com.chwl.library.utils.ListUtils;
|
||||
import com.chwl.library.utils.SingleToastUtil;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
||||
import com.netease.nimlib.sdk.msg.model.IMMessage;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -314,6 +315,12 @@ public class GiftModel extends BaseModel implements IGiftModel {
|
||||
//礼物值
|
||||
GiftValueMrg.get().updateMicQueueCharm(
|
||||
GiftValueCommonUpdate.transformGift(luckyGiftAttachment.getMultiLuckyGiftReceiveInfo()));
|
||||
}else if (attachment.getSecond() == CUSTOM_MSG_SUB_TYPE_SEND_ALL_SERVICE_GIFT) {
|
||||
GiftAllServiceAttachment giftAllServiceAttachment = (GiftAllServiceAttachment) attachment;
|
||||
IMNetEaseManager.get().getChatRoomEventObservable().onNext(new RoomEvent()
|
||||
.setEvent(RoomEvent.RECEIVE_NORMALE_GIFT_ALL_SERVICE)
|
||||
.setGiftReceiveInfo(giftAllServiceAttachment.getGiftReceiveInfo()));
|
||||
// 全服送礼推送 没有附带礼物值
|
||||
}
|
||||
|
||||
} else if (attachment.getFirst() == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT) {//多人12
|
||||
|
@@ -26,4 +26,7 @@ public class GiftEffectInfo implements Serializable {
|
||||
|
||||
private int giftReceiveType;//送礼物的类型,单人,多人,全麦
|
||||
|
||||
//- 嵌套头像礼物所用字段
|
||||
private int showAvatarType;
|
||||
|
||||
}
|
||||
|
@@ -111,6 +111,15 @@ public class GiftInfo implements Serializable {
|
||||
|
||||
public long uid = -1; // combo
|
||||
|
||||
|
||||
//- 嵌套头像礼物所用字段
|
||||
int notifyFull; //是否全服
|
||||
/**
|
||||
* 0 普通礼物 , 1-送礼者 2-收礼者 3-左送右收
|
||||
*/
|
||||
int showAvatarType;
|
||||
|
||||
|
||||
public String getFirstGiftName() {
|
||||
return I18N.getFirstOrDefault(i18nGiftNameMap, giftName);
|
||||
}
|
||||
|
@@ -0,0 +1,8 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
public @interface ShowAvatarType {
|
||||
int def = 0;
|
||||
int send = 1;
|
||||
int recv = 2;
|
||||
int sendRecv = 3;
|
||||
}
|
@@ -1,17 +1,7 @@
|
||||
package com.chwl.core.gift.toolbox;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.chwl.core.gift.bean.GiftType;
|
||||
import com.google.gson.Gson;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.MessageBuilder;
|
||||
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
|
||||
import com.netease.nimlib.sdk.msg.model.CustomMessageConfig;
|
||||
import com.netease.nimlib.sdk.msg.model.IMMessage;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.bean.response.ServiceResult;
|
||||
import com.chwl.core.gift.GiftModel;
|
||||
@@ -19,6 +9,7 @@ import com.chwl.core.gift.bean.GiftInfo;
|
||||
import com.chwl.core.gift.bean.GiftMultiReceiverInfo;
|
||||
import com.chwl.core.gift.bean.GiftReceiveInfo;
|
||||
import com.chwl.core.gift.bean.GiftReceiver;
|
||||
import com.chwl.core.gift.bean.GiftType;
|
||||
import com.chwl.core.gift.bean.LuckyBagGifts;
|
||||
import com.chwl.core.gift.bean.MultiGiftReceiveInfo;
|
||||
import com.chwl.core.im.custom.bean.CustomAttachment;
|
||||
@@ -35,11 +26,23 @@ import com.chwl.core.room.bean.RoomInfo;
|
||||
import com.chwl.core.user.UserModel;
|
||||
import com.chwl.core.user.bean.UserInfo;
|
||||
import com.chwl.library.utils.ListUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.MessageBuilder;
|
||||
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
|
||||
import com.netease.nimlib.sdk.msg.model.CustomMessageConfig;
|
||||
import com.netease.nimlib.sdk.msg.model.IMMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.functions.BiFunction;
|
||||
import io.reactivex.functions.Consumer;
|
||||
|
||||
/**
|
||||
* @author jack
|
||||
@@ -189,6 +192,58 @@ public class GiftToolbox {
|
||||
return giftReceiveInfo;
|
||||
}
|
||||
|
||||
public static List<GiftReceiveInfo> transformToGiftReceiveInfoList(GiftMultiReceiverInfo giftMultiReceiverInfo) {
|
||||
List<GiftReceiveInfo> data = new ArrayList<>();
|
||||
for (int i = 0; i < giftMultiReceiverInfo.getTargetUsers().size(); i++) {
|
||||
GiftReceiver giftReceiver = giftMultiReceiverInfo.getTargetUsers().get(i);
|
||||
|
||||
GiftReceiveInfo giftReceiveInfo = new GiftReceiveInfo();
|
||||
giftReceiveInfo.setUid(giftMultiReceiverInfo.getUid());
|
||||
giftReceiveInfo.setNick(giftMultiReceiverInfo.getNick());
|
||||
giftReceiveInfo.setAvatar(giftMultiReceiverInfo.getAvatar());
|
||||
giftReceiveInfo.setGiftId(giftMultiReceiverInfo.getGiftId());
|
||||
giftReceiveInfo.setGiftNum(giftMultiReceiverInfo.getGiftNum());
|
||||
giftReceiveInfo.setGift(giftMultiReceiverInfo.getGift());
|
||||
giftReceiveInfo.setTargetUid(giftReceiver.getUid());
|
||||
giftReceiveInfo.setTargetNick(giftReceiver.getNick());
|
||||
giftReceiveInfo.setTargetAvatar(giftReceiver.getAvatar());
|
||||
//礼物值
|
||||
giftReceiveInfo.setLuckyBagGifts(giftMultiReceiverInfo.getLuckyBagGifts());
|
||||
giftReceiveInfo.setDisplayGift(giftMultiReceiverInfo.getDisplayGift());
|
||||
giftReceiveInfo.setGiftValueVos(giftMultiReceiverInfo.getGiftValueVos());
|
||||
giftReceiveInfo.setCurrentTime(giftMultiReceiverInfo.getCurrentTime());
|
||||
giftReceiveInfo.setComboCount(giftMultiReceiverInfo.getComboCount());
|
||||
data.add(giftReceiveInfo);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
public static List<GiftReceiveInfo> transformToGiftReceiveInfoList(MultiGiftReceiveInfo multiGiftReceiveInfo) {
|
||||
List<GiftReceiveInfo> data = new ArrayList<>();
|
||||
for (int i = 0; i < multiGiftReceiveInfo.getTargetUsers().size(); i++) {
|
||||
GiftReceiver giftReceiver = multiGiftReceiveInfo.getTargetUsers().get(i);
|
||||
|
||||
GiftReceiveInfo giftReceiveInfo = new GiftReceiveInfo();
|
||||
giftReceiveInfo.setUid(multiGiftReceiveInfo.getUid());
|
||||
giftReceiveInfo.setNick(multiGiftReceiveInfo.getNick());
|
||||
giftReceiveInfo.setAvatar(multiGiftReceiveInfo.getAvatar());
|
||||
giftReceiveInfo.setGiftId(multiGiftReceiveInfo.getGiftId());
|
||||
giftReceiveInfo.setGiftNum(multiGiftReceiveInfo.getGiftNum());
|
||||
giftReceiveInfo.setGift(multiGiftReceiveInfo.getGift());
|
||||
giftReceiveInfo.setTargetUid(giftReceiver.getUid());
|
||||
giftReceiveInfo.setTargetNick(giftReceiver.getNick());
|
||||
giftReceiveInfo.setTargetAvatar(giftReceiver.getAvatar());
|
||||
//礼物值
|
||||
giftReceiveInfo.setLuckyBagGifts(multiGiftReceiveInfo.getLuckyBagGifts());
|
||||
giftReceiveInfo.setDisplayGift(multiGiftReceiveInfo.getDisplayGift());
|
||||
giftReceiveInfo.setGiftValueVos(multiGiftReceiveInfo.getGiftValueVos());
|
||||
giftReceiveInfo.setCurrentTime(multiGiftReceiveInfo.getCurrentTime());
|
||||
giftReceiveInfo.setComboCount(multiGiftReceiveInfo.getComboCount());
|
||||
data.add(giftReceiveInfo);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -220,6 +275,33 @@ public class GiftToolbox {
|
||||
return singleResult;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送涂鸦礼物特效消息
|
||||
*/
|
||||
public static void sendDrawGiftRoomMessage(int giftId, List<List<Integer>> drawFixedArray) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
DrawGiftAttachment giftAttachment = new DrawGiftAttachment(
|
||||
CustomAttachment.CUSTOM_MSG_DRAW_GIFT_EFFECT,
|
||||
CustomAttachment.CUSTOM_MSG_SUB_TYPE_DRAW_GIFT_EFFECT
|
||||
);
|
||||
giftAttachment.setGiftId(giftId);
|
||||
giftAttachment.setDrawFixedArray(drawFixedArray);
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
// 聊天室id
|
||||
roomInfo.getRoomId() + "",
|
||||
giftAttachment
|
||||
);
|
||||
ImRetryManager.sendRoomGiftMsg(message)
|
||||
.doOnSuccess(retryChatRoomMessage -> {
|
||||
// 送礼物的人自己的涂鸦特效
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.DRAW_GIFT_EFFECT);
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 公屏发普通礼物消息
|
||||
*
|
||||
@@ -265,30 +347,6 @@ public class GiftToolbox {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送涂鸦礼物特效消息
|
||||
*/
|
||||
public static void sendDrawGiftRoomMessage(int giftId, List<List<Integer>> drawFixedArray) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo == null) return;
|
||||
DrawGiftAttachment giftAttachment = new DrawGiftAttachment(
|
||||
CustomAttachment.CUSTOM_MSG_DRAW_GIFT_EFFECT,
|
||||
CustomAttachment.CUSTOM_MSG_SUB_TYPE_DRAW_GIFT_EFFECT
|
||||
);
|
||||
giftAttachment.setGiftId(giftId);
|
||||
giftAttachment.setDrawFixedArray(drawFixedArray);
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
// 聊天室id
|
||||
roomInfo.getRoomId() + "",
|
||||
giftAttachment
|
||||
);
|
||||
ImRetryManager.sendRoomGiftMsg(message)
|
||||
.doOnSuccess(retryChatRoomMessage -> {
|
||||
// 送礼物的人自己的涂鸦特效
|
||||
IMNetEaseManager.get().noticeRoomEvent(message, RoomEvent.DRAW_GIFT_EFFECT);
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送个多人送普通礼物的消息到公屏
|
||||
@@ -298,10 +356,25 @@ public class GiftToolbox {
|
||||
public static void sendMultiGiftRoomMessage(GiftMultiReceiverInfo data) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null && data != null) {
|
||||
GiftBatchAttachment giftBatchAttachment = new GiftBatchAttachment(CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT,
|
||||
CustomAttachment.CUSTOM_MSG_SUB_TYPE_BATCH_SEND_GIFT);
|
||||
//这里去掉收礼物人的头像字段,减少容量
|
||||
GiftMultiReceiverInfo tmpData = new Gson().fromJson(new Gson().toJson(data), GiftMultiReceiverInfo.class);
|
||||
|
||||
int giftId = tmpData.getGiftId();
|
||||
GiftInfo giftInfo = GiftModel.get().findGiftInfoById(giftId);
|
||||
if (giftInfo == null || TextUtils.isEmpty(giftInfo.getGiftUrl())) {
|
||||
giftInfo = tmpData.getGift();
|
||||
}
|
||||
tmpData.setGift(giftInfo);
|
||||
|
||||
/**
|
||||
* 判断 gift 是不是 嵌套头像礼物, 是的话 特殊处理
|
||||
*/
|
||||
if (tmpData.getGift() != null && tmpData.getGift().getShowAvatarType() != 0) {
|
||||
List<GiftReceiveInfo> giftReceiveInfos = transformToGiftReceiveInfoList(tmpData);
|
||||
sendAvatarGiftRoomMessage(giftReceiveInfos);
|
||||
return;
|
||||
}
|
||||
|
||||
//这里去掉收礼物人的头像字段,减少容量
|
||||
List<Long> targetUids = new ArrayList<>();
|
||||
for (GiftReceiver targetUser : tmpData.getTargetUsers()) {
|
||||
targetUser.setAvatar(null);
|
||||
@@ -309,13 +382,10 @@ public class GiftToolbox {
|
||||
}
|
||||
//兼容旧版PK模式和iOS
|
||||
tmpData.setTargetUids(targetUids);
|
||||
|
||||
GiftBatchAttachment giftBatchAttachment = new GiftBatchAttachment(CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT, CustomAttachment.CUSTOM_MSG_SUB_TYPE_BATCH_SEND_GIFT);
|
||||
giftBatchAttachment.setGiftMultiReceiverInfo(tmpData);
|
||||
int giftId = tmpData.getGiftId();
|
||||
GiftInfo giftInfo = GiftModel.get().findGiftInfoById(giftId);
|
||||
if (giftInfo == null || TextUtils.isEmpty(giftInfo.getGiftUrl())) {
|
||||
giftInfo = tmpData.getGift();
|
||||
}
|
||||
tmpData.setGift(giftInfo);
|
||||
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
// 聊天室id
|
||||
roomInfo.getRoomId() + "",
|
||||
@@ -345,10 +415,11 @@ public class GiftToolbox {
|
||||
* @param giftReceiveInfo
|
||||
*/
|
||||
public static void sendAllMicGiftRoomMessage(MultiGiftReceiveInfo giftReceiveInfo) {
|
||||
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null && giftReceiveInfo != null) {
|
||||
MultiGiftAttachment giftAttachment = new MultiGiftAttachment(CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT, CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_MULTI_GIFT);
|
||||
giftAttachment.setMultiGiftAttachment(giftReceiveInfo);
|
||||
|
||||
|
||||
int giftId = giftReceiveInfo.getGiftId();
|
||||
GiftInfo giftInfo = GiftModel.get().findGiftInfoById(giftId);
|
||||
if (giftInfo == null || TextUtils.isEmpty(giftInfo.getGiftUrl())) {
|
||||
@@ -356,6 +427,18 @@ public class GiftToolbox {
|
||||
}
|
||||
giftReceiveInfo.setGift(giftInfo);
|
||||
|
||||
/**
|
||||
* 判断 gift 是不是 嵌套头像礼物, 是的话 特殊处理
|
||||
*/
|
||||
if (giftReceiveInfo.getGift() != null && giftReceiveInfo.getGift().getShowAvatarType() != 0) {
|
||||
List<GiftReceiveInfo> giftReceiveInfos = transformToGiftReceiveInfoList(giftReceiveInfo);
|
||||
sendAvatarGiftRoomMessage(giftReceiveInfos);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
MultiGiftAttachment giftAttachment = new MultiGiftAttachment(CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT, CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_MULTI_GIFT);
|
||||
giftAttachment.setMultiGiftAttachment(giftReceiveInfo);
|
||||
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(
|
||||
// 聊天室id
|
||||
roomInfo.getRoomId() + "",
|
||||
@@ -378,6 +461,30 @@ public class GiftToolbox {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送 嵌套头像礼物
|
||||
*/
|
||||
public static void sendAvatarGiftRoomMessage(List<GiftReceiveInfo> giftReceiveInfo) {
|
||||
Observable<GiftReceiveInfo> dataObservable = Observable.fromIterable(giftReceiveInfo);
|
||||
Observable<Long> timeObservable = Observable.interval(300,TimeUnit.MILLISECONDS);
|
||||
Observable.zip(dataObservable, timeObservable, new BiFunction<GiftReceiveInfo, Long, Object>() {
|
||||
@Override
|
||||
public Object apply(GiftReceiveInfo giftReceiveInfo, Long aLong) throws Exception {
|
||||
return giftReceiveInfo;
|
||||
}
|
||||
})
|
||||
.doOnNext(new Consumer<Object>() {
|
||||
@Override
|
||||
public void accept(Object data) throws Exception {
|
||||
if (data instanceof GiftReceiveInfo){
|
||||
sendGiftRoomMessage((GiftReceiveInfo) data);
|
||||
}
|
||||
}
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送单人送福袋礼物的消息到公屏
|
||||
*
|
||||
|
@@ -39,7 +39,6 @@ public class HomeRoomInfo implements MultiItemEntity, Serializable {
|
||||
private long mgId;
|
||||
private String mgName;
|
||||
private int state;
|
||||
private int hourTop;
|
||||
private String broadMsg;
|
||||
private String roomDesc;
|
||||
|
||||
@@ -61,6 +60,17 @@ public class HomeRoomInfo implements MultiItemEntity, Serializable {
|
||||
|
||||
private String regionFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 小时榜 1,2,3 0表示没上榜
|
||||
*/
|
||||
private int hourTop;
|
||||
/**
|
||||
* 1 = 热门 2=客服
|
||||
*/
|
||||
private int homeRoomType;
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return isBanner ? TYPE_BANNER : (!TextUtils.isEmpty(broadMsg) ? TYPE_BROADCAST : TYPE_ROOM);
|
||||
|
@@ -77,6 +77,8 @@ public class CustomAttachParser implements MsgAttachmentParser {
|
||||
attachment = new GiftAttachment(first, second);
|
||||
} else if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT) {
|
||||
attachment = new MultiLuckyGiftAttachment(first, second);
|
||||
}else if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_ALL_SERVICE_GIFT) {
|
||||
attachment = new GiftAllServiceAttachment(first, second);
|
||||
}
|
||||
break;
|
||||
case CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT:
|
||||
|
@@ -23,8 +23,9 @@ public class CustomAttachment implements MsgAttachment {
|
||||
|
||||
public static final int CUSTOM_MSG_HEADER_TYPE_GIFT = 3;
|
||||
public static final int CUSTOM_MSG_SUB_TYPE_SEND_GIFT = 31; //普通单人送礼公屏
|
||||
public static final int CUSTOM_MSG_ALL_SERVICE_GIFT = 32;
|
||||
public static final int CUSTOM_MSG_ALL_SERVICE_GIFT = 32; //全服礼物 - 广播
|
||||
public static final int CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT = 34;//单人福袋送礼公屏
|
||||
public static final int CUSTOM_MSG_SUB_TYPE_SEND_ALL_SERVICE_GIFT = 35;// 全服礼物 - 房间消息
|
||||
|
||||
public static final int CUSTOM_MSG_HEADER_TYPE_ACCOUNT = 5;
|
||||
|
||||
|
@@ -0,0 +1,70 @@
|
||||
package com.chwl.core.im.custom.bean;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chwl.core.gift.GiftModel;
|
||||
import com.chwl.core.gift.bean.GiftInfo;
|
||||
import com.chwl.core.gift.bean.GiftReceiveInfo;
|
||||
|
||||
/**
|
||||
* @author chenran
|
||||
* @date 2017/7/28
|
||||
*/
|
||||
|
||||
public class GiftAllServiceAttachment extends CustomAttachment {
|
||||
private GiftReceiveInfo giftReceiveInfo;
|
||||
private String uid;
|
||||
|
||||
public GiftAllServiceAttachment(int first, int second) {
|
||||
super(first, second);
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public GiftReceiveInfo getGiftReceiveInfo() {
|
||||
return giftReceiveInfo;
|
||||
}
|
||||
|
||||
public void setGiftReceiveInfo(GiftReceiveInfo giftReceiveInfo) {
|
||||
this.giftReceiveInfo = giftReceiveInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void parseData(JSONObject data) {
|
||||
giftReceiveInfo = new GiftReceiveInfo();
|
||||
giftReceiveInfo.setGiftId(data.getInteger("giftId"));
|
||||
giftReceiveInfo.setUid(data.getLong("sendUserUid"));
|
||||
giftReceiveInfo.setNick(data.getString("sendUserNick"));
|
||||
giftReceiveInfo.setAvatar(data.getString("sendUserAvatar"));
|
||||
giftReceiveInfo.setTargetUid(data.getLong("recvUserUid"));
|
||||
giftReceiveInfo.setTargetNick(data.getString("recvUserNick"));
|
||||
giftReceiveInfo.setTargetAvatar(data.getString("recvUserAvatar"));
|
||||
|
||||
GiftInfo giftInfo = GiftModel.get().findGiftInfoById(giftReceiveInfo.getGiftId());
|
||||
if (giftInfo != null) {
|
||||
giftInfo.setNotifyFull(data.getInteger("notifyFull"));
|
||||
giftInfo.setShowAvatarType(data.getInteger("showAvatarType"));
|
||||
}
|
||||
|
||||
giftReceiveInfo.setGift(giftInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JSONObject packData() {
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("giftId", giftReceiveInfo.getGiftId());
|
||||
object.put("sendUserUid", giftReceiveInfo.getUid());
|
||||
object.put("sendUserNick", giftReceiveInfo.getNick());
|
||||
object.put("sendUserAvatar", giftReceiveInfo.getAvatar());
|
||||
object.put("recvUserUid", giftReceiveInfo.getTargetUid());
|
||||
object.put("recvUserNick", giftReceiveInfo.getTargetNick());
|
||||
object.put("recvUserAvatar", giftReceiveInfo.getTargetAvatar());
|
||||
object.put("giftInfo", giftReceiveInfo.getGift());
|
||||
return object;
|
||||
}
|
||||
}
|
@@ -4,11 +4,11 @@ import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.chwl.core.gift.bean.GiftInfo;
|
||||
import com.chwl.core.gift.bean.GiftReceiveInfo;
|
||||
import com.chwl.core.room.giftvalue.bean.IndexGiftValue;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -6,12 +6,12 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.chwl.core.gift.bean.GiftInfo;
|
||||
import com.chwl.core.gift.bean.GiftMultiReceiverInfo;
|
||||
import com.chwl.core.gift.bean.GiftReceiver;
|
||||
import com.chwl.core.room.giftvalue.bean.IndexGiftValue;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -4,11 +4,11 @@ import android.text.TextUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.chwl.core.gift.bean.GiftInfo;
|
||||
import com.chwl.core.gift.bean.MultiGiftReceiveInfo;
|
||||
import com.chwl.core.room.giftvalue.bean.IndexGiftValue;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@@ -43,6 +43,7 @@ import com.chwl.core.im.custom.bean.CpMsgAttachment;
|
||||
import com.chwl.core.im.custom.bean.CustomAttachment;
|
||||
import com.chwl.core.im.custom.bean.DatingAttachment;
|
||||
import com.chwl.core.im.custom.bean.DatingPublishAttachment;
|
||||
import com.chwl.core.im.custom.bean.GiftAllServiceAttachment;
|
||||
import com.chwl.core.im.custom.bean.GiftAttachment;
|
||||
import com.chwl.core.im.custom.bean.GiftBatchAttachment;
|
||||
import com.chwl.core.im.custom.bean.InAppSharingFamilyAttachment;
|
||||
@@ -819,7 +820,7 @@ public final class IMNetEaseManager {
|
||||
face = true;
|
||||
break;
|
||||
case CUSTOM_MSG_HEADER_TYPE_GIFT:
|
||||
if (customAttachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_GIFT) {
|
||||
if (customAttachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_GIFT) {//todo do
|
||||
GiftAttachment giftAttachment = (GiftAttachment) attachment;
|
||||
GiftReceiveInfo giftReceiveInfo = giftAttachment.getGiftReceiveInfo();
|
||||
GiftInfo giftInfo = giftReceiveInfo.getGift();
|
||||
@@ -833,6 +834,20 @@ public final class IMNetEaseManager {
|
||||
if (!giftReceiveInfo.isRoomAlbum() && giftInfo.getGiftType() != GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||
addMessages(msg);
|
||||
}
|
||||
}if (customAttachment.getSecond() == CUSTOM_MSG_SUB_TYPE_SEND_ALL_SERVICE_GIFT) {//todo do
|
||||
GiftAllServiceAttachment giftAllServiceAttachment = (GiftAllServiceAttachment) attachment;
|
||||
GiftReceiveInfo giftReceiveInfo = giftAllServiceAttachment.getGiftReceiveInfo();
|
||||
GiftInfo giftInfo = giftReceiveInfo.getGift();
|
||||
// 兼容舊版發過來的giftAttachment沒有發送giftInfo的問題
|
||||
giftInfo = giftInfo == null ?
|
||||
GiftModel.get().findGiftInfoById(giftReceiveInfo.getGiftId()) : giftInfo;
|
||||
giftReceiveInfo.setGift(giftInfo);
|
||||
GiftModel.get().addNewGift(giftInfo);
|
||||
messages.add(msg);
|
||||
gift = true;
|
||||
// if (!giftReceiveInfo.isRoomAlbum() && giftInfo.getGiftType() != GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||
// addMessages(msg);
|
||||
// }
|
||||
} else if (customAttachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT) {
|
||||
messages.add(msg);
|
||||
gift = true;
|
||||
|
@@ -287,6 +287,11 @@ public class RoomEvent {
|
||||
//房間背景變更
|
||||
public static final int MSG_ROOM_BG_CHANGE = 117;
|
||||
|
||||
/**
|
||||
* 收到全服礼物
|
||||
*/
|
||||
public static final int RECEIVE_NORMALE_GIFT_ALL_SERVICE = 118;
|
||||
|
||||
private int event = NONE;
|
||||
private int micPosition = Integer.MIN_VALUE;
|
||||
private int posState = -1;
|
||||
|
@@ -0,0 +1,7 @@
|
||||
package com.chwl.core.user.bean;
|
||||
|
||||
public @interface EffectType {
|
||||
int MP4 = 1;
|
||||
int SVGA = 2;
|
||||
int IMG = 0;
|
||||
}
|
12
core/src/main/java/com/chwl/core/user/bean/UserBgVO.java
Normal file
12
core/src/main/java/com/chwl/core/user/bean/UserBgVO.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.chwl.core.user.bean;
|
||||
|
||||
/**
|
||||
* 个人主页 背景, 用户资料弹窗卡片背景
|
||||
*/
|
||||
public class UserBgVO {
|
||||
public String pic;
|
||||
public String effect;
|
||||
public int effectType;
|
||||
|
||||
|
||||
}
|
@@ -79,6 +79,17 @@ public class UserDetailInfo implements Serializable {
|
||||
private GuildInfo guildInfo;
|
||||
private List<NameplateInfo> userNameplateList;
|
||||
|
||||
private UserBgVO usingPersonalBackground;
|
||||
|
||||
|
||||
public UserBgVO getUsingPersonalBackground() {
|
||||
return usingPersonalBackground;
|
||||
}
|
||||
|
||||
public void setUsingPersonalBackground(UserBgVO usingPersonalBackground) {
|
||||
this.usingPersonalBackground = usingPersonalBackground;
|
||||
}
|
||||
|
||||
public List<NameplateInfo> getUserNameplateList() {
|
||||
return userNameplateList;
|
||||
}
|
||||
|
@@ -351,6 +351,10 @@ public class UserInfo implements Serializable {
|
||||
@Setter
|
||||
public long partitionId;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public UserBgVO infoCardVo;
|
||||
|
||||
public UserInfo() {
|
||||
|
||||
}
|
||||
|
@@ -586,29 +586,36 @@ public class DrawableTextView extends AppCompatTextView {
|
||||
* 颜色示例 : R.color.color_F4F3FB.getColor()
|
||||
*/
|
||||
public void setGradientDrawable(int startColor, int centerColor, int endColor,int angle, float radius) {
|
||||
this.startColor = startColor;
|
||||
if (centerColor > -1) this.centerColor = centerColor;
|
||||
this.endColor = endColor;
|
||||
if (radius > -1) this.radius = radius;
|
||||
if (angle > -1) this.angle = angle;
|
||||
if (startColor != -1) this.startColor = startColor;
|
||||
if (centerColor != -1) this.centerColor = centerColor;
|
||||
if (endColor != -1) this.endColor = endColor;
|
||||
if (radius != -1) this.radius = radius;
|
||||
if (angle != -1) this.angle = angle;
|
||||
|
||||
GradientDrawable gradient = null;
|
||||
if (startColor != -1 && endColor != -1) {
|
||||
if (this.startColor != -1 && this.endColor != -1) {
|
||||
GradientDrawable.Orientation orientation = getGradientOrientation();
|
||||
if (centerColor != -1) {
|
||||
gradient = new GradientDrawable(orientation, new int[]{startColor, centerColor, endColor});
|
||||
if (this.centerColor != -1) {
|
||||
gradient = new GradientDrawable(orientation, new int[]{this.startColor, this.centerColor, this.endColor});
|
||||
} else {
|
||||
gradient = new GradientDrawable(orientation, new int[]{startColor, endColor});
|
||||
gradient = new GradientDrawable(orientation, new int[]{this.startColor, this.endColor});
|
||||
}
|
||||
}
|
||||
if (gradient != null && radius > 0) {
|
||||
gradient.setCornerRadius(radius);
|
||||
if (gradient != null && this.radius != -1) {
|
||||
gradient.setCornerRadius(this.radius);
|
||||
}
|
||||
if (gradient != null) {
|
||||
setBackground(gradient);
|
||||
}
|
||||
}
|
||||
|
||||
public void changeGradientColor(int startColor, int centerColor, int endColor) {
|
||||
if (startColor != -1) this.startColor = startColor;
|
||||
if (centerColor != -1) this.centerColor = centerColor;
|
||||
if (endColor != -1) this.endColor = endColor;
|
||||
initDrawable(getContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* 改变shape的背景颜色 需传入ARGB八位 例如#FFFFFFFF
|
||||
*
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.chwl.library.common.util
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewGroup.MarginLayoutParams
|
||||
@@ -81,6 +82,10 @@ fun String?.isVerify() : Boolean {
|
||||
return this?.isBlank() == false
|
||||
}
|
||||
|
||||
fun String.toColor() : Int {
|
||||
return Color.parseColor(this)
|
||||
}
|
||||
|
||||
fun String?.isSvgaUrl() : Boolean {
|
||||
if (this.isVerify()) {
|
||||
return this?.endsWith(".svga") == true || this?.endsWith(".SVGA") == true
|
||||
@@ -111,4 +116,35 @@ fun List<Any>?.isVerify() : Boolean{
|
||||
return this?.isEmpty() == false
|
||||
}
|
||||
|
||||
fun Int.isVerify(list : List<Any>?) : Boolean{
|
||||
if (list.isVerify()) {
|
||||
if (list!!.getOrNull(this) != null) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun Double?.toNumString(byte:Int = 2) : String {
|
||||
if (this == null) {
|
||||
return "0"
|
||||
} else {
|
||||
val intNum = this.toInt()
|
||||
val floatNum = this - intNum
|
||||
if (floatNum == 0.0) {
|
||||
return intNum.toString()
|
||||
} else {
|
||||
val format = String.format("%.${byte}f", this)
|
||||
if (format.endsWith(".00")){
|
||||
return intNum.toString()
|
||||
}else if (format.contains(".") && format.endsWith("0")){
|
||||
return format.removeSuffix("0")
|
||||
}else {
|
||||
return format
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -49,6 +49,10 @@ object LogUtil {
|
||||
fun d(tag: String, message: String, filePrinter: Boolean = false) {
|
||||
log(Log.DEBUG, tag, message, filePrinter)
|
||||
}
|
||||
@JvmStatic
|
||||
fun d(message: String, filePrinter: Boolean = false) {
|
||||
log(Log.DEBUG, "LogUtil", message, filePrinter)
|
||||
}
|
||||
|
||||
fun i(tag: String, message: String, filePrinter: Boolean = false) {
|
||||
log(Log.INFO, tag, message, filePrinter)
|
||||
|
228
mode.json
228
mode.json
@@ -1,181 +1,53 @@
|
||||
{
|
||||
"success": true,
|
||||
"code": 200,
|
||||
"message": "success",
|
||||
"data": [
|
||||
{
|
||||
"dressId": 195,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.pekolive.com/Vip5headdress.png",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.pekolive.com/Vip5headdress.svga",
|
||||
"name": "VIP5頭飾",
|
||||
"used": true,
|
||||
"expireDays": 22,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1733976000000
|
||||
},
|
||||
{
|
||||
"dressId": 196,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.pekolive.com/Vip6headdress.png",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.pekolive.com/Vip6headdress.svga",
|
||||
"name": "VIP6頭飾",
|
||||
"used": false,
|
||||
"expireDays": 25,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1734235200000
|
||||
},
|
||||
{
|
||||
"dressId": 193,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.pekolive.com/Vip3headdress.png",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.pekolive.com/Vip3headdress.svga",
|
||||
"name": "VIP3頭飾",
|
||||
"used": false,
|
||||
"expireDays": 23,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1734062400000
|
||||
},
|
||||
{
|
||||
"dressId": 26,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.hfighting.com/1df2071a-610d-41be-b763-8437ef9f3524",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.hfighting.com/6d9ff134-80c1-44d5-97b0-981817e03bd4",
|
||||
"name": "幸運星人",
|
||||
"used": false,
|
||||
"expireDays": 22,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1733919509000
|
||||
},
|
||||
{
|
||||
"dressId": 31,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.hfighting.com/2ec2f8cd-e660-4af2-bd49-b9eed8de10a2",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.hfighting.com/34369437-e9a3-4bb8-80a2-f310bf8e90fc",
|
||||
"name": "財氣沖天",
|
||||
"used": false,
|
||||
"expireDays": 13,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1733173500000
|
||||
},
|
||||
{
|
||||
"dressId": 27,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.hfighting.com/06fe0618-cd55-4e5e-84bf-1071f821d608",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.hfighting.com/22f0fbb1-fdb1-46f9-b037-03f0693effeb",
|
||||
"name": "潮舞星迎",
|
||||
"used": false,
|
||||
"expireDays": 13,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1733131248000
|
||||
},
|
||||
{
|
||||
"dressId": 123,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "http://beta.img.pekolive.com/FklHnzcmijfk_0QGRePXuzG3LSdN?imageslim",
|
||||
"effectType": 2,
|
||||
"effect": "http://beta.img.pekolive.com/FmDgjyKd_p0SvpKmC5v0rwhszdH9?imageslim",
|
||||
"name": "花语小兔",
|
||||
"used": false,
|
||||
"expireDays": 9,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1732780728000
|
||||
},
|
||||
{
|
||||
"dressId": 110,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "http://beta.img.pekolive.com/FrTtFcnSI88bITGonp5PJjdbGLLR?imageslim",
|
||||
"effectType": 2,
|
||||
"effect": "http://beta.img.pekolive.com/FrTtFcnSI88bITGonp5PJjdbGLLR?imageslim",
|
||||
"name": "豪氣季軍",
|
||||
"used": false,
|
||||
"expireDays": 8,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1732760886000
|
||||
},
|
||||
{
|
||||
"dressId": 30,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.hfighting.com/0fcea959-e82a-410e-a3f5-52f751a6c327",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.hfighting.com/efacf269-c628-4940-984f-b817aabf2127",
|
||||
"name": "拉丁之神",
|
||||
"used": false,
|
||||
"expireDays": 6,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1732526621000
|
||||
},
|
||||
{
|
||||
"dressId": 28,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.hfighting.com/4dd02f23-e30f-4df7-9326-53a1f4ae8ebf",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.hfighting.com/c17f08d6-1854-4d03-a760-e02ad5fdf081",
|
||||
"name": "月魔法帽",
|
||||
"used": false,
|
||||
"expireDays": 6,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1732526452000
|
||||
},
|
||||
{
|
||||
"dressId": 42,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "http://beta.img.pekolive.com/Fq_EzPCxN99nV84CgO3c3z242pEh?imageslim",
|
||||
"effectType": 2,
|
||||
"effect": "http://beta.img.pekolive.com/Fq_EzPCxN99nV84CgO3c3z242pEh?imageslim",
|
||||
"name": "海浪",
|
||||
"used": false,
|
||||
"expireDays": 2,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1732175930000
|
||||
},
|
||||
{
|
||||
"dressId": 29,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.hfighting.com/a51c4b19-6862-41fa-83cb-2475db2320da",
|
||||
"effectType": 2,
|
||||
"effect": "https://image.hfighting.com/5df51843-1c4c-40c1-b1dd-5420ce093de2",
|
||||
"name": "神囚魔法",
|
||||
"used": false,
|
||||
"expireDays": 1,
|
||||
"hasExpired": false,
|
||||
"expireTime": 1732097432000
|
||||
},
|
||||
{
|
||||
"dressId": 102,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "http://beta.img.pekolive.com/FrQQrQ0yEhTCLxyKHygT76kZLHoy?imageslim",
|
||||
"effectType": 2,
|
||||
"effect": "http://beta.img.pekolive.com/FqJrMr8YmRr6WBR0FOMaYL05HPxy?imageslim",
|
||||
"name": "星河白羽",
|
||||
"used": false,
|
||||
"expireDays": 0,
|
||||
"hasExpired": true,
|
||||
"expireTime": 1731664948000
|
||||
},
|
||||
{
|
||||
"dressId": 44,
|
||||
"dressType": 0,
|
||||
"obtainWay": 1,
|
||||
"pic": "https://image.hfighting.com/bb55be24-3418-4f03-bf46-1bb491b95ba2",
|
||||
"effectType": 2,
|
||||
"effect": "https:/
|
||||
"data": {
|
||||
"totalPage": 1,
|
||||
"nameplateList": [
|
||||
{
|
||||
"id": 406,
|
||||
"uid": 3224,
|
||||
"nameplateId": 101,
|
||||
"isCustomWord": true,
|
||||
"word": " 555",
|
||||
"remark": " 555",
|
||||
"expireTime": 1738663248000,
|
||||
"createTime": 1731319248000,
|
||||
"updateTime": 1731319248000,
|
||||
"nameplateName": " 555",
|
||||
"nameplateImage": "https://image.pekolive.com/11094f2f00fb491f963132463bab97ec.png",
|
||||
"isExpired": false,
|
||||
"expireDays": 74,
|
||||
"isUsing": true,
|
||||
"iconPic": "https://image.pekolive.com/gonghuizhangmingpaikaobei.png",
|
||||
"fixedWord": " 555",
|
||||
"nameplateType": "1",
|
||||
"dressShopId": 33,
|
||||
"dressPrice": 1000,
|
||||
"discountPrice": 950.00,
|
||||
"vipLevel": 6,
|
||||
"discount": 95,
|
||||
"dressDay": 9
|
||||
},
|
||||
{
|
||||
"id": 407,
|
||||
"uid": 3224,
|
||||
"nameplateId": 100,
|
||||
"isCustomWord": false,
|
||||
"word": " ",
|
||||
"remark": " ",
|
||||
"expireTime": 1733220061000,
|
||||
"createTime": 1731319261000,
|
||||
"updateTime": 1731319261000,
|
||||
"nameplateName": "女神",
|
||||
"nameplateImage": "https://image.pekolive.com/guanfangzhuli-bajisitan.png",
|
||||
"isExpired": false,
|
||||
"expireDays": 11,
|
||||
"isUsing": false,
|
||||
"iconPic": "https://image.pekolive.com/guanfangzhuli-bajisitan.png",
|
||||
"nameplateType": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timestamp": 1732272347736
|
||||
}
|
||||
|
Reference in New Issue
Block a user