同步PIKO:移植超级幸运礼物
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.databinding.ObservableField;
|
|||||||
import com.chwl.app.R;
|
import com.chwl.app.R;
|
||||||
import com.chwl.app.vip.util.VipHelper;
|
import com.chwl.app.vip.util.VipHelper;
|
||||||
import com.chwl.core.gift.bean.GiftInfo;
|
import com.chwl.core.gift.bean.GiftInfo;
|
||||||
|
import com.chwl.core.gift.bean.GiftType;
|
||||||
import com.chwl.core.gift.bean.SimpleVipInfo;
|
import com.chwl.core.gift.bean.SimpleVipInfo;
|
||||||
import com.chwl.library.bindinglist.BaseItem;
|
import com.chwl.library.bindinglist.BaseItem;
|
||||||
import com.chwl.library.utils.TimeUtils;
|
import com.chwl.library.utils.TimeUtils;
|
||||||
@@ -65,6 +66,11 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
|||||||
*/
|
*/
|
||||||
public boolean isFreeGift;
|
public boolean isFreeGift;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否超级幸运礼物
|
||||||
|
*/
|
||||||
|
public boolean isSuperLuckyGift;
|
||||||
|
|
||||||
public GiftInfoVm(Context context, GiftInfo data, boolean select, boolean isKnap) {
|
public GiftInfoVm(Context context, GiftInfo data, boolean select, boolean isKnap) {
|
||||||
super(context, data);
|
super(context, data);
|
||||||
this.isSelect.set(select);
|
this.isSelect.set(select);
|
||||||
@@ -100,6 +106,7 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
|||||||
if (data.getConsumeType() == GiftInfo.CONSUME_TYPE_FREE_GIFT) {
|
if (data.getConsumeType() == GiftInfo.CONSUME_TYPE_FREE_GIFT) {
|
||||||
isFreeGift = true;
|
isFreeGift = true;
|
||||||
}
|
}
|
||||||
|
isSuperLuckyGift = (data.getGiftType() == GiftType.GIFT_TYPE_SUPER_LUCKY);
|
||||||
SimpleVipInfo vipInfo = data.getGiftVipInfo();
|
SimpleVipInfo vipInfo = data.getGiftVipInfo();
|
||||||
isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
|
isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
|
||||||
vipIcon = vipInfo == null ? "" : vipInfo.getVipIcon();
|
vipIcon = vipInfo == null ? "" : vipInfo.getVipIcon();
|
||||||
|
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -31,9 +32,16 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.viewpager2.widget.ViewPager2;
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
|
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.ui.utils.ImageLoadUtilsV2;
|
||||||
|
import com.chwl.app.ui.webview.DialogWebViewActivity;
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||||
|
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||||
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
|
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
|
||||||
import com.chwl.app.BR;
|
import com.chwl.app.BR;
|
||||||
import com.chwl.app.R;
|
import com.chwl.app.R;
|
||||||
@@ -99,6 +107,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import io.reactivex.Single;
|
import io.reactivex.Single;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.disposables.CompositeDisposable;
|
import io.reactivex.disposables.CompositeDisposable;
|
||||||
@@ -175,6 +184,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
private boolean isShowDrawGiftModel;
|
private boolean isShowDrawGiftModel;
|
||||||
@Nullable
|
@Nullable
|
||||||
private DrawGiftHelper drawGiftHelper;
|
private DrawGiftHelper drawGiftHelper;
|
||||||
|
private ImageView ivSuperLuckyGiftTips;
|
||||||
|
|
||||||
public GiftDialog(Context context, int giftId) {
|
public GiftDialog(Context context, int giftId) {
|
||||||
this(context, 0, true, false, true, giftId);
|
this(context, 0, true, false, true, giftId);
|
||||||
@@ -325,13 +335,13 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
disableSlideClose();
|
disableSlideClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void disableSlideClose(){
|
private void disableSlideClose() {
|
||||||
BottomSheetBehavior bottomSheetBehavior = getBottomSheetBehavior();
|
BottomSheetBehavior bottomSheetBehavior = getBottomSheetBehavior();
|
||||||
if (bottomSheetBehavior != null) {
|
if (bottomSheetBehavior != null) {
|
||||||
bottomSheetBehavior.addBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
bottomSheetBehavior.addBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||||
if(newState == BottomSheetBehavior.STATE_DRAGGING){
|
if (newState == BottomSheetBehavior.STATE_DRAGGING) {
|
||||||
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -392,6 +402,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
ivDrawGiftRemoveLast = root.findViewById(R.id.iv_draw_gift_remove_last);
|
ivDrawGiftRemoveLast = root.findViewById(R.id.iv_draw_gift_remove_last);
|
||||||
ivDrawGiftRemoveAll = root.findViewById(R.id.iv_draw_gift_remove_all);
|
ivDrawGiftRemoveAll = root.findViewById(R.id.iv_draw_gift_remove_all);
|
||||||
ivDrawGiftClose = root.findViewById(R.id.iv_draw_gift_close);
|
ivDrawGiftClose = root.findViewById(R.id.iv_draw_gift_close);
|
||||||
|
ivSuperLuckyGiftTips = findViewById(R.id.iv_super_lucky_gift_tips);
|
||||||
ivDrawGiftClose.setOnClickListener(this);
|
ivDrawGiftClose.setOnClickListener(this);
|
||||||
ivDrawGiftRemoveLast.setOnClickListener(this);
|
ivDrawGiftRemoveLast.setOnClickListener(this);
|
||||||
ivDrawGiftRemoveAll.setOnClickListener(this);
|
ivDrawGiftRemoveAll.setOnClickListener(this);
|
||||||
@@ -572,7 +583,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
itemType = ITEM_TYPE_GOLD;
|
itemType = ITEM_TYPE_GOLD;
|
||||||
|
|
||||||
tvRecharge.setVisibility(View.VISIBLE);
|
tvRecharge.setVisibility(View.VISIBLE);
|
||||||
tvRecharge.setText(context.getText(R .string.charge));
|
tvRecharge.setText(context.getText(R.string.charge));
|
||||||
if (goldWalletInfo == null) {
|
if (goldWalletInfo == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -648,6 +659,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
showEmptyView();
|
showEmptyView();
|
||||||
isShowDrawGiftModel = false;
|
isShowDrawGiftModel = false;
|
||||||
updateDrawGift();
|
updateDrawGift();
|
||||||
|
updateSuperLuckyGiftTips();
|
||||||
} else {
|
} else {
|
||||||
showLoadFailedView();
|
showLoadFailedView();
|
||||||
}
|
}
|
||||||
@@ -668,6 +680,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
isShowDrawGiftModel = false;
|
isShowDrawGiftModel = false;
|
||||||
|
updateSuperLuckyGiftTips();
|
||||||
updateDrawGift();
|
updateDrawGift();
|
||||||
giftIndicator.post(() -> {
|
giftIndicator.post(() -> {
|
||||||
if (position < GiftIndicator.TYPE_WEEK) {
|
if (position < GiftIndicator.TYPE_WEEK) {
|
||||||
@@ -678,6 +691,20 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateSuperLuckyGiftTips() {
|
||||||
|
if (currentGiftInfo == null || TextUtils.isEmpty(currentGiftInfo.getBannerUrl()) || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||||
|
ivSuperLuckyGiftTips.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
ivSuperLuckyGiftTips.setVisibility(View.VISIBLE);
|
||||||
|
ImageLoadUtils.loadImage(ivSuperLuckyGiftTips.getContext(), currentGiftInfo.getBannerUrl(), ivSuperLuckyGiftTips);
|
||||||
|
ivSuperLuckyGiftTips.setOnClickListener(v -> {
|
||||||
|
if (!TextUtils.isEmpty(currentGiftInfo.getSkipUrl())) {
|
||||||
|
DialogWebViewActivity.start(context, currentGiftInfo.getSkipUrl(), true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void updateDrawGift() {
|
private void updateDrawGift() {
|
||||||
if (drawGiftHelper == null) {
|
if (drawGiftHelper == null) {
|
||||||
drawGiftHelper = new DrawGiftHelper((Activity) context);
|
drawGiftHelper = new DrawGiftHelper((Activity) context);
|
||||||
@@ -857,7 +884,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
ViewGroup.LayoutParams.MATCH_PARENT));
|
ViewGroup.LayoutParams.MATCH_PARENT));
|
||||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 4));
|
recyclerView.setLayoutManager(new GridLayoutManager(context, 4));
|
||||||
return new RecyclerView.ViewHolder(recyclerView){};
|
return new RecyclerView.ViewHolder(recyclerView) {
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -883,6 +911,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
currentGiftInfo = item.data;
|
currentGiftInfo = item.data;
|
||||||
setGoldOrRadishText(lastSelectedItem);
|
setGoldOrRadishText(lastSelectedItem);
|
||||||
isShowDrawGiftModel = true;
|
isShowDrawGiftModel = true;
|
||||||
|
updateSuperLuckyGiftTips();
|
||||||
updateDrawGift();
|
updateDrawGift();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1017,7 +1046,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
|||||||
ReportManager.get().reportEvent(IReportConstants.PAYPAGE_SHOW, map);
|
ReportManager.get().reportEvent(IReportConstants.PAYPAGE_SHOW, map);
|
||||||
}
|
}
|
||||||
// if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
|
// if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
|
||||||
ChargeActivity.start(context);
|
ChargeActivity.start(context);
|
||||||
// } else {
|
// } else {
|
||||||
// CommonWebViewActivity.start(
|
// CommonWebViewActivity.start(
|
||||||
// context, UriProvider.getOfficialPay(
|
// context, UriProvider.getOfficialPay(
|
||||||
|
BIN
app/src/main/res/drawable-ar-xxhdpi/gift_ic_super_luck_logo.png
Normal file
BIN
app/src/main/res/drawable-ar-xxhdpi/gift_ic_super_luck_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
BIN
app/src/main/res/drawable-en-xxhdpi/gift_ic_super_luck_logo.png
Normal file
BIN
app/src/main/res/drawable-en-xxhdpi/gift_ic_super_luck_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/gift_ic_super_luck_logo.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/gift_ic_super_luck_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
@@ -6,6 +6,18 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom">
|
android:layout_gravity="bottom">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_super_lucky_gift_tips"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:layout_height="50dp"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_dialog_bottom_gift"
|
android:id="@+id/ll_dialog_bottom_gift"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -146,10 +158,9 @@
|
|||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/iv_open_noble"
|
android:id="@+id/iv_open_noble"
|
||||||
android:layout_width="84dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="26dp"
|
android:layout_height="20dp"
|
||||||
android:layout_gravity="center_vertical|end"
|
android:layout_gravity="center_vertical|end"
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:src="@drawable/ic_vip_gift_dialog"
|
android:src="@drawable/ic_vip_gift_dialog"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:visibility="gone" />
|
tools:visibility="gone" />
|
||||||
|
@@ -37,6 +37,15 @@
|
|||||||
android:layout_marginTop="@dimen/dp_16"
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
android:alpha="@{item.isLocked?0.5f:1f}" />
|
android:alpha="@{item.isLocked?0.5f:1f}" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_super_lucky_gift"
|
||||||
|
android:layout_width="@dimen/dp_46"
|
||||||
|
android:layout_height="@dimen/dp_12"
|
||||||
|
android:layout_alignBottom="@id/gift_image"
|
||||||
|
android:layout_marginStart="@dimen/dp_5"
|
||||||
|
android:src="@drawable/gift_ic_super_luck_logo"
|
||||||
|
android:visibility="@{item.isSuperLuckyGift ? View.VISIBLE : View.GONE}" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/gift_name"
|
android:id="@+id/gift_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@@ -96,6 +96,10 @@ public class GiftInfo implements Serializable {
|
|||||||
|
|
||||||
private boolean drawGift;
|
private boolean drawGift;
|
||||||
|
|
||||||
|
private String bannerUrl;
|
||||||
|
|
||||||
|
private String skipUrl;
|
||||||
|
|
||||||
//免费礼物倒计时进度
|
//免费礼物倒计时进度
|
||||||
private long mFreeGiftProgress = 0;
|
private long mFreeGiftProgress = 0;
|
||||||
|
|
||||||
|
@@ -41,4 +41,8 @@ public class GiftType {
|
|||||||
|
|
||||||
public static final int GIFT_TYPE_SINGLE_ROOM = 11;
|
public static final int GIFT_TYPE_SINGLE_ROOM = 11;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 超级幸运礼物
|
||||||
|
*/
|
||||||
|
public static final int GIFT_TYPE_SUPER_LUCKY = 16;
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@ package com.chwl.core.gift.toolbox;
|
|||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.chwl.core.gift.bean.GiftType;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||||
@@ -206,12 +207,15 @@ public class GiftToolbox {
|
|||||||
|
|
||||||
LogUtil.print("single send gift");
|
LogUtil.print("single send gift");
|
||||||
|
|
||||||
|
int giftType = giftInfo.getGiftType();
|
||||||
ImRetryManager.sendRoomGiftMsg(message)
|
ImRetryManager.sendRoomGiftMsg(message)
|
||||||
.doOnSuccess(retryChatRoomMessage -> {
|
.doOnSuccess(retryChatRoomMessage -> {
|
||||||
// 发送礼物成功的回调,显示动画
|
// 发送礼物成功的回调,显示动画
|
||||||
GiftModel.get().onSendRoomMessageSuccess(message);
|
GiftModel.get().onSendRoomMessageSuccess(message);
|
||||||
// 插入到公屏上
|
if (giftType != GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||||
IMNetEaseManager.get().addMessagesImmediately(message);
|
// 插入到公屏上
|
||||||
|
IMNetEaseManager.get().addMessagesImmediately(message);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.subscribe();
|
.subscribe();
|
||||||
|
|
||||||
@@ -276,12 +280,15 @@ public class GiftToolbox {
|
|||||||
|
|
||||||
LogUtil.print("multi send gift");
|
LogUtil.print("multi send gift");
|
||||||
|
|
||||||
|
int giftType = giftInfo.getGiftType();
|
||||||
ImRetryManager.sendRoomGiftMsg(message)
|
ImRetryManager.sendRoomGiftMsg(message)
|
||||||
.doOnSuccess(retryChatRoomMessage -> {
|
.doOnSuccess(retryChatRoomMessage -> {
|
||||||
// 发送礼物成功的回调,显示动画
|
// 发送礼物成功的回调,显示动画
|
||||||
GiftModel.get().onSendRoomMessageSuccess(message);
|
GiftModel.get().onSendRoomMessageSuccess(message);
|
||||||
// 插入到公屏上
|
if (giftType != GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||||
IMNetEaseManager.get().addMessagesImmediately(message);
|
// 插入到公屏上
|
||||||
|
IMNetEaseManager.get().addMessagesImmediately(message);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.subscribe();
|
.subscribe();
|
||||||
|
|
||||||
@@ -313,12 +320,15 @@ public class GiftToolbox {
|
|||||||
|
|
||||||
LogUtil.print("all mic send gift");
|
LogUtil.print("all mic send gift");
|
||||||
|
|
||||||
|
int giftType = giftInfo.getGiftType();
|
||||||
ImRetryManager.sendRoomGiftMsg(message)
|
ImRetryManager.sendRoomGiftMsg(message)
|
||||||
.doOnSuccess(retryChatRoomMessage -> {
|
.doOnSuccess(retryChatRoomMessage -> {
|
||||||
// 发送礼物成功的回调,显示动画
|
// 发送礼物成功的回调,显示动画
|
||||||
GiftModel.get().onSendRoomMessageSuccess(message);
|
GiftModel.get().onSendRoomMessageSuccess(message);
|
||||||
// 插入到公屏上
|
if (giftType != GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||||
IMNetEaseManager.get().addMessagesImmediately(message);
|
// 插入到公屏上
|
||||||
|
IMNetEaseManager.get().addMessagesImmediately(message);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.subscribe();
|
.subscribe();
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.chwl.core.gift.bean.GiftType;
|
||||||
import com.chwl.core.monsterhunting.bean.MonsterDataBean;
|
import com.chwl.core.monsterhunting.bean.MonsterDataBean;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@@ -721,7 +722,9 @@ public final class IMNetEaseManager {
|
|||||||
|| customAttachment.getFirst() == CustomAttachment.CUSTOM_MESS_TAROT
|
|| customAttachment.getFirst() == CustomAttachment.CUSTOM_MESS_TAROT
|
||||||
|| customAttachment.getFirst() == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MONSTER_HUNTING
|
|| customAttachment.getFirst() == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MONSTER_HUNTING
|
||||||
|| customAttachment.getFirst() == CustomAttachment.CUSTOM_MSG_MINI_WORLD) {
|
|| customAttachment.getFirst() == CustomAttachment.CUSTOM_MSG_MINI_WORLD) {
|
||||||
addMessages(msg);
|
if (!isIgnoreMessageOfSuperLuckGift(customAttachment)) {
|
||||||
|
addMessages(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Logger.i(ResUtil.getString(R.string.xchat_android_core_manager_imneteasemanager_015) + customAttachment);
|
Logger.i(ResUtil.getString(R.string.xchat_android_core_manager_imneteasemanager_015) + customAttachment);
|
||||||
int second = customAttachment.getSecond();
|
int second = customAttachment.getSecond();
|
||||||
@@ -820,7 +823,7 @@ public final class IMNetEaseManager {
|
|||||||
GiftModel.get().addNewGift(giftInfo);
|
GiftModel.get().addNewGift(giftInfo);
|
||||||
messages.add(msg);
|
messages.add(msg);
|
||||||
gift = true;
|
gift = true;
|
||||||
if (!giftReceiveInfo.isRoomAlbum()) {
|
if (!giftReceiveInfo.isRoomAlbum() && giftInfo.getGiftType() != GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||||
addMessages(msg);
|
addMessages(msg);
|
||||||
}
|
}
|
||||||
} else if (customAttachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT) {
|
} else if (customAttachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT) {
|
||||||
@@ -1478,6 +1481,36 @@ public final class IMNetEaseManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否不需要添加到公屏(超级幸运礼物特殊,会单独添加到公屏)
|
||||||
|
*/
|
||||||
|
private boolean isIgnoreMessageOfSuperLuckGift(CustomAttachment attachment) {
|
||||||
|
if (attachment.getFirst() == CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT) {
|
||||||
|
if (attachment.getSecond() == CUSTOM_MSG_SUB_TYPE_SEND_MULTI_GIFT || attachment.getSecond() == CUSTOM_MSG_SUB_TYPE_BATCH_SEND_GIFT) {
|
||||||
|
if (attachment instanceof MultiGiftAttachment) {
|
||||||
|
MultiGiftAttachment multiGiftAttachment = (MultiGiftAttachment) attachment;
|
||||||
|
GiftInfo giftInfo = multiGiftAttachment.getMultiGiftReceiveInfo().getGift();
|
||||||
|
if (giftInfo != null && giftInfo.getGiftType() == GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (attachment.getFirst() == CUSTOM_MSG_HEADER_TYPE_GIFT) {
|
||||||
|
if (attachment.getSecond() == CUSTOM_MSG_SUB_TYPE_SEND_GIFT) {
|
||||||
|
if (attachment instanceof GiftAttachment) {
|
||||||
|
GiftAttachment giftAttachment = (GiftAttachment) attachment;
|
||||||
|
GiftReceiveInfo giftReceiveInfo = giftAttachment.getGiftReceiveInfo();
|
||||||
|
GiftInfo giftInfo = giftReceiveInfo.getGift();
|
||||||
|
if (giftInfo != null && giftInfo.getGiftType() == GiftType.GIFT_TYPE_SUPER_LUCKY) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void pkCloseUpdateSelfMicInfo() {
|
private void pkCloseUpdateSelfMicInfo() {
|
||||||
if (AvRoomDataManager.get().isOnMic(AuthModel.get().getCurrentUid())) {
|
if (AvRoomDataManager.get().isOnMic(AuthModel.get().getCurrentUid())) {
|
||||||
UserModel.get().getCacheLoginUserInfo().setGroupType(PKTeamInfo.TEAM_NONE);
|
UserModel.get().getCacheLoginUserInfo().setGroupType(PKTeamInfo.TEAM_NONE);
|
||||||
|
Reference in New Issue
Block a user