Merge branch 'feature/gift' into develop

This commit is contained in:
Max
2024-01-30 17:06:22 +08:00
89 changed files with 1680 additions and 462 deletions

View File

@@ -1,5 +1,6 @@
package com.nnbc123.app.avroom.widget; package com.nnbc123.app.avroom.widget;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_KITCHEN; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_KITCHEN;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_PRIVILEGE; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_PRIVILEGE;
@@ -93,6 +94,7 @@ import com.nnbc123.core.im.custom.bean.CarveUpGoldAttachment;
import com.nnbc123.core.im.custom.bean.CleanScreenAttachment; import com.nnbc123.core.im.custom.bean.CleanScreenAttachment;
import com.nnbc123.core.im.custom.bean.CustomAttachment; import com.nnbc123.core.im.custom.bean.CustomAttachment;
import com.nnbc123.core.im.custom.bean.DatingAttachment; import com.nnbc123.core.im.custom.bean.DatingAttachment;
import com.nnbc123.core.im.custom.bean.DressUpGiftAttachment;
import com.nnbc123.core.im.custom.bean.FaceAttachment; import com.nnbc123.core.im.custom.bean.FaceAttachment;
import com.nnbc123.core.im.custom.bean.FansTeamMsgAttachment; import com.nnbc123.core.im.custom.bean.FansTeamMsgAttachment;
import com.nnbc123.core.im.custom.bean.GiftAttachment; import com.nnbc123.core.im.custom.bean.GiftAttachment;
@@ -121,6 +123,7 @@ import com.nnbc123.core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
import com.nnbc123.core.im.custom.bean.RoomTipAttachment; import com.nnbc123.core.im.custom.bean.RoomTipAttachment;
import com.nnbc123.core.im.custom.bean.TarotAttachment; import com.nnbc123.core.im.custom.bean.TarotAttachment;
import com.nnbc123.core.im.custom.bean.TarotMsgBean; import com.nnbc123.core.im.custom.bean.TarotMsgBean;
import com.nnbc123.core.im.custom.bean.UnLockGiftAttachment;
import com.nnbc123.core.im.custom.bean.VipMessageAttachment; import com.nnbc123.core.im.custom.bean.VipMessageAttachment;
import com.nnbc123.core.im.custom.bean.WelcomeAttachment; import com.nnbc123.core.im.custom.bean.WelcomeAttachment;
import com.nnbc123.core.im.custom.bean.WishListAttachment; import com.nnbc123.core.im.custom.bean.WishListAttachment;
@@ -215,6 +218,7 @@ public class MessageView extends FrameLayout {
private int whiteColor; private int whiteColor;
private int greyColor; private int greyColor;
private int appColor; private int appColor;
private int giftColor;
private int badgeWidth; private int badgeWidth;
private int badgeHeight; private int badgeHeight;
private int sysIconHeight; private int sysIconHeight;
@@ -277,6 +281,7 @@ public class MessageView extends FrameLayout {
whiteColor = ContextCompat.getColor(context, R.color.white); whiteColor = ContextCompat.getColor(context, R.color.white);
greyColor = ContextCompat.getColor(context, R.color.white_transparent_50); greyColor = ContextCompat.getColor(context, R.color.white_transparent_50);
appColor = ContextCompat.getColor(context, R.color.app_color); appColor = ContextCompat.getColor(context, R.color.app_color);
giftColor = ContextCompat.getColor(context, R.color.color_5CEFFF);
paddingWidth = Utils.dip2px(context, 10); paddingWidth = Utils.dip2px(context, 10);
paddingHeight = Utils.dip2px(context, 8); paddingHeight = Utils.dip2px(context, 8);
badgeWidth = Utils.dip2px(context, 15); badgeWidth = Utils.dip2px(context, 15);
@@ -1011,6 +1016,13 @@ public class MessageView extends FrameLayout {
if (second == CustomAttachment.CUSTOM_MSG_PRIVILEGE_SECOND || second == CustomAttachment.CUSTOM_MSG_PRIVILEGE_SECOND_VIDEO) { if (second == CustomAttachment.CUSTOM_MSG_PRIVILEGE_SECOND || second == CustomAttachment.CUSTOM_MSG_PRIVILEGE_SECOND_VIDEO) {
setPrivilegeNoticeMessage(chatRoomMessage, tvContent); setPrivilegeNoticeMessage(chatRoomMessage, tvContent);
} }
} else if (first == CUSTOM_MSG_GIFT) {
setVIPMessageBackground(chatRoomMessage, tvContent);
if (second == CustomAttachment.CUSTOM_MSG_GIFT_UNLOCK) {
setUnLockGiftMsg(tvContent, (UnLockGiftAttachment) attachment, chatRoomMessage);
} else if (second == CustomAttachment.CUSTOM_MSG_GIFT_DRESS) {
setDressGiftMsg(tvContent, (DressUpGiftAttachment) attachment, chatRoomMessage);
}
} else { } else {
tvContent.setTextColor(Color.WHITE); tvContent.setTextColor(Color.WHITE);
tvContent.setText(tvContent.getResources().getText(R.string.not_support_message_tip)); tvContent.setText(tvContent.getResources().getText(R.string.not_support_message_tip));
@@ -2928,6 +2940,53 @@ public class MessageView extends FrameLayout {
} }
private void setUnLockGiftMsg(TextView tvContent, UnLockGiftAttachment attachment, ChatRoomMessage chatRoomMessage) {
if (attachment == null) return;
String nick = RegexUtil.getPrintableString(attachment.getNick());
String giftName = attachment.getGiftNameNotNull();
String giftImage = attachment.getGiftUrlNotNull();
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(getNewUserDrawable(chatRoomMessage), badgeWidth, badgeHeight)
.append(nick, new ForegroundColorSpan(appColor), new OriginalDrawStatusClickSpan() {
@Override
public void onClick(@NonNull View widget) {
if (clickConsumer != null) {
Single.just(chatRoomMessage.getFromAccount()).subscribe(clickConsumer);
}
}
})
.append(" 已解锁礼物 ", new ForegroundColorSpan(whiteColor))
.append(giftImage, giftLength, giftLength)
.append(giftName, new ForegroundColorSpan(giftColor));
tvContent.setText(text.build());
tvContent.setOnClickListener(null);
tvContent.setMovementMethod(new LinkMovementMethod());
}
private void setDressGiftMsg(TextView tvContent, DressUpGiftAttachment attachment, ChatRoomMessage chatRoomMessage) {
if (attachment == null) return;
String nick = RegexUtil.getPrintableString(attachment.getNick());
String dressName = attachment.getDressNameNotNull();
String dressImage = attachment.getDressUrlNotNull();
SpannableBuilder text = new SpannableBuilder(tvContent)
.append(getNewUserDrawable(chatRoomMessage), badgeWidth, badgeHeight)
.append(nick, new ForegroundColorSpan(appColor), new OriginalDrawStatusClickSpan() {
@Override
public void onClick(@NonNull View widget) {
if (clickConsumer != null) {
Single.just(chatRoomMessage.getFromAccount()).subscribe(clickConsumer);
}
}
})
.append(" 获得 "+dressName+"装扮 ", new ForegroundColorSpan(whiteColor))
.append(dressImage, giftLength, giftLength);
tvContent.setText(text.build());
tvContent.setOnClickListener(null);
tvContent.setMovementMethod(new LinkMovementMethod());
}
@Nullable @Nullable
private Drawable getNewUserDrawable(ChatRoomMessage chatRoomMessage) { private Drawable getNewUserDrawable(ChatRoomMessage chatRoomMessage) {
boolean newUser = NobleUtil.getIsNewUser(UserInfo.IS_NEW_USER, chatRoomMessage); boolean newUser = NobleUtil.getIsNewUser(UserInfo.IS_NEW_USER, chatRoomMessage);

View File

@@ -2,7 +2,6 @@ package com.nnbc123.app.decoration.adapter;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView;
import com.netease.nim.uikit.support.glide.GlideApp; import com.netease.nim.uikit.support.glide.GlideApp;
import com.nnbc123.app.R; import com.nnbc123.app.R;
@@ -39,62 +38,22 @@ public class MyCarAdapter extends BaseAdapter<CarInfo> {
helper.addOnClickListener(R.id.tv_used); helper.addOnClickListener(R.id.tv_used);
// 倒计时 if (item.getStatus() == CarInfo.STATUS_USER_CAN_USE) {
int remainingDay = item.getRemainingDay(); binding.tvUsed.setVisibility(View.VISIBLE);
int status = item.getStatus(); binding.tvUsed.setEnabled(true);
boolean canUse; binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
if (item.isUsing()) {
if (remainingDay >= 0 && status == CarInfo.STATUS_USER_CAN_USE) { binding.tvUsed.setText("取消使用");
canUse = true; binding.tvUsed.setBackgroundResource(R.drawable.bg_common_cancel);
} else { } else {
canUse = false; binding.tvUsed.setText("使用");
} binding.tvUsed.setBackgroundResource(R.drawable.bg_common_confirm);
// 时间
if (remainingDay >= 0 && status == CarInfo.STATUS_USER_CAN_USE) {
String days;
if (item.getRemainingDay() > 99){
days = "99+";
}else {
days = item.getRemainingDay()+"";
} }
binding.tvCounters.setText(String.format(binding.tvCounters.getResources().getString(R.string.decoration_status_wrapper),
binding.tvCounters.getResources().getString(R.string.decoration_remainder) + days + ""));
} else { } else {
if (status == CarInfo.STATUS_OFF_SHELF || status == CarInfo.STATUS_OUT_OF_DATE) { binding.tvUsed.setVisibility(View.GONE);
binding.tvCounters.setText(String.format(binding.tvCounters.getResources().getString(R.string.decoration_status_wrapper), binding.tvCounters.setText(binding.tvCounters.getResources().getString(R.string.past_due));
binding.tvCounters.getResources().getString(R.string.past_due)));
}
} }
setUseButton(binding.tvUsed, canUse, item.isUsing());
updateTag(item, binding.ivTag); updateTag(item, binding.ivTag);
}
private void setUseButton(TextView tvUsed, boolean canUse, boolean isUsing) {
if (!canUse) {
tvUsed.setVisibility(View.GONE);
tvUsed.setText("使用");
tvUsed.setBackgroundResource(R.drawable.bg_common_disable);
tvUsed.setEnabled(false);
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_secondary_878b9c));
} else if (isUsing) {
tvUsed.setVisibility(View.VISIBLE);
tvUsed.setText("取消使用");
tvUsed.setBackgroundResource(R.drawable.bg_common_cancel);
tvUsed.setEnabled(true);
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_normal_282828));
} else {
tvUsed.setVisibility(View.VISIBLE);
tvUsed.setText("使用");
tvUsed.setBackgroundResource(R.drawable.bg_common_confirm);
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_title_282828));
tvUsed.setEnabled(true);
}
} }
private void updateTag(CarInfo carInfo, ImageView ivTag) { private void updateTag(CarInfo carInfo, ImageView ivTag) {

View File

@@ -55,25 +55,12 @@ public class MyChatBubbleAdapter extends BaseAdapter<ChatBubbleInfo> {
binding.tvUsed.setVisibility(View.GONE); binding.tvUsed.setVisibility(View.GONE);
binding.tvUsed.setEnabled(false); binding.tvUsed.setEnabled(false);
binding.tvUsed.setText("使用"); binding.tvUsed.setText("使用");
binding.tvCounters.setText(mContext.getString(R.string.past_due));
} else { } else {
binding.tvUsed.setVisibility(View.VISIBLE); binding.tvUsed.setVisibility(View.VISIBLE);
binding.tvUsed.setEnabled(true); binding.tvUsed.setEnabled(true);
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
} }
// 日期展示
if (item.isHasExpired()) { // 过期
binding.tvCounters.setText(mContext.getString(R.string.past_due));
} else {
String days;
if (item.getExpireDays() > 99) {
days = "99+";
} else {
days = item.getExpireDays() + "";
}
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
}
} }
} }

View File

@@ -46,30 +46,14 @@ public class MyHeadWearAdapter extends BaseAdapter<HeadWearInfo> {
binding.ivTag.setImageResource(R.drawable.ic_mark_exclusive); binding.ivTag.setImageResource(R.drawable.ic_mark_exclusive);
} }
// 过期状态不可使用 if (item.getStatus() == 3) {
if (item.getStatus() == 2) {
binding.tvUsed.setVisibility(View.GONE);
binding.tvUsed.setEnabled(false);
binding.tvUsed.setText("使用");
} else {
binding.tvUsed.setVisibility(View.VISIBLE); binding.tvUsed.setVisibility(View.VISIBLE);
binding.tvUsed.setEnabled(true); binding.tvUsed.setEnabled(true);
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
}
// 日期展示
if (item.getStatus() == 2) { // 过期
binding.tvCounters.setText(mContext.getString(R.string.past_due));
} else { } else {
String days; binding.tvUsed.setVisibility(View.GONE);
if (item.getExpireDays() > 99){ binding.tvCounters.setText(mContext.getString(R.string.past_due));
days = "99+";
}else {
days = item.getExpireDays()+"";
}
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
} }
} }
} }

View File

@@ -32,31 +32,16 @@ public class MyNamePlateAdapter extends BaseQuickAdapter<NamePlateInfo.Nameplate
.load(item.getNameplateImage()) .load(item.getNameplateImage())
.into(ivCover); .into(ivCover);
//使用按钮
TextView tvUsed = helper.getView(R.id.tv_used); TextView tvUsed = helper.getView(R.id.tv_used);
tvUsed.setBackgroundResource(item.isUsing() ? R.drawable.bg_common_cancel : R.drawable.bg_common_confirm); if (!item.isExpired()) {
tvUsed.setTextColor(item.isUsing() ? mContext.getResources().getColor(R.color.color_4C5AF1) : helper.setText(R.id.tv_counters, mContext.getString(R.string.decoration_remainder) + item.getExpireText());
mContext.getResources().getColor(R.color.white)); tvUsed.setVisibility(View.VISIBLE);
tvUsed.setText(item.isUsing() ? R.string.label_used : R.string.label_can_use); tvUsed.setText(item.isUsing() ? R.string.label_used : R.string.label_can_use);
if (item.isIsExpired()) { // 过期 tvUsed.setEnabled(true);
// 日期展示 tvUsed.setBackgroundResource(item.isUsing() ? R.drawable.bg_common_cancel : R.drawable.bg_common_confirm);
} else {
helper.setText(R.id.tv_counters, mContext.getString(R.string.past_due)); helper.setText(R.id.tv_counters, mContext.getString(R.string.past_due));
tvUsed.setVisibility(View.GONE); tvUsed.setVisibility(View.GONE);
tvUsed.setEnabled(false);
tvUsed.setBackgroundResource(R.drawable.bg_common_disable);
tvUsed.setText("使用");
tvUsed.setTextColor(mContext.getResources().getColor(R.color.text_secondary_878b9c));
} else {
String days;
if (item.getExpireDays() > 99) {
days = "99+";
} else {
days = item.getExpireDays() + "";
}
helper.setText(R.id.tv_counters, mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
tvUsed.setVisibility(View.VISIBLE);
tvUsed.setEnabled(true);
} }
} }
} }

View File

@@ -54,25 +54,12 @@ public class MyUserCardWearAdapter extends BaseAdapter<UserCardWearInfo> {
binding.tvUsed.setVisibility(View.GONE); binding.tvUsed.setVisibility(View.GONE);
binding.tvUsed.setEnabled(false); binding.tvUsed.setEnabled(false);
binding.tvUsed.setText("使用"); binding.tvUsed.setText("使用");
binding.tvCounters.setText(mContext.getString(R.string.past_due));
} else { } else {
binding.tvUsed.setVisibility(View.VISIBLE); binding.tvUsed.setVisibility(View.VISIBLE);
binding.tvUsed.setEnabled(true); binding.tvUsed.setEnabled(true);
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + item.getExpireText());
} }
// 日期展示
if (item.isHasExpired()) { // 过期
binding.tvCounters.setText(mContext.getString(R.string.past_due));
} else {
String days;
if (item.getExpireDays() > 99) {
days = "99+";
} else {
days = item.getExpireDays() + "";
}
binding.tvCounters.setText(mContext.getString(R.string.decoration_remainder) + days + mContext.getString(R.string.day));
}
} }
} }

View File

@@ -1,13 +1,18 @@
package com.nnbc123.app.decoration.view.widgets; package com.nnbc123.app.decoration.view.widgets;
import android.content.Context; import android.content.Context;
import android.graphics.Color;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.nnbc123.app.R; import com.nnbc123.app.R;
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter; import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator; import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView; import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
import com.nnbc123.core.home.bean.TabInfo; import com.nnbc123.core.home.bean.TabInfo;
import java.util.List; import java.util.List;
@@ -38,9 +43,9 @@ public class MyDecorationMagicIndicator extends CommonNavigatorAdapter {
public IPagerTitleView getTitleView(Context context, final int i) { public IPagerTitleView getTitleView(Context context, final int i) {
BadgeScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new BadgeScaleTransitionPagerTitleView(context); BadgeScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new BadgeScaleTransitionPagerTitleView(context);
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(mContext, R.color.text_secondary_878b9c)); scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(mContext, R.color.text_secondary_878b9c));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(mContext, R.color.text_title_282828)); scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(mContext, R.color.color_2B2D33));
scaleTransitionPagerTitleView.setMinScale(0.9f); scaleTransitionPagerTitleView.setMinScale(0.9f);
scaleTransitionPagerTitleView.setTextSize(15); scaleTransitionPagerTitleView.setTextSize(14);
scaleTransitionPagerTitleView.setText(mTitleList.get(i).getName()); scaleTransitionPagerTitleView.setText(mTitleList.get(i).getName());
if (mTitleList.get(i).getName().equals("座驾")) { if (mTitleList.get(i).getName().equals("座驾")) {
scaleTransitionPagerTitleView.findViewById(R.id.car_badge).setId(R.id.car_badge_garage); scaleTransitionPagerTitleView.findViewById(R.id.car_badge).setId(R.id.car_badge_garage);
@@ -62,7 +67,16 @@ public class MyDecorationMagicIndicator extends CommonNavigatorAdapter {
@Override @Override
public IPagerIndicator getIndicator(Context context) { public IPagerIndicator getIndicator(Context context) {
return null; LinePagerIndicator indicator = new LinePagerIndicator(context);
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
indicator.setLineHeight(UIUtil.dip2px(context, 4));
indicator.setRoundRadius(UIUtil.dip2px(context, 2));
indicator.setLineWidth(UIUtil.dip2px(context, 8));
indicator.setColors(Color.parseColor("#FFDA24"));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
//lp.bottomMargin = 0;
indicator.setLayoutParams(lp);
return indicator;
} }
public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) { public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) {

View File

@@ -10,6 +10,7 @@ import android.graphics.drawable.Drawable;
import com.nnbc123.app.R; import com.nnbc123.app.R;
import com.nnbc123.app.vip.VipHelper; import com.nnbc123.app.vip.VipHelper;
import com.nnbc123.core.gift.bean.GiftInfo; import com.nnbc123.core.gift.bean.GiftInfo;
import com.nnbc123.core.gift.bean.GiftType;
import com.nnbc123.core.gift.bean.SimpleVipInfo; import com.nnbc123.core.gift.bean.SimpleVipInfo;
import com.nnbc123.library.bindinglist.BaseItem; import com.nnbc123.library.bindinglist.BaseItem;
@@ -28,6 +29,8 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
public final ObservableField<String> countText = new ObservableField<>(); public final ObservableField<String> countText = new ObservableField<>();
public final ObservableBoolean isLocked = new ObservableBoolean();
public Drawable nobleDrawable; public Drawable nobleDrawable;
public Drawable radishDrawable; public Drawable radishDrawable;
@@ -54,8 +57,6 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
*/ */
public boolean isExclusive; public boolean isExclusive;
public boolean isLocked;
public String vipIcon; public String vipIcon;
public boolean isPrivateChat; public boolean isPrivateChat;
@@ -64,13 +65,13 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
super(context, data); super(context, data);
this.isSelect.set(select); this.isSelect.set(select);
if (data.getConsumeType() == GiftInfo.CONSUME_TYPE_GOLD) { if (data.getConsumeType() == GiftInfo.CONSUME_TYPE_GOLD) {
radishDrawable = null; radishDrawable = context.getResources().getDrawable(R.drawable.gift_dialog_ic_diamond);
radishDrawableSelected = null; radishDrawableSelected = context.getResources().getDrawable(R.drawable.gift_dialog_ic_diamond);
} else { } else {
radishDrawable = context.getResources().getDrawable(R.drawable.icon_radish_transparent); radishDrawable = context.getResources().getDrawable(R.drawable.icon_radish_transparent);
radishDrawableSelected = context.getResources().getDrawable(R.drawable.icon_radish_transparent_selected); radishDrawableSelected = context.getResources().getDrawable(R.drawable.icon_radish_transparent_selected);
} }
goldText.set(data.getGoldPrice() + "钻石"); goldText.set(String.valueOf(data.getGoldPrice()));
this.isKnap.set(isKnap); this.isKnap.set(isKnap);
updateCount(); updateCount();
int nobleId = data.getLevel(); int nobleId = data.getLevel();
@@ -88,8 +89,8 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
isShowEffect = data.isHasEffect(); isShowEffect = data.isHasEffect();
isExclusive = data.isRoomExclude(); isExclusive = data.isRoomExclude();
SimpleVipInfo vipInfo = data.getGiftVipInfo(); SimpleVipInfo vipInfo = data.getGiftVipInfo();
isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
vipIcon = vipInfo == null ? "" : vipInfo.getVipIcon(); vipIcon = vipInfo == null ? "" : vipInfo.getVipIcon();
isLocked.set(getIsLocked());
} }
@Override @Override
@@ -106,4 +107,20 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
this.countText.set("x" + data.getCount()); this.countText.set("x" + data.getCount());
} }
public void refreshUnlockState() {
isLocked.set(getIsLocked());
}
private boolean getIsLocked() {
SimpleVipInfo vipInfo = data.getGiftVipInfo();
boolean isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
if (!isLocked) {
if (data.getGiftType() == GiftType.GIFT_TYPE_UNLOCK) {
if (!data.isUnlocked()) {
isLocked = true;
}
}
}
return isLocked;
}
} }

View File

@@ -30,8 +30,8 @@ public class UserGiftActivity extends BaseActivity {
MagicIndicator magicIndicator = findViewById(R.id.magic_indicator); MagicIndicator magicIndicator = findViewById(R.id.magic_indicator);
List<Fragment> fragmentList = new ArrayList<>(2); List<Fragment> fragmentList = new ArrayList<>(2);
//礼物类型 1:普通礼物;2:辛运礼物 //礼物类型 1:普通礼物;2:辛运礼物
fragmentList.add(UserInfoGiftFragment.newInstance(1,true)); fragmentList.add(UserInfoGiftFragment.newInstance(1));
fragmentList.add(UserInfoGiftFragment.newInstance(2,true)); fragmentList.add(UserInfoGiftFragment.newInstance(2));
UserInfoPagerAdapter pagerAdapter = new UserInfoPagerAdapter(getSupportFragmentManager(), fragmentList); UserInfoPagerAdapter pagerAdapter = new UserInfoPagerAdapter(getSupportFragmentManager(), fragmentList);
final List<String> tagList = new ArrayList<>(2); final List<String> tagList = new ArrayList<>(2);
tagList.add("普通礼物"); tagList.add("普通礼物");

View File

@@ -9,6 +9,7 @@ import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
@@ -57,6 +58,7 @@ import com.nnbc123.app.ui.utils.ImageLoadUtils;
import com.nnbc123.app.ui.widget.ButtonItem; import com.nnbc123.app.ui.widget.ButtonItem;
import com.nnbc123.app.ui.widget.ObservableScrollView; import com.nnbc123.app.ui.widget.ObservableScrollView;
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper; import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper;
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator; import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
import com.nnbc123.app.ui.widget.rollviewpager.HintView; import com.nnbc123.app.ui.widget.rollviewpager.HintView;
import com.nnbc123.app.ui.widget.rollviewpager.RollPagerView; import com.nnbc123.app.ui.widget.rollviewpager.RollPagerView;
@@ -163,6 +165,11 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
} }
}); });
if (userId != AuthModel.get().getCurrentUid()) {
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) mBinding.viewPager.getLayoutParams();
layoutParams.bottomMargin = UIUtil.dip2px(context, 60);
mBinding.viewPager.setLayoutParams(layoutParams);
}
} }

View File

@@ -47,13 +47,11 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
private UserGiftAdapter userGiftAdapter; private UserGiftAdapter userGiftAdapter;
private Observer mObserver; private Observer mObserver;
private Observer mUidObserver; private Observer mUidObserver;
private boolean isDetails = false;
public static UserInfoGiftFragment newInstance(int giftType, boolean isDetails) { public static UserInfoGiftFragment newInstance(int giftType) {
UserInfoGiftFragment userInfoGiftFragment = new UserInfoGiftFragment(); UserInfoGiftFragment userInfoGiftFragment = new UserInfoGiftFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putInt("giftType", giftType); args.putInt("giftType", giftType);
args.putBoolean("isDetails", isDetails);
userInfoGiftFragment.setArguments(args); userInfoGiftFragment.setArguments(args);
return userInfoGiftFragment; return userInfoGiftFragment;
} }
@@ -89,9 +87,8 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
@Override @Override
public void initiate() { public void initiate() {
isDetails = requireArguments().getBoolean("isDetails", false);
mBinding.rvGift.setLayoutManager(new GridLayoutManager(mContext, 4)); mBinding.rvGift.setLayoutManager(new GridLayoutManager(mContext, 4));
userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems, isDetails); userGiftAdapter = new UserGiftAdapter(mContext, userInfoItems);
userGiftAdapter.bindToRecyclerView(mBinding.rvGift); userGiftAdapter.bindToRecyclerView(mBinding.rvGift);
userGiftAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() { userGiftAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
@Override @Override
@@ -155,10 +152,6 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
for (int i = 0; i < giftWallInfoList.size(); i++) { for (int i = 0; i < giftWallInfoList.size(); i++) {
userInfoItem = new UserInfoItem<>(UserInfoItem.TYPE_GIFT_ITEM, giftWallInfoList.get(i)); userInfoItem = new UserInfoItem<>(UserInfoItem.TYPE_GIFT_ITEM, giftWallInfoList.get(i));
userInfoItems.add(userInfoItem); userInfoItems.add(userInfoItem);
//非礼物详情页主需要12个就够了
if (!isDetails && i == 11){
break;
}
} }
} }

View File

@@ -3,24 +3,24 @@ package com.nnbc123.app.ui.user.adapter;
import android.content.Context; import android.content.Context;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.nnbc123.app.R; import com.nnbc123.app.R;
import com.nnbc123.app.ui.utils.ImageLoadUtils; import com.nnbc123.app.ui.utils.ImageLoadUtils;
import com.nnbc123.core.bean.UserInfoItem; import com.nnbc123.core.bean.UserInfoItem;
import com.nnbc123.core.user.bean.GiftWallInfo; import com.nnbc123.core.user.bean.GiftWallInfo;
import com.nnbc123.library.utils.ResUtil;
import java.util.List; import java.util.List;
public class UserGiftAdapter extends UserTabBaseAdapter { public class UserGiftAdapter extends UserTabBaseAdapter {
private final boolean isDetails;
public UserGiftAdapter(Context context, List<UserInfoItem> data, boolean isDetails) { public UserGiftAdapter(Context context, List<UserInfoItem> data) {
super(context, data); super(context, data);
addItemType(UserInfoItem.TYPE_GIFT_ITEM, R.layout.list_item_gift_wall_info); addItemType(UserInfoItem.TYPE_GIFT_ITEM, R.layout.list_item_gift_wall_info);
addItemType(UserInfoItem.TYPE_GIFT_EMPTY, R.layout.layout_gift_empty); addItemType(UserInfoItem.TYPE_GIFT_EMPTY, R.layout.layout_gift_empty);
this.isDetails = isDetails;
} }
@Override @Override
@@ -46,17 +46,57 @@ public class UserGiftAdapter extends UserTabBaseAdapter {
GiftWallInfo giftWallInfo = (GiftWallInfo) item.getData(); GiftWallInfo giftWallInfo = (GiftWallInfo) item.getData();
if (giftWallInfo != null) { if (giftWallInfo != null) {
helper.setText(R.id.gift_name, giftWallInfo.getGiftName()) helper.setText(R.id.gift_name, giftWallInfo.getGiftName())
.setGone(R.id.gift_name, isDetails)
.setText(R.id.gift_num, "x" + giftWallInfo.getReciveCount()) .setText(R.id.gift_num, "x" + giftWallInfo.getReciveCount())
.setBackgroundRes(R.id.gift_num, isDetails ? R.drawable.bg_user_gift_item_details : R.drawable.bg_user_gift_item) .setText(R.id.gift_price, giftWallInfo.getGiftPrice() + "");
.setText(R.id.gift_price, giftWallInfo.getGiftPrice() + "")
.setGone(R.id.gift_price, isDetails);
ImageView giftPic = helper.itemView.findViewById(R.id.gift_img); ImageView giftPic = helper.itemView.findViewById(R.id.gift_img);
ImageLoadUtils.loadImage(mContext, giftWallInfo.getPicUrl(), giftPic); ImageLoadUtils.loadImage(mContext, giftWallInfo.getPicUrl(), giftPic);
loadLevelUI(helper, giftWallInfo);
} }
}
private void loadLevelUI(BaseViewHolder helper, GiftWallInfo item) {
ImageView bgView = helper.getView(R.id.iv_bg);
TextView nameView = helper.getView(R.id.gift_name);
TextView numView = helper.getView(R.id.gift_num);
TextView priceView = helper.getView(R.id.gift_price);
int bgResId;
switch (item.getGiftLevel()) {
case 1:
bgResId = R.drawable.gift_wall_bg_level_1;
break;
case 2:
bgResId = R.drawable.gift_wall_bg_level_2;
break;
case 3:
bgResId = R.drawable.gift_wall_bg_level_3;
break;
case 4:
bgResId = R.drawable.gift_wall_bg_level_4;
break;
case 5:
bgResId = R.drawable.gift_wall_bg_level_5;
break;
case 6:
bgResId = R.drawable.gift_wall_bg_level_6;
break;
case 7:
bgResId = R.drawable.gift_wall_bg_level_7;
break;
default:
bgResId = R.drawable.gift_wall_bg_level_0;
break;
}
bgView.setImageResource(bgResId);
if (bgResId == R.drawable.gift_wall_bg_level_0) {
nameView.setTextColor(ResUtil.getColor(R.color.color_696D7A));
numView.setTextColor(ResUtil.getColor(R.color.color_7F8494));
priceView.setTextColor(ResUtil.getColor(R.color.color_7F8494));
} else {
nameView.setTextColor(ResUtil.getColor(R.color.color_FFFFFF));
numView.setTextColor(ResUtil.getColor(R.color.color_F5F6FA));
priceView.setTextColor(ResUtil.getColor(R.color.color_F5F6FA));
}
} }
} }

View File

@@ -1,6 +1,5 @@
package com.nnbc123.app.ui.user.view package com.nnbc123.app.ui.user.view
import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.view.Gravity import android.view.Gravity
@@ -13,6 +12,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.chuhai.utils.ktx.singleClick
import com.netease.nim.uikit.common.util.sys.ScreenUtil import com.netease.nim.uikit.common.util.sys.ScreenUtil
import com.nnbc123.app.R import com.nnbc123.app.R
import com.nnbc123.app.base.BaseViewBindingFragment import com.nnbc123.app.base.BaseViewBindingFragment
@@ -21,17 +21,18 @@ import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter
import com.nnbc123.app.skill.activity.SkillHomeActivity import com.nnbc123.app.skill.activity.SkillHomeActivity
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_CUSTOM import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_CUSTOM
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_SELF import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.PAGE_TYPE_SELF
import com.nnbc123.app.ui.user.UserGiftActivity
import com.nnbc123.app.ui.user.UserInfoActivity import com.nnbc123.app.ui.user.UserInfoActivity
import com.nnbc123.app.ui.user.UserInfoGiftFragment import com.nnbc123.app.ui.user.UserInfoGiftFragment
import com.nnbc123.app.ui.user.adapter.SkillCardAdapter import com.nnbc123.app.ui.user.adapter.SkillCardAdapter
import com.nnbc123.app.ui.user.adapter.UserInfoPagerAdapter import com.nnbc123.app.ui.user.adapter.UserInfoPagerAdapter
import com.nnbc123.app.ui.user.decorationsend.UserInfoSkillDecoration import com.nnbc123.app.ui.user.decorationsend.UserInfoSkillDecoration
import com.nnbc123.app.ui.user.viewmodel.UserInfoViewModel import com.nnbc123.app.ui.user.viewmodel.UserInfoViewModel
import com.nnbc123.app.ui.webview.CommonWebViewActivity
import com.nnbc123.app.ui.widget.magicindicator.MagicIndicator import com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil
import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator import com.nnbc123.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
import com.nnbc123.core.UriProvider
import com.nnbc123.core.auth.AuthModel import com.nnbc123.core.auth.AuthModel
import com.nnbc123.core.user.bean.UserInfoSkillEntity import com.nnbc123.core.user.bean.UserInfoSkillEntity
import com.nnbc123.library.annatation.ActLayoutRes import com.nnbc123.library.annatation.ActLayoutRes
@@ -54,14 +55,15 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
val magicIndicator: MagicIndicator = binding.magicIndicatorGift val magicIndicator: MagicIndicator = binding.magicIndicatorGift
val fragmentList: MutableList<Fragment> = ArrayList(2) val fragmentList: MutableList<Fragment> = ArrayList(2)
//礼物类型 1:普通礼物;2:辛运礼物 //礼物类型 1:普通礼物;2:辛运礼物
fragmentList.add(UserInfoGiftFragment.newInstance(1, false)) fragmentList.add(UserInfoGiftFragment.newInstance(1))
fragmentList.add(UserInfoGiftFragment.newInstance(2, false)) fragmentList.add(UserInfoGiftFragment.newInstance(2))
val pagerAdapter = UserInfoPagerAdapter(childFragmentManager, fragmentList) val pagerAdapter = UserInfoPagerAdapter(childFragmentManager, fragmentList)
val tagList: MutableList<String> = ArrayList(2) val tagList: MutableList<String> = ArrayList(2)
tagList.add("普通礼物") tagList.add("普通礼物")
tagList.add("幸运礼物") tagList.add("幸运礼物")
val commonNavigator = CommonNavigator(context) val commonNavigator = CommonNavigator(context)
commonNavigator.setTitleWrapContent(true) commonNavigator.setTitleWrapContent(true)
commonNavigator.setTitleGravity(Gravity.CENTER)
commonNavigator.titleMargin = ScreenUtil.dip2px(7.0F) commonNavigator.titleMargin = ScreenUtil.dip2px(7.0F)
val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, tagList) val magicIndicatorAdapter = MainMagicIndicatorAdapter(context, tagList)
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? -> magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
@@ -115,9 +117,6 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
} }
override fun onClick(v: View) { override fun onClick(v: View) {
when (v.id) {
R.id.iv_more_gift -> startActivity(Intent(mContext, UserGiftActivity::class.java))
}
} }
private fun createSkillEmptyView(): View { private fun createSkillEmptyView(): View {
@@ -150,11 +149,19 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
} }
override fun init() { override fun init() {
binding.viewPagerGift.post {
val layoutParams = binding.viewPagerGift.layoutParams
val newHeight = binding.layoutRoot.height - binding.viewPagerGift.top
layoutParams.height = newHeight
binding.viewPagerGift.layoutParams = layoutParams
}
binding.tvGiftLevel.singleClick {
CommonWebViewActivity.start(context, UriProvider.getGiftLevelRuleUrl())
}
initGiftList() initGiftList()
vm.userInfoSkillData.observe(this) { vm.userInfoSkillData.observe(this) {
initSkillCardList(it) initSkillCardList(it)
} }
binding.ivMoreGift.setOnClickListener(this)
} }
} }

View File

@@ -427,6 +427,14 @@ public class ImageLoadUtils {
GlideApp.with(context.getApplicationContext()).load(url).dontAnimate().into(imageView); GlideApp.with(context.getApplicationContext()).load(url).dontAnimate().into(imageView);
} }
public static void loadImage(ImageView imageView, String url, int cornerRadius) {
if (imageView == null) {
return;
}
GlideApp.with(imageView.getContext()).load(url).dontAnimate()
.transform(new CenterCrop(), new RoundedCorners(cornerRadius)).into(imageView);
}
public static void loadImage1(Context context, String url, ImageView imageView) { public static void loadImage1(Context context, String url, ImageView imageView) {
GlideApp.with(context).load(url).optionalFitCenter().into(new SimpleTarget<Drawable>() { GlideApp.with(context).load(url).optionalFitCenter().into(new SimpleTarget<Drawable>() {
@Override @Override

View File

@@ -69,6 +69,15 @@ public class ImageLoadUtilsV2 {
isDontAnim, null); isDontAnim, null);
} }
public static void loadImage(ImageView imageView, String url, int defaultRes, int roundDp) {
if (imageView == null) {
return;
}
loadImage(imageView.getContext(), imageView, url, -1, false,
defaultRes, defaultRes, false, null,
new CenterCrop(), new RoundedCorners(UIUtil.dip2px(imageView.getContext(), roundDp)));
}
public static void loadImage(ImageView imageView, String url, public static void loadImage(ImageView imageView, String url,
int size, boolean isSquare, int size, boolean isSquare,
int errorId, int placeholderId, int errorId, int placeholderId,

View File

@@ -0,0 +1,98 @@
package com.nnbc123.app.ui.widget
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.view.ViewGroup
import androidx.cardview.widget.CardView
import androidx.core.util.Consumer
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import com.github.mmin18.widget.RealtimeBlurView
import com.nnbc123.app.R
import com.nnbc123.core.gift.bean.GiftInfo
import com.nnbc123.core.gift.bean.GiftType
import com.nnbc123.core.gift.bean.UnLockBaseGiftInfo
import com.nnbc123.core.gift.bean.UnlockItem
/**
* Created by Max on 2024/1/26 17:16
* Desc:
**/
class GIftDialogUnlockPanel : CardView {
private var recyclerView: RecyclerView? = null
private var adapter: GiftUnLockInfoAdapter = GiftUnLockInfoAdapter(emptyList())
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init {
inflate(context, R.layout.gift_dialog_unlock_panel, this)
recyclerView = findViewById(R.id.recyclerView)
recyclerView?.adapter = adapter
}
fun update(currentGift: GiftInfo?) {
if (currentGift == null || currentGift.giftType != GiftType.GIFT_TYPE_UNLOCK) {
this.isVisible = false
return
}
val list = ArrayList<UnlockItem>()
val baseGift = currentGift.baseGift
val childGift = currentGift.unlockGiftList
if (baseGift != null) {
list.add(UnLockBaseGiftInfo(baseGift))
}
if (!childGift.isNullOrEmpty()) {
list.addAll(childGift)
}
if (list.isEmpty()) {
this.isVisible = false
return
}
this.isVisible = true
checkAddBlurView()
val index = list.indexOfFirst {
it.getGiftData()?.giftId == currentGift.giftId
}
adapter.selectItemId = currentGift.giftId
adapter.setNewData(baseGift, list)
if (index >= 0) {
recyclerView?.smoothScrollToPosition(index)
}
}
fun refreshState() {
adapter.notifyItemRangeChanged(0, adapter.itemCount, true)
}
fun setOnItemClickListener(listener: Consumer<Int>) {
adapter.setOnItemClickListener { adapter, view, position ->
val item = adapter.getItem(position) as? UnlockItem
val giftId = item?.getGiftData()?.giftId
if (giftId != null) {
listener.accept(giftId)
}
}
}
private fun checkAddBlurView() {
if (getChildAt(0) is RealtimeBlurView) {
return
}
val blurView = RealtimeBlurView(context, null)
blurView.setBlurRadius(25f)
blurView.setDownsampleFactor(4f)
blurView.setOverlayColor(Color.parseColor("#e0161722"))
blurView.layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
addView(blurView, 0)
}
}

View File

@@ -31,6 +31,7 @@ import androidx.appcompat.widget.AppCompatTextView;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.core.util.Consumer;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@@ -217,6 +218,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
private AppCompatTextView tvNum; private AppCompatTextView tvNum;
private SuperTextView tvPrivilegeGive; private SuperTextView tvPrivilegeGive;
private Group groupPrivilege; private Group groupPrivilege;
private GIftDialogUnlockPanel unLockPanel;
private ImageView dressUpBannerView;
private SparseArray<RecyclerViewNoViewpagerScroll> cacheItemView = new SparseArray<>();
private int mPrivilegePosition = 0; private int mPrivilegePosition = 0;
@@ -423,6 +427,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
ivDrawGiftRemoveLast = findViewById(R.id.iv_draw_gift_remove_last); ivDrawGiftRemoveLast = findViewById(R.id.iv_draw_gift_remove_last);
ivDrawGiftRemoveAll = findViewById(R.id.iv_draw_gift_remove_all); ivDrawGiftRemoveAll = findViewById(R.id.iv_draw_gift_remove_all);
ivDrawGiftClose = findViewById(R.id.iv_draw_gift_close); ivDrawGiftClose = findViewById(R.id.iv_draw_gift_close);
unLockPanel = findViewById(R.id.panel_unlock);
dressUpBannerView = findViewById(R.id.iv_dress_up_banner);
dressUpBannerView.setOnClickListener(this);
ivDrawGiftClose.setOnClickListener(this); ivDrawGiftClose.setOnClickListener(this);
ivDrawGiftRemoveLast.setOnClickListener(this); ivDrawGiftRemoveLast.setOnClickListener(this);
ivDrawGiftRemoveAll.setOnClickListener(this); ivDrawGiftRemoveAll.setOnClickListener(this);
@@ -432,8 +439,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
giftNumLayout = findViewById(R.id.gift_number_layout); giftNumLayout = findViewById(R.id.gift_number_layout);
giftNumLayout.setOnClickListener(this); giftNumLayout.setOnClickListener(this);
List<GiftTab> tabInfoList = new ArrayList<>(); List<GiftTab> tabInfoList = new ArrayList<>();
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NORMAL, "礼物", "礼物")); tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NORMAL, "普通", "普通"));
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_LUCKY, "幸运", "幸运")); tabInfoList.add(new GiftTab(GiftIndicator.TYPE_INTEREST, "趣味", "趣味", true));
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NOBLE, "贵族", "贵族")); tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NOBLE, "贵族", "贵族"));
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_WEEK, "星座礼物", "星座礼物")); tabInfoList.add(new GiftTab(GiftIndicator.TYPE_WEEK, "星座礼物", "星座礼物"));
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_SING_ROOM, "人气", "人气")); tabInfoList.add(new GiftTab(GiftIndicator.TYPE_SING_ROOM, "人气", "人气"));
@@ -446,8 +453,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
giftIndicator.initTab( giftIndicator.initTab(
tabInfoList, tabInfoList,
true, true,
context.getResources().getColor(R.color.color_bdbfd0), context.getResources().getColor(R.color.color_CED1DB),
context.getResources().getColor(R.color.color_ffe710) context.getResources().getColor(R.color.color_FFDA24)
); );
//noinspection ResultOfMethodCallIgnored //noinspection ResultOfMethodCallIgnored
giftIndicator.addClick() giftIndicator.addClick()
@@ -456,15 +463,13 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
.subscribe(integer -> { .subscribe(integer -> {
updateGiftView(integer); updateGiftView(integer);
//福袋礼物有定时更新逻辑,每次点击都需要刷新福袋礼物信息 //福袋礼物有定时更新逻辑,每次点击都需要刷新福袋礼物信息
if (integer == GiftIndicator.TYPE_LUCKY) { if (integer == GiftIndicator.TYPE_INTEREST) {
reloadData(false); reloadData(false);
} }
}); });
if (isInRoom) { if (isInRoom) {
giftIndicator.showPosition(GiftIndicator.TYPE_LUCKY);
} else { } else {
giftIndicator.hidePosition(GiftIndicator.TYPE_LUCKY);
giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT); giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT);
llTabType.setVisibility(View.GONE); llTabType.setVisibility(View.GONE);
lineTabType.setVisibility(View.GONE); lineTabType.setVisibility(View.GONE);
@@ -523,15 +528,17 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
case GiftType.GIFT_TYPE_NORMAL: case GiftType.GIFT_TYPE_NORMAL:
indicatorType = GiftIndicator.TYPE_NORMAL; indicatorType = GiftIndicator.TYPE_NORMAL;
break; break;
case GiftType.GIFT_TYPE_LUCKY:
indicatorType = GiftIndicator.TYPE_LUCKY;
break;
case GiftType.GIFT_TYPE_VIP: case GiftType.GIFT_TYPE_VIP:
indicatorType = GiftIndicator.TYPE_NOBLE; indicatorType = GiftIndicator.TYPE_NOBLE;
break; break;
case GiftType.GIFT_TYPE_WEEK_STAR: case GiftType.GIFT_TYPE_WEEK_STAR:
indicatorType = GiftIndicator.TYPE_WEEK; indicatorType = GiftIndicator.TYPE_WEEK;
break; break;
case GiftType.GIFT_TYPE_UNLOCK:
case GiftType.GIFT_TYPE_LUCKY:
case GiftType.GIFT_TYPE_DRESS_UP:
indicatorType = GiftIndicator.TYPE_INTEREST;
break;
} }
} }
showGiftTab(indicatorType, giftInfo); showGiftTab(indicatorType, giftInfo);
@@ -590,6 +597,15 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
if (DemoCache.readNewGiftTypeTipIndicator()) { if (DemoCache.readNewGiftTypeTipIndicator()) {
viewNewFeature.setVisibility(View.VISIBLE); viewNewFeature.setVisibility(View.VISIBLE);
} }
unLockPanel.setOnItemClickListener(new Consumer<Integer>() {
@Override
public void accept(Integer integer) {
if (integer == null) {
return;
}
trySelectGift(integer);
}
});
} }
private void initVipPager() { private void initVipPager() {
@@ -621,6 +637,33 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
pagerViewVip.setPlayDelay(3000); pagerViewVip.setPlayDelay(3000);
} }
private boolean trySelectGift(int giftId) {
if (pagerList == null) {
return false;
}
int currentPage = gridView.getCurrentItem();
if (currentPage < 0 || currentPage >= pagerList.size()) {
return false;
}
List<GiftInfoVm> list = pagerList.get(currentPage);
if (list == null) {
return false;
}
for (int i = 0; i < list.size(); i++) {
GiftInfoVm item = list.get(i);
GiftInfo itemInfo = item.data();
if (itemInfo != null && itemInfo.getGiftId() == giftId) {
onGiftClick(item);
RecyclerView recyclerView = cacheItemView.get(currentPage);
if (recyclerView != null) {
recyclerView.smoothScrollToPosition(i);
}
return true;
}
}
return false;
}
private void showLoadingAnimation() { private void showLoadingAnimation() {
Animation rotateAnimation = new RotateAnimation(0, 360, Animation rotateAnimation = new RotateAnimation(0, 360,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f,
@@ -689,8 +732,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
currentGiftInfoList = nobleGiftInfos; currentGiftInfoList = nobleGiftInfos;
} else if (position == GiftIndicator.TYPE_NORMAL) { } else if (position == GiftIndicator.TYPE_NORMAL) {
currentGiftInfoList = getNormalGiftInfos(); currentGiftInfoList = getNormalGiftInfos();
} else if (position == GiftIndicator.TYPE_LUCKY) {
currentGiftInfoList = getLuckyGiftInfos();
} else if (position == GiftIndicator.TYPE_WEEK) { } else if (position == GiftIndicator.TYPE_WEEK) {
currentGiftInfoList = getWeekStarGiftInfos(); currentGiftInfoList = getWeekStarGiftInfos();
} else if (position == GiftIndicator.TYPE_DRAW_GIFT) { } else if (position == GiftIndicator.TYPE_DRAW_GIFT) {
@@ -699,6 +740,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
currentGiftInfoList = getSingleRoomGiftInfos(); currentGiftInfoList = getSingleRoomGiftInfos();
} else if (position == GiftIndicator.TYPE_PENALTY) { } else if (position == GiftIndicator.TYPE_PENALTY) {
currentGiftInfoList = getPenaltyGiftInfos(); currentGiftInfoList = getPenaltyGiftInfos();
} else if (position == GiftIndicator.TYPE_INTEREST) {
currentGiftInfoList = getInterestGiftInfos();
} }
//是否背包礼物 //是否背包礼物
final boolean isKnap = (position == GiftIndicator.TYPE_KNAP); final boolean isKnap = (position == GiftIndicator.TYPE_KNAP);
@@ -755,7 +798,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
} else if (isKnap) { } else if (isKnap) {
giftIndicator.getBackpackValueView().setVisibility(View.VISIBLE); giftIndicator.getBackpackValueView().setVisibility(View.VISIBLE);
showEmptyView(); showEmptyView();
} else if (position == GiftIndicator.TYPE_LUCKY || } else if (position == GiftIndicator.TYPE_INTEREST ||
position == GiftIndicator.TYPE_WEEK || position == GiftIndicator.TYPE_WEEK ||
position == GiftIndicator.TYPE_DRAW_GIFT || position == GiftIndicator.TYPE_DRAW_GIFT ||
position == GiftIndicator.TYPE_SING_ROOM || position == GiftIndicator.TYPE_SING_ROOM ||
@@ -824,6 +867,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
updateWeekStarDesc(); updateWeekStarDesc();
isShowDrawGiftModel = false; isShowDrawGiftModel = false;
updateDrawGift(); updateDrawGift();
updateUnLockTips();
updateDressUpTips();
} }
/** /**
@@ -877,6 +922,24 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
privilegeView.setAdapter(baseQuickAdapter); privilegeView.setAdapter(baseQuickAdapter);
} }
private void updateUnLockTips() {
unLockPanel.update(currentGiftInfo);
}
private void updateDressUpTips() {
if (currentGiftInfo == null || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_DRESS_UP) {
dressUpBannerView.setVisibility(View.GONE);
return;
}
String banner = currentGiftInfo.getBannerUrl();
if (banner == null || banner.length() == 0) {
dressUpBannerView.setVisibility(View.GONE);
return;
}
dressUpBannerView.setVisibility(View.VISIBLE);
ImageLoadUtils.loadImage(dressUpBannerView, banner, UIUtil.dip2px(context, 8));
}
private void updateLuckyBagIntro() { private void updateLuckyBagIntro() {
if (luckyMsgDisposable != null) luckyMsgDisposable.dispose(); if (luckyMsgDisposable != null) luckyMsgDisposable.dispose();
if (currentGiftInfo == null || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_LUCKY) { if (currentGiftInfo == null || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_LUCKY) {
@@ -908,11 +971,14 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
.flatMap(luckyBagNoticeInfos -> Observable.intervalRange(0, Integer.MAX_VALUE, 0, 5, TimeUnit.SECONDS)) .flatMap(luckyBagNoticeInfos -> Observable.intervalRange(0, Integer.MAX_VALUE, 0, 5, TimeUnit.SECONDS))
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(aLong -> { .subscribe(aLong -> {
int index = aLong.intValue() % luckyMsgAdapter.getItemCount(); int count = luckyMsgAdapter.getItemCount();
if (index == 0) { if (count > 0) {
rvLuckyMsg.scrollToPosition(index); int index = aLong.intValue() % count;
} else { if (index == 0) {
rvLuckyMsg.smoothScrollToPosition(index); rvLuckyMsg.scrollToPosition(index);
} else {
rvLuckyMsg.smoothScrollToPosition(index);
}
} }
}); });
} }
@@ -1130,7 +1196,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
layoutEmpty.setVisibility(View.GONE); layoutEmpty.setVisibility(View.GONE);
gridView.setVisibility(View.VISIBLE); gridView.setVisibility(View.VISIBLE);
SparseArray<RecyclerViewNoViewpagerScroll> cacheItemView = new SparseArray<>();
lastSelectedItem = pagerList.get(defaultSelectPage).get(defaultSelectItem); lastSelectedItem = pagerList.get(defaultSelectPage).get(defaultSelectItem);
setGoldOrRadishText(lastSelectedItem); setGoldOrRadishText(lastSelectedItem);
gridView.setAdapter(new PagerAdapter() { gridView.setAdapter(new PagerAdapter() {
@@ -1166,22 +1231,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
giftAdapter.addData(pagerList.get(pagePos)); giftAdapter.addData(pagerList.get(pagePos));
giftAdapter.setOnItemClickListener(item -> { giftAdapter.setOnItemClickListener(item -> {
if (item.data.isSendMsg()) { onGiftClick(item);
etSendMessage.setVisibility(View.VISIBLE);
} else {
etSendMessage.setVisibility(View.GONE);
}
if (lastSelectedItem != null) {
lastSelectedItem.isSelect.set(false);
}
item.isSelect.set(true);
lastSelectedItem = item;
currentGiftInfo = item.data;
setGoldOrRadishText(lastSelectedItem);
updateLuckyBagIntro();
updateWeekStarDesc();
isShowDrawGiftModel = true;
updateDrawGift();
}); });
container.addView(recyclerView); container.addView(recyclerView);
return recyclerView; return recyclerView;
@@ -1198,6 +1248,27 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
gridView.setCurrentItem(defaultSelectPage); gridView.setCurrentItem(defaultSelectPage);
} }
private void onGiftClick(GiftInfoVm item) {
if (item.data.isSendMsg()) {
etSendMessage.setVisibility(View.VISIBLE);
} else {
etSendMessage.setVisibility(View.GONE);
}
if (lastSelectedItem != null) {
lastSelectedItem.isSelect.set(false);
}
item.isSelect.set(true);
lastSelectedItem = item;
currentGiftInfo = item.data;
setGoldOrRadishText(lastSelectedItem);
updateLuckyBagIntro();
updateWeekStarDesc();
isShowDrawGiftModel = true;
updateDrawGift();
updateUnLockTips();
updateDressUpTips();
}
private List<GiftInfo> loadGiftInfoList() { private List<GiftInfo> loadGiftInfoList() {
List<GiftInfo> giftInfos; List<GiftInfo> giftInfos;
String roomUid = null; String roomUid = null;
@@ -1237,12 +1308,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
GiftType.GIFT_TYPE_WEEK_STAR); GiftType.GIFT_TYPE_WEEK_STAR);
} }
private List<GiftInfo> getLuckyGiftInfos() {
return GiftModel.get().getGiftInfosByType(
String.valueOf(AvRoomDataManager.get().getRoomUid()),
GiftType.GIFT_TYPE_LUCKY);
}
private List<GiftInfo> getDrawGiftInfos() { private List<GiftInfo> getDrawGiftInfos() {
return GiftModel.get().getGiftInfosByType( return GiftModel.get().getGiftInfosByType(
String.valueOf(AvRoomDataManager.get().getRoomUid()), String.valueOf(AvRoomDataManager.get().getRoomUid()),
@@ -1261,6 +1326,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
GiftType.GIFT_TYPE_PENALTY); GiftType.GIFT_TYPE_PENALTY);
} }
private List<GiftInfo> getInterestGiftInfos() {
return GiftModel.get().getGiftInfosByType(
String.valueOf(AvRoomDataManager.get().getRoomUid()),
GiftType.GIFT_TYPE_INTEREST);
}
private List<GiftInfo> getNobleGiftInfos() { private List<GiftInfo> getNobleGiftInfos() {
return GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_VIP); return GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_VIP);
} }
@@ -1293,6 +1364,14 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { switch (v.getId()) {
case R.id.iv_dress_up_banner:
if (currentGiftInfo != null) {
String skipUrl = currentGiftInfo.getBannerSkipUrl();
if (skipUrl != null) {
CommonWebViewActivity.start(context, skipUrl);
}
}
break;
case R.id.ll_gold: case R.id.ll_gold:
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_GIFT_PANEL_TO_RECHARGE, "礼物面板_去充值:" + GIFT_DIALOG_FROM); StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_GIFT_PANEL_TO_RECHARGE, "礼物面板_去充值:" + GIFT_DIALOG_FROM);
ChargeDialog.start(getContext()); ChargeDialog.start(getContext());
@@ -1326,10 +1405,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
micMemberInfo.setAccount(String.valueOf(uid)); micMemberInfo.setAccount(String.valueOf(uid));
targetUids.add(micMemberInfo); targetUids.add(micMemberInfo);
Log.e(TAG, "onClick: indicator type: " + giftIndicator.getCurrrentType()); Log.e(TAG, "onClick: indicator type: " + giftIndicator.getCurrrentType());
int number = giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber;
giftDialogBtnClickListener.onSendGiftBtnClick( giftDialogBtnClickListener.onSendGiftBtnClick(
finalCurrentGiftInfo, finalCurrentGiftInfo,
targetUids, targetUids,
giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber, number,
giftMessage, giftMessage,
giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP, giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP,
false, false,
@@ -1337,7 +1417,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
new SenGiftCallback() { new SenGiftCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
onSendGiftSuccess(finalCurrentGiftInfo); onSendGiftSuccess(finalCurrentGiftInfo, number, targetUids);
} }
@Override @Override
@@ -1356,10 +1436,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
micMemberInfo.setAccount(String.valueOf(uid)); micMemberInfo.setAccount(String.valueOf(uid));
targetUids.add(micMemberInfo); targetUids.add(micMemberInfo);
Log.e(TAG, "onClick: indicator type: " + giftIndicator.getCurrrentType()); Log.e(TAG, "onClick: indicator type: " + giftIndicator.getCurrrentType());
int number = giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber;
giftDialogBtnClickListener.onSendGiftBtnClick( giftDialogBtnClickListener.onSendGiftBtnClick(
finalCurrentGiftInfo, finalCurrentGiftInfo,
targetUids, targetUids,
giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber, number,
giftMessage, giftMessage,
giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP, giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP,
false, false,
@@ -1367,7 +1448,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
new SenGiftCallback() { new SenGiftCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
onSendGiftSuccess(finalCurrentGiftInfo); onSendGiftSuccess(finalCurrentGiftInfo, number, targetUids);
} }
@Override @Override
@@ -1388,10 +1469,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
sendGiftButton.setEnabled(true); sendGiftButton.setEnabled(true);
return; return;
} }
int number = giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber;
giftDialogBtnClickListener.onSendGiftBtnClick( giftDialogBtnClickListener.onSendGiftBtnClick(
finalCurrentGiftInfo, finalCurrentGiftInfo,
selectedMembers, selectedMembers,
giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber, number,
giftMessage, giftMessage,
giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP, giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP,
avatarListAdapter.getSelectType() == GiftAvatarAdapter.SELECT_TYPE_WHOLE_MIC, avatarListAdapter.getSelectType() == GiftAvatarAdapter.SELECT_TYPE_WHOLE_MIC,
@@ -1399,7 +1481,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
new SenGiftCallback() { new SenGiftCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
onSendGiftSuccess(finalCurrentGiftInfo); onSendGiftSuccess(finalCurrentGiftInfo, number, selectedMembers);
} }
@Override @Override
@@ -1511,11 +1593,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
tvTabInteraction.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); tvTabInteraction.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT); giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT);
giftIndicator.hidePosition(GiftIndicator.TYPE_PENALTY); giftIndicator.hidePosition(GiftIndicator.TYPE_PENALTY);
giftIndicator.showPosition(GiftIndicator.TYPE_LUCKY);
giftIndicator.showPosition(GiftIndicator.TYPE_NOBLE); giftIndicator.showPosition(GiftIndicator.TYPE_NOBLE);
giftIndicator.showPosition(GiftIndicator.TYPE_WEEK); giftIndicator.showPosition(GiftIndicator.TYPE_WEEK);
giftIndicator.showPosition(GiftIndicator.TYPE_NORMAL); giftIndicator.showPosition(GiftIndicator.TYPE_NORMAL);
giftIndicator.showPosition(GiftIndicator.TYPE_PRIVILEGE); giftIndicator.showPosition(GiftIndicator.TYPE_PRIVILEGE);
giftIndicator.showPosition(GiftIndicator.TYPE_INTEREST);
if (AvRoomDataManager.get().isSingleRoom()) { if (AvRoomDataManager.get().isSingleRoom()) {
giftIndicator.showPosition(GiftIndicator.TYPE_SING_ROOM); giftIndicator.showPosition(GiftIndicator.TYPE_SING_ROOM);
} else { } else {
@@ -1539,18 +1621,18 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
giftIndicator.showPosition(GiftIndicator.TYPE_DRAW_GIFT); giftIndicator.showPosition(GiftIndicator.TYPE_DRAW_GIFT);
giftIndicator.showPosition(GiftIndicator.TYPE_PENALTY); giftIndicator.showPosition(GiftIndicator.TYPE_PENALTY);
giftIndicator.hidePosition(GiftIndicator.TYPE_LUCKY);
giftIndicator.hidePosition(GiftIndicator.TYPE_NOBLE); giftIndicator.hidePosition(GiftIndicator.TYPE_NOBLE);
giftIndicator.hidePosition(GiftIndicator.TYPE_WEEK); giftIndicator.hidePosition(GiftIndicator.TYPE_WEEK);
giftIndicator.hidePosition(GiftIndicator.TYPE_NORMAL); giftIndicator.hidePosition(GiftIndicator.TYPE_NORMAL);
giftIndicator.hidePosition(GiftIndicator.TYPE_SING_ROOM); giftIndicator.hidePosition(GiftIndicator.TYPE_SING_ROOM);
giftIndicator.hidePosition(GiftIndicator.TYPE_PRIVILEGE); giftIndicator.hidePosition(GiftIndicator.TYPE_PRIVILEGE);
giftIndicator.hidePosition(GiftIndicator.TYPE_INTEREST);
giftIndicator.setPosition(GiftIndicator.TYPE_DRAW_GIFT); giftIndicator.setPosition(GiftIndicator.TYPE_DRAW_GIFT);
updateGiftView(giftIndicator.getCurrrentType()); updateGiftView(giftIndicator.getCurrrentType());
} }
private void onSendGiftSuccess(GiftInfo giftInfo) { private void onSendGiftSuccess(GiftInfo giftInfo, int giftNumber, List<MicMemberInfo> receiveUsers) {
if (sendGiftButton == null) return; if (sendGiftButton == null) return;
sendGiftButton.setText("赠送"); sendGiftButton.setText("赠送");
sendGiftButton.setEnabled(true); sendGiftButton.setEnabled(true);
@@ -1558,6 +1640,65 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
SingleToastUtil.showToast("发送涂鸦礼物:" + giftInfo.getGiftName() + "成功"); SingleToastUtil.showToast("发送涂鸦礼物:" + giftInfo.getGiftName() + "成功");
clearDrawGift(); clearDrawGift();
dismiss(); dismiss();
} else if (giftInfo.getGiftType() == GiftType.GIFT_TYPE_UNLOCK) {
int totalNumber = 0;
if (receiveUsers != null) {
totalNumber = receiveUsers.size() * giftNumber;
}
updateUnlockStateSendSuccess(giftInfo, totalNumber);
}
}
// 更新本地解锁礼物的数据状态(解锁状态、送出的数量)
private void updateUnlockStateSendSuccess(GiftInfo giftInfo, int totalNumber) {
if (giftInfo.getGiftType() != GiftType.GIFT_TYPE_UNLOCK) {
return;
}
GiftInfo baseGift = giftInfo.getBaseGift();
if (baseGift == null || baseGift.getGiftId() != giftInfo.getGiftId()) {
// 不是基础礼物
return;
}
// 先更新数据
updateUnlockGiftDataState(giftInfo.getGiftId(), totalNumber);
// 后更新UI
updateUnlockGiftUiState(giftInfo.getGiftId());
// 更新提示面板UI
unLockPanel.refreshState();
}
// 更新解锁礼物数据状态
private void updateUnlockGiftDataState(int giftId, int number) {
List<GiftInfo> panelGiftList = GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_UNLOCK);
if (panelGiftList == null) {
return;
}
for (GiftInfo item : panelGiftList) {
if (item.getGiftType() != GiftType.GIFT_TYPE_UNLOCK) {
continue;
}
if (item.getBaseGift() == null || item.getBaseGift().getGiftId() != giftId) {
continue;
}
item.updateUnlockProgress(number);
}
}
// 更新解锁礼物Ui状态
private void updateUnlockGiftUiState(int giftId) {
if (giftIndicator.getCurrrentType() != GiftIndicator.TYPE_INTEREST) {
return;
}
if (ListUtils.isListEmpty(pagerList)) {
return;
}
for (List<GiftInfoVm> page : pagerList) {
for (GiftInfoVm item : page) {
GiftInfo itemBaseGift = item.data.getBaseGift();
if (itemBaseGift != null && itemBaseGift.getGiftId() == giftId) {
item.refreshUnlockState();
}
}
} }
} }
@@ -1566,9 +1707,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
int currentType = giftIndicator.getCurrrentType(); int currentType = giftIndicator.getCurrrentType();
switch (currentType) { switch (currentType) {
case GiftIndicator.TYPE_NORMAL: case GiftIndicator.TYPE_NORMAL:
case GiftIndicator.TYPE_LUCKY:
case GiftIndicator.TYPE_NOBLE: case GiftIndicator.TYPE_NOBLE:
case GiftIndicator.TYPE_WEEK: case GiftIndicator.TYPE_WEEK:
case GiftIndicator.TYPE_INTEREST:
String roomUid = null; String roomUid = null;
if (isInRoom) { if (isInRoom) {
if (AvRoomDataManager.get().getRoomUid() > 0) { if (AvRoomDataManager.get().getRoomUid() > 0) {

View File

@@ -0,0 +1,120 @@
package com.nnbc123.app.ui.widget
import android.view.View
import android.widget.ImageView
import android.widget.ProgressBar
import android.widget.TextView
import androidx.core.view.isVisible
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chuhai.utils.ktx.getColorById
import com.chuhai.utils.spannable.SpannableTextBuilder
import com.nnbc123.app.R
import com.nnbc123.app.ui.utils.load
import com.nnbc123.core.gift.bean.GiftInfo
import com.nnbc123.core.gift.bean.UnLockGiftInfo
import com.nnbc123.core.gift.bean.UnlockItem
/**
* Created by Max on 2024/1/25 19:41
* Desc:
**/
class GiftUnLockInfoAdapter(list: List<UnlockItem>) :
BaseMultiItemQuickAdapter<UnlockItem, BaseViewHolder>(list) {
var selectItemId: Int = -1
private var baseGiftName: String? = null
init {
addItemType(UnlockItem.ITEM_TYPE_BASE, R.layout.gift_dialog_lock_item_basics)
addItemType(UnlockItem.ITEM_TYPE_CHILD, R.layout.gift_dialog_lock_item_child)
}
override fun convertPayloads(
helper: BaseViewHolder,
item: UnlockItem?,
payloads: MutableList<Any>
) {
super.convertPayloads(helper, item, payloads)
if (item?.itemType == UnlockItem.ITEM_TYPE_CHILD) {
convertChildState(helper, item)
}
}
override fun convert(helper: BaseViewHolder, item: UnlockItem?) {
val giftInfo = item?.getGiftData()
when (item?.itemType) {
UnlockItem.ITEM_TYPE_BASE -> {
if (giftInfo?.giftId == selectItemId) {
helper.setBackgroundRes(
R.id.layout_root,
R.drawable.gift_dialog_bg_lock_item_selected
)
} else {
helper.setBackgroundRes(R.id.layout_root, R.drawable.shape_14ffffff_4dp)
}
helper.getView<ImageView>(R.id.iv_cover).load(giftInfo?.giftUrl)
helper.setText(R.id.tv_name, giftInfo?.giftName ?: "")
helper.setText(R.id.tv_amount, giftInfo?.goldPrice?.toString() ?: "")
}
UnlockItem.ITEM_TYPE_CHILD -> {
if (giftInfo?.giftId == selectItemId) {
helper.setBackgroundRes(
R.id.layout_root,
R.drawable.gift_dialog_bg_lock_item_selected
)
} else {
helper.setBackgroundRes(R.id.layout_root, R.drawable.shape_14ffffff_4dp)
}
var unlockItem: UnLockGiftInfo? = null
if (item is UnLockGiftInfo) {
unlockItem = item
}
val total = unlockItem?.condition ?: 0
helper.getView<ImageView>(R.id.iv_cover).load(giftInfo?.giftUrl)
val nameView = helper.getView<TextView>(R.id.tv_name)
SpannableTextBuilder(nameView)
.appendText("送出")
.appendText(
" ${total}",
textColor = nameView.context.getColorById(R.color.color_FFDA24)
)
.appendText("${baseGiftName ?: ""}可解锁").apply()
convertChildState(helper, item)
}
}
}
private fun convertChildState(helper: BaseViewHolder, item: UnlockItem?) {
var unlockItem: UnLockGiftInfo? = null
if (item is UnLockGiftInfo) {
unlockItem = item
}
val total = unlockItem?.condition ?: 0
val progress = (unlockItem?.process ?: 0).coerceAtMost(total)
val progressBar = helper.getView<ProgressBar>(R.id.progress_bar)
progressBar.max = total
progressBar.progress = progress
helper.setText(R.id.tv_count, "$progress/$total")
val lockIconView = helper.getView<View>(R.id.iv_lock)
val alpha: Float
if (unlockItem?.unlocked == true) {
alpha = 1f
lockIconView.isVisible = false
} else {
alpha = 0.5f
lockIconView.isVisible = true
}
helper.setAlpha(R.id.tv_name, alpha)
helper.setAlpha(R.id.iv_cover, alpha)
helper.setAlpha(R.id.tv_count, alpha)
helper.setAlpha(R.id.progress_bar, alpha)
}
fun setNewData(baseGiftInfo: GiftInfo?, data: MutableList<UnlockItem>?) {
this.baseGiftName = baseGiftInfo?.giftName
super.setNewData(data)
}
}

View File

@@ -80,7 +80,11 @@ public class GiftIndicator extends LinearLayout {
*/ */
public static final int TYPE_PRIVILEGE = 8; public static final int TYPE_PRIVILEGE = 8;
private Map<String, String> map = new HashMap<>(); /**
* 趣味(福袋礼物、解锁礼物、装扮礼物)
*/
public static final int TYPE_INTEREST = 9;
private List<GiftTab> tabList = new ArrayList<>(); private List<GiftTab> tabList = new ArrayList<>();
private int currrentType = TYPE_NORMAL; private int currrentType = TYPE_NORMAL;
@@ -143,10 +147,17 @@ public class GiftIndicator extends LinearLayout {
index.getItemView().setOnClickListener(v -> { index.getItemView().setOnClickListener(v -> {
setPosition(index.getType()); setPosition(index.getType());
emitter.onNext(index.getType()); emitter.onNext(index.getType());
if (index.isNeedNewTips()) {
View view = index.getItemView().findViewById(R.id.tv_new_tag);
if (view.getVisibility() == VISIBLE) {
view.setVisibility(GONE);
DemoCache.saveNewGiftTypeTip(index.getType(), false);
}
}
if (index.getType() == TYPE_PENALTY) { if (index.getType() == TYPE_PENALTY) {
ImageView imageView = index.getItemView().findViewById(R.id.iv_new_tag); View view = index.getItemView().findViewById(R.id.tv_new_tag);
if (imageView.getVisibility() == VISIBLE) { if (view.getVisibility() == VISIBLE) {
imageView.setVisibility(GONE); view.setVisibility(GONE);
DemoCache.saveNewGiftTypeTip(false); DemoCache.saveNewGiftTypeTip(false);
} }
} else if (index.getType() == TYPE_KNAP) { } else if (index.getType() == TYPE_KNAP) {
@@ -186,10 +197,16 @@ public class GiftIndicator extends LinearLayout {
for (GiftTab tab : tabList) { for (GiftTab tab : tabList) {
if (tab.getType() == type) { if (tab.getType() == type) {
tab.getItemView().setVisibility(VISIBLE); tab.getItemView().setVisibility(VISIBLE);
if (tab.isNeedNewTips()) {
if (DemoCache.readNewGiftTypeTip(tab.getType())) {
View view = tab.getItemView().findViewById(R.id.tv_new_tag);
view.setVisibility(VISIBLE);
}
}
if (type == TYPE_PENALTY) { if (type == TYPE_PENALTY) {
if (DemoCache.readNewGiftTypeTip()) { if (DemoCache.readNewGiftTypeTip()) {
ImageView imageView = tab.getItemView().findViewById(R.id.iv_new_tag); View view = tab.getItemView().findViewById(R.id.tv_new_tag);
imageView.setVisibility(VISIBLE); view.setVisibility(VISIBLE);
} }
} }
break; break;

View File

@@ -112,7 +112,7 @@ public class LinePagerIndicator extends View implements IPagerIndicator {
@Override @Override
public void onPageSelected(int position) { public void onPageSelected(int position) {
onPageScrolled(position,0,0); // onPageScrolled(position,0,0);
} }
@Override @Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -4,8 +4,8 @@
<gradient <gradient
android:angle="180" android:angle="180"
android:endColor="@color/color_218eff" android:endColor="#FFDA24"
android:startColor="@color/color_7727e4" android:startColor="#FFDA24"
android:type="linear" android:type="linear"
android:useLevel="true" /> android:useLevel="true" />
<corners android:radius="100dp" /> <corners android:radius="100dp" />

View File

@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true"> <item android:state_enabled="true">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="#FFE710" /> <solid android:color="#FFDA24" />
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="100dp" /> <corners android:bottomLeftRadius="0dp" android:bottomRightRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="100dp" />
</shape> </shape>
</item> </item>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#14FFFFFF" />
<corners android:radius="4dp" />
<stroke
android:width="0.5dp"
android:color="#FFDA24" />
</shape>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="8dp"
android:height="8dp"
android:viewportWidth="8"
android:viewportHeight="8">
<path
android:pathData="M6.512,4.3904L2.8123,7.3501C2.5967,7.5226 2.2821,7.4877 2.1096,7.272C2.0386,7.1834 2,7.0732 2,6.9597L2,1.0403C2,0.7642 2.2239,0.5403 2.5,0.5403C2.6135,0.5403 2.7237,0.579 2.8123,0.6499L6.512,3.6096C6.7276,3.7821 6.7625,4.0967 6.59,4.3123C6.567,4.3412 6.5408,4.3674 6.512,4.3904Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="10dp"
android:height="10dp"
android:viewportWidth="10"
android:viewportHeight="10">
<path
android:pathData="M5.384,2.461L9.317,7.18C9.493,7.392 9.465,7.707 9.253,7.884C9.163,7.959 9.049,8 8.932,8L1.068,8C0.791,8 0.568,7.776 0.568,7.5C0.568,7.383 0.609,7.27 0.683,7.18L4.616,2.461C4.793,2.249 5.108,2.22 5.32,2.397C5.343,2.416 5.365,2.438 5.384,2.461Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
</vector>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="9dp"
android:height="9dp"
android:viewportWidth="9"
android:viewportHeight="9">
<path
android:pathData="M6.4687,2.7063L2.5313,2.7063C1.531,2.7063 0.72,3.5172 0.72,4.5176L0.72,7.0987C0.72,8.099 1.531,8.91 2.5313,8.91L6.4687,8.91C7.469,8.91 8.28,8.099 8.28,7.0987L8.28,4.5176C8.28,3.5172 7.469,2.7063 6.4687,2.7063ZM4.9529,5.8622L4.9529,7.0909C4.9529,7.348 4.7503,7.5566 4.5,7.5566C4.2498,7.5566 4.0471,7.348 4.0471,7.0909L4.0471,5.8622C3.7766,5.7012 3.5942,5.4009 3.5942,5.0563C3.5942,4.5419 3.9997,4.125 4.5,4.125C5.0003,4.125 5.4059,4.5419 5.4059,5.0563C5.4059,5.4009 5.2236,5.7012 4.9529,5.8622ZM4.5076,0.09C3.106,0.09 1.9696,1.242 1.9696,2.7555L1.9696,4.1615L7.0458,4.1615L7.0458,2.7555C7.0458,1.242 5.9094,0.09 4.5076,0.09ZM2.9572,3.507L2.9572,2.5441C2.9572,1.6578 3.6561,0.9391 4.5182,0.9391C5.3804,0.9391 6.0792,1.6578 6.0792,2.5441L6.0792,3.5296L2.9572,3.507Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
</vector>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 定义轨道的背景 -->
<item android:id="@android:id/background">
<shape android:shape="rectangle">
<solid android:color="#696D7A" />
<corners android:radius="3dp" />
</shape>
</item>
<!-- 定义轨道上已完成部分的样式 -->
<item android:id="@android:id/progress">
<scale android:scaleWidth="100%">
<shape android:shape="rectangle">
<solid android:color="#FFDA24" />
<corners android:radius="3dp" />
</shape>
</scale>
</item>
</layer-list>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<solid android:color="#14FFFFFF" />
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="6dp"/>
<solid android:color="#FFFF425B"/>
</shape>

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white_tran_10" />
<stroke
android:width="1px"
android:color="@color/white_transparent_40" />
<corners android:radius="12dp" />
</shape>

View File

@@ -2,12 +2,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke <stroke
android:width="1dp" android:width="1dp"
android:color="#FFE710" android:color="#FFDA24"
/> />
<solid <solid
android:color="@color/transparent" android:color="@color/transparent"
/> />
<corners <corners
android:radius="50dp" android:radius="16dp"
/> />
</shape> </shape>

View File

@@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M6,6m-5.5,0a5.5,5.5 0,1 1,11 0a5.5,5.5 0,1 1,-11 0"
android:strokeWidth="1"
android:fillColor="#00000000"
android:strokeColor="#A2A7B8"
android:fillType="evenOdd"/>
<path
android:pathData="M6.11,2.52C5.37,2.52 4.79,2.73 4.36,3.15C3.92,3.57 3.71,4.15 3.71,4.89L4.85,4.89C4.85,4.47 4.93,4.14 5.1,3.91C5.29,3.63 5.6,3.5 6.04,3.5C6.38,3.5 6.65,3.59 6.84,3.78C7.02,3.97 7.12,4.23 7.12,4.56C7.12,4.81 7.03,5.05 6.85,5.27L6.73,5.41C6.08,5.99 5.69,6.41 5.56,6.68C5.42,6.95 5.36,7.28 5.36,7.66L5.36,7.8L6.51,7.8L6.51,7.66C6.51,7.42 6.56,7.21 6.66,7.01C6.75,6.83 6.88,6.66 7.06,6.51C7.54,6.09 7.83,5.82 7.92,5.72C8.16,5.4 8.29,4.99 8.29,4.49C8.29,3.88 8.09,3.4 7.69,3.05C7.29,2.69 6.76,2.52 6.11,2.52ZM5.93,8.29C5.71,8.29 5.53,8.36 5.38,8.5C5.23,8.64 5.16,8.82 5.16,9.04C5.16,9.26 5.23,9.44 5.38,9.58C5.53,9.72 5.71,9.8 5.93,9.8C6.15,9.8 6.33,9.73 6.48,9.59C6.63,9.45 6.71,9.26 6.71,9.04C6.71,8.82 6.63,8.64 6.49,8.5C6.34,8.36 6.15,8.29 5.93,8.29Z"
android:strokeWidth="1"
android:fillColor="#A2A7B8"
android:fillType="nonZero"
android:strokeColor="#00000000"/>
</vector>

View File

@@ -4,15 +4,20 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/bg_normal_1c1b22" android:background="#F8F8FB"
android:orientation="vertical"> android:orientation="vertical">
<com.nnbc123.app.base.TitleBar <FrameLayout
android:id="@+id/title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30" /> android:background="@color/color_white">
<com.nnbc123.app.base.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30" />
</FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/fl_roll_view" android:id="@+id/fl_roll_view"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -35,8 +40,7 @@
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator <com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
android:id="@+id/view_indicator" android:id="@+id/view_indicator"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="46dp" />
android:layout_marginTop="@dimen/dp_10" />
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager" android:id="@+id/viewpager"
@@ -47,19 +51,19 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:baselineAligned="true"
android:background="@color/white" android:background="@color/white"
android:baselineAligned="true"
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:drawableStart="@drawable/ic_charge_diamond" android:drawableStart="@drawable/ic_charge_diamond"
android:drawablePadding="3dp" android:drawablePadding="3dp"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="我的钻石" android:text="我的钻石"
android:layout_marginStart="15dp"
android:textColor="@color/color_999999" android:textColor="@color/color_999999"
android:textSize="12sp" /> android:textSize="12sp" />
@@ -67,9 +71,9 @@
android:id="@+id/tv_diamond_num" android:id="@+id/tv_diamond_num"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="0"
android:includeFontPadding="false"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:includeFontPadding="false"
android:text="0"
android:textColor="#ffffbc51" android:textColor="#ffffbc51"
android:textSize="16sp" /> android:textSize="16sp" />
@@ -82,10 +86,10 @@
android:id="@+id/tv_charge" android:id="@+id/tv_charge"
android:layout_width="72dp" android:layout_width="72dp"
android:layout_height="24dp" android:layout_height="24dp"
android:text="充值" android:layout_marginEnd="15dp"
android:background="@drawable/bg_common_confirm" android:background="@drawable/bg_common_confirm"
android:gravity="center" android:gravity="center"
android:layout_marginEnd="15dp" android:text="充值"
android:textColor="@color/text_normal_282828" android:textColor="@color/text_normal_282828"
android:textSize="12sp" /> android:textSize="12sp" />

View File

@@ -10,19 +10,28 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/bg_normal_1c1b22"> android:background="#F8F8FB">
<com.nnbc123.app.base.TitleBar
android:id="@+id/title_bar" <FrameLayout
android:id="@+id/layout_title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30" /> android:background="@color/color_white">
<com.nnbc123.app.base.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30" />
</FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/fl_roll_view" android:id="@+id/fl_roll_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/title_bar" android:layout_below="@+id/layout_title_bar"
app:layout_constraintEnd_toEndOf="parent"> app:layout_constraintEnd_toEndOf="parent">
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView <com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
@@ -37,13 +46,11 @@
tools:visibility="visible" /> tools:visibility="visible" />
</FrameLayout> </FrameLayout>
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator <com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
android:id="@+id/view_indicator" android:id="@+id/view_indicator"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="46dp"
android:layout_below="@+id/fl_roll_view" android:layout_below="@+id/fl_roll_view" />
android:layout_marginTop="@dimen/dp_10" />
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager" android:id="@+id/viewpager"

View File

@@ -545,7 +545,6 @@
android:id="@+id/view_pager" android:id="@+id/view_pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="@dimen/dp_60"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -6,6 +6,36 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"> android:layout_gravity="bottom">
<ImageView
android:id="@+id/iv_dress_up_banner"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="6dp"
android:layout_marginBottom="5dp"
android:scaleType="centerCrop"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
app:layout_constraintDimensionRatio="363:44"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:visibility="visible" />
<com.nnbc123.app.ui.widget.GIftDialogUnlockPanel
android:id="@+id/panel_unlock"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_marginHorizontal="6dp"
android:layout_marginBottom="5dp"
android:visibility="gone"
app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="10dp"
app:cardElevation="0px"
app:cardMaxElevation="0px"
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:visibility="visible"/>
<FrameLayout <FrameLayout
android:id="@+id/fl_lucky_desc" android:id="@+id/fl_lucky_desc"
android:layout_width="0dp" android:layout_width="0dp"
@@ -381,9 +411,8 @@
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator <com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
android:id="@+id/gift_indicator" android:id="@+id/gift_indicator"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="34dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@@ -394,7 +423,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/rl_gifts" android:id="@+id/rl_gifts"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="261dp" android:layout_height="222dp"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="@dimen/dp_10"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@@ -534,7 +563,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/layout_recharge" android:id="@+id/layout_recharge"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_50" android:layout_height="40dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_gift_message"> app:layout_constraintTop_toBottomOf="@id/et_gift_message">
@@ -542,9 +571,9 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_gold" android:id="@+id/ll_gold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="32dp" android:layout_height="30dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="15dp" android:layout_marginStart="13dp"
android:background="@drawable/shape_black_solid_round" android:background="@drawable/shape_black_solid_round"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingStart="9dp" android:paddingStart="9dp"
@@ -554,8 +583,8 @@
android:id="@+id/tv_text_gold" android:id="@+id/tv_text_gold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_gift_diamond" android:drawableStart="@drawable/gift_dialog_ic_diamond_14"
android:drawablePadding="3dp" android:drawablePadding="2dp"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="0" android:text="0"
@@ -564,22 +593,21 @@
<ImageView <ImageView
android:id="@+id/tv_recharge" android:id="@+id/tv_recharge"
android:layout_width="15dp" android:layout_width="8dp"
android:layout_height="15dp" android:layout_height="8dp"
android:layout_marginStart="7dp" android:layout_marginStart="5dp"
android:drawablePadding="@dimen/dp_5"
android:gravity="center" android:gravity="center"
android:src="@drawable/ic_arrow_recharge_white" /> android:src="@drawable/gift_dialog_ic_arrow_white_right" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/send_container" android:id="@+id/send_container"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/dp_30" android:layout_height="30dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="15dp" android:layout_marginRight="13dp"
android:background="@drawable/shape_room_bg_send" android:background="@drawable/shape_room_bg_send"
android:orientation="horizontal"> android:orientation="horizontal">
@@ -605,7 +633,7 @@
android:layout_width="@dimen/dp_10" android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_10" android:layout_height="@dimen/dp_10"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:src="@drawable/icon_room_send_arrow_white" /> android:src="@drawable/gift_dialog_ic_arrow_white_up" />
</LinearLayout> </LinearLayout>
@@ -616,7 +644,7 @@
android:background="@drawable/bg_magic_dialog_button_send" android:background="@drawable/bg_magic_dialog_button_send"
android:text="赠送" android:text="赠送"
android:textColor="@color/text_normal_282828" android:textColor="@color/text_normal_282828"
android:textSize="@dimen/sp_15" /> android:textSize="13dp" />
</LinearLayout> </LinearLayout>
@@ -625,7 +653,7 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cs_privilege" android:id="@+id/cs_privilege"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="40dp"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View File

@@ -325,6 +325,7 @@
android:layout_width="@dimen/dp_10" android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_10" android:layout_height="@dimen/dp_10"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:rotation="180"
android:src="@drawable/icon_room_send_arrow" /> android:src="@drawable/icon_room_send_arrow" />
</LinearLayout> </LinearLayout>

View File

@@ -15,7 +15,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false" android:clipToPadding="false"
android:paddingStart="14dp" android:paddingStart="14dp"
android:paddingTop="15dp" android:paddingTop="10dp"
android:paddingEnd="14dp" /> android:paddingEnd="14dp" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -11,11 +11,10 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_gift" android:id="@+id/rv_gift"
android:layout_marginTop="6dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingStart="12dp" android:layout_marginTop="11.5dp"
android:paddingEnd="12dp" /> android:paddingHorizontal="9.5dp" />
</LinearLayout> </LinearLayout>

View File

@@ -2,6 +2,7 @@
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@@ -17,10 +18,10 @@
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:background="@color/white" android:background="@color/white"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="@dimen/dp_15" android:paddingLeft="@dimen/dp_13"
android:paddingTop="@dimen/dp_12" android:paddingTop="@dimen/dp_8"
android:paddingRight="@dimen/dp_15" android:paddingRight="@dimen/dp_13"
android:paddingBottom="@dimen/dp_12" android:paddingBottom="@dimen/dp_16"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<TextView <TextView
@@ -28,19 +29,20 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="技能卡" android:text="技能卡"
android:textColor="@color/text_normal_282828" android:textColor="#2B2D33"
android:textSize="@dimen/sp_16" /> android:textSize="@dimen/sp_15"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_skill" android:id="@+id/recycler_skill"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8" android:layout_marginTop="@dimen/dp_8" />
android:layout_marginBottom="8dp" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_gift"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
@@ -50,41 +52,61 @@
app:layout_constraintTop_toBottomOf="@id/ll_skill" app:layout_constraintTop_toBottomOf="@id/ll_skill"
app:layout_constraintVertical_bias="0"> app:layout_constraintVertical_bias="0">
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/tv_gift_detail" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="15dp" android:orientation="horizontal"
android:layout_marginTop="12dp" android:paddingStart="13dp"
android:layout_marginEnd="15dp" android:paddingTop="8dp"
android:includeFontPadding="false" android:paddingEnd="13dp"
android:text="礼物墙" android:paddingBottom="16dp">
android:textColor="@color/text_normal_282828"
android:textSize="@dimen/sp_16" /> <TextView
android:id="@+id/tv_gift_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="礼物墙"
android:textColor="#2B2D33"
android:textSize="@dimen/sp_15"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_gift_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/user_info_ic_help"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:paddingVertical="5dp"
android:text="礼物等级说明"
android:textColor="#A2A7B8"
android:textSize="@dimen/sp_11"
app:layout_constraintBottom_toBottomOf="@id/tv_gift_detail"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_gift_detail" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator <com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
android:id="@+id/magic_indicator_gift" android:id="@+id/magic_indicator_gift"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="25dp" android:layout_height="34dp"
android:layout_gravity="center_horizontal" /> android:layout_gravity="center_horizontal" />
<ImageView
android:id="@+id/iv_more_gift"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="end"
android:layout_marginTop="-25dp"
android:layout_marginEnd="15dp"
android:scaleType="center"
android:src="@drawable/ic_userinfo_arrow_right" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_gift"
android:layout_width="match_parent"
android:layout_height="350dp" />
</LinearLayout> </LinearLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_gift"
android:layout_width="match_parent"
android:layout_height="500dp"
android:background="@color/white"
app:layout_constraintTop_toBottomOf="@id/layout_gift" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:background="@drawable/shape_14ffffff_4dp"
android:paddingStart="3dp"
android:paddingEnd="8dp"
tools:background="@color/black">
<ImageView
android:id="@+id/iv_cover"
android:layout_width="28dp"
android:layout_height="28dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/default_cover" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="10dp"
app:layout_constraintBottom_toTopOf="@id/tv_amount"
app:layout_constraintStart_toEndOf="@id/iv_cover"
app:layout_constraintTop_toTopOf="@id/iv_cover"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Name" />
<TextView
android:id="@+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="#CED1DB"
android:textSize="9dp"
app:layout_constraintBottom_toBottomOf="@id/iv_cover"
app:layout_constraintStart_toEndOf="@id/iv_unit"
app:layout_constraintTop_toBottomOf="@id/tv_name"
tools:text="100" />
<ImageView
android:id="@+id/iv_unit"
android:layout_width="8dp"
android:layout_height="8dp"
android:src="@drawable/gift_dialog_ic_diamond"
app:layout_constraintBottom_toBottomOf="@id/tv_amount"
app:layout_constraintStart_toStartOf="@id/tv_name"
app:layout_constraintTop_toTopOf="@id/tv_amount" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginHorizontal="2dp"
android:background="@drawable/shape_14ffffff_4dp"
android:paddingStart="3dp"
android:paddingEnd="8dp"
tools:background="@color/black">
<ImageView
android:id="@+id/iv_cover"
android:layout_width="28dp"
android:layout_height="28dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/default_cover" />
<ImageView
android:id="@+id/iv_lock"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_marginStart="1dp"
android:layout_marginTop="2dp"
android:scaleType="centerCrop"
android:src="@drawable/gift_dialog_ic_lock"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/default_cover"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="10dp"
app:layout_constraintBottom_toTopOf="@id/tv_count"
app:layout_constraintStart_toEndOf="@id/iv_cover"
app:layout_constraintTop_toTopOf="@id/iv_cover"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Name" />
<TextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="#CED1DB"
android:textSize="9dp"
app:layout_constraintBottom_toBottomOf="@id/iv_cover"
app:layout_constraintStart_toEndOf="@id/progress_bar"
app:layout_constraintTop_toBottomOf="@id/tv_name"
tools:text="1/5" />
<ProgressBar
android:id="@+id/progress_bar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="88dp"
android:layout_height="6dp"
android:max="100"
android:progressDrawable="@drawable/gift_dialog_lock_progress_drawable"
app:layout_constraintBottom_toBottomOf="@id/tv_count"
app:layout_constraintStart_toStartOf="@id/tv_name"
app:layout_constraintTop_toTopOf="@id/tv_count"
tools:progress="20" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:parentTag="androidx.cardview.widget.CardView">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginHorizontal="4dp"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</merge>

View File

@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<variable <variable
name="carInfo" name="carInfo"
type="com.nnbc123.core.decoration.car.bean.CarInfo" /> type="com.nnbc123.core.decoration.car.bean.CarInfo" />
@@ -11,18 +12,17 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="120dp" android:layout_height="120dp"
tools:background="@color/bg_normal_1c1b22" tools:background="@color/bg_normal_1c1b22">
>
<FrameLayout <FrameLayout
android:id="@+id/ll_car_cover" android:id="@+id/ll_car_cover"
android:layout_width="112dp" android:layout_width="112dp"
android:orientation="vertical" android:layout_height="80dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:padding="5dp"
android:background="@drawable/bg_secondary_radius_15" android:background="@drawable/bg_secondary_radius_15"
android:layout_height="80dp" > android:orientation="vertical"
android:padding="5dp">
<ImageView <ImageView
android:id="@+id/iv_car_cover" android:id="@+id/iv_car_cover"
@@ -33,65 +33,67 @@
android:id="@+id/iv_tag" android:id="@+id/iv_tag"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
tools:src="@drawable/ic_mark_limit"/> tools:src="@drawable/ic_mark_limit" />
</FrameLayout> </FrameLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:layout_toStartOf="@id/tv_used"
android:layout_toEndOf="@id/ll_car_cover"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_car_name" android:id="@+id/tv_car_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="left"
android:layout_toEndOf="@+id/ll_car_cover"
android:layout_marginTop="@dimen/dp_25"
android:layout_marginStart="10dp"
android:textColor="@color/text_title_282828"
android:singleLine="true"
android:drawableStart="@{carInfo.isGive ? @drawable/ic_send_tag : null}" android:drawableStart="@{carInfo.isGive ? @drawable/ic_send_tag : null}"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:textSize="15sp" android:gravity="left"
android:singleLine="true"
android:text="@{carInfo.name}" android:text="@{carInfo.name}"
android:textColor="@color/text_title_282828"
android:textSize="15sp"
tools:text="神豪座驾" /> tools:text="神豪座驾" />
<TextView <TextView
android:id="@+id/tv_used" android:id="@+id/tv_counters"
android:layout_width="85dp" android:layout_width="wrap_content"
android:layout_height="33dp" android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:textSize="14sp" android:maxLines="1"
android:visibility="gone" android:textColor="#696D7A"
android:textColor="@color/text_title_282828" android:textSize="11sp"
tools:visibility="visible" tools:text="- 1567天 -" />
android:layout_marginEnd="@dimen/dp_15" </LinearLayout>
android:layout_alignTop="@id/tv_car_name"
android:layout_alignParentEnd="true"
tools:text="@string/label_can_use"
tools:background="@drawable/bg_common_confirm"/>
<TextView <TextView
android:id="@+id/tv_counters" android:id="@+id/tv_used"
android:layout_width="wrap_content" android:layout_width="78dp"
android:layout_height="wrap_content" android:layout_height="30dp"
android:layout_alignBottom="@id/ll_car_cover" android:layout_alignParentEnd="true"
android:layout_toEndOf="@id/ll_car_cover" android:layout_centerVertical="true"
android:layout_marginStart="10dp" android:layout_marginEnd="@dimen/dp_13"
android:layout_marginTop="24dp"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:textColor="#2B2D33"
android:textColor="@color/text_normal_282828" android:textSize="13sp"
android:textSize="12sp" android:visibility="gone"
tools:text="- 1567天 -" /> tools:background="@drawable/bg_common_confirm"
tools:text="@string/label_can_use"
tools:visibility="visible" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1px" android:layout_height="1px"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginEnd="15dp"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:background="@color/line_353548"/> android:layout_marginEnd="15dp"
android:background="@color/line_353548" />
</RelativeLayout> </RelativeLayout>
</layout> </layout>

View File

@@ -102,7 +102,7 @@
android:drawablePadding="1dp" android:drawablePadding="1dp"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/color_999999" android:textColor="#696D7A"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View File

@@ -39,59 +39,64 @@
</FrameLayout> </FrameLayout>
<TextView <LinearLayout
android:id="@+id/tv_car_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="15dp" android:layout_centerVertical="true"
android:layout_marginTop="22dp" android:layout_marginStart="13dp"
android:layout_marginEnd="10dp" android:layout_toStartOf="@id/tv_used"
android:layout_toEndOf="@+id/ll_head_img" android:layout_toEndOf="@id/ll_head_img"
android:drawableStart="@{headWearInfo.comeFrom==1?null:@drawable/ic_send_tag}" android:orientation="vertical">
android:drawablePadding="@dimen/dp_5"
android:text="@{headWearInfo.headwearName}" <TextView
android:textColor="@color/text_title_282828" android:id="@+id/tv_car_name"
android:textSize="15sp" android:layout_width="wrap_content"
tools:text="神豪座驾" /> android:layout_height="wrap_content"
android:drawableStart="@{headWearInfo.comeFrom==1?null:@drawable/ic_send_tag}"
android:drawablePadding="@dimen/dp_5"
android:text="@{headWearInfo.headwearName}"
android:textColor="@color/text_title_282828"
android:textSize="15sp"
tools:text="神豪座驾" />
<TextView
android:id="@+id/tv_counters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:drawablePadding="1dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:textColor="#696D7A"
android:textSize="11sp"
tools:text="剩余666天剩余666天剩余666天剩余666天剩余666天" />
</LinearLayout>
<TextView <TextView
android:id="@+id/tv_used" android:id="@+id/tv_used"
android:layout_width="85dp" android:layout_width="78dp"
android:layout_height="33dp" android:layout_height="30dp"
android:layout_alignTop="@id/tv_car_name"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_15" android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_13"
android:background="@{headWearInfo.used ? @drawable/bg_common_cancel : @drawable/bg_common_confirm}" android:background="@{headWearInfo.used ? @drawable/bg_common_cancel : @drawable/bg_common_confirm}"
android:gravity="center" android:gravity="center"
android:text="@{headWearInfo.used ? @string/label_used : @string/label_can_use}" android:text="@{headWearInfo.used ? @string/label_used : @string/label_can_use}"
android:textColor="@color/text_title_282828" android:textColor="#2B2D33"
android:textSize="14sp" android:textSize="13sp"
android:visibility="gone" android:visibility="gone"
tools:background="@drawable/bg_common_confirm" tools:background="@drawable/bg_common_confirm"
tools:text="@string/label_can_use" tools:text="@string/label_can_use"
tools:visibility="visible" /> tools:visibility="visible" />
<TextView
android:id="@+id/tv_counters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/ll_head_img"
android:layout_marginStart="15dp"
android:layout_toEndOf="@+id/ll_head_img"
android:drawablePadding="1dp"
android:gravity="center"
android:maxLines="1"
android:textColor="@color/text_normal_282828"
android:textSize="12sp"
tools:text="剩余666天" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1px" android:layout_height="1px"
android:layout_alignEnd="@id/tv_used"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginStart="15dp" android:layout_toRightOf="@id/ll_head_img"
android:layout_marginEnd="15dp"
android:background="@color/line_353548" /> android:background="@color/line_353548" />
</RelativeLayout> </RelativeLayout>

View File

@@ -92,7 +92,7 @@
android:drawablePadding="1dp" android:drawablePadding="1dp"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/color_999999" android:textColor="#696D7A"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_name" app:layout_constraintBaseline_toBaselineOf="@id/tv_name"
app:layout_constraintStart_toEndOf="@id/tv_name" app:layout_constraintStart_toEndOf="@id/tv_name"

View File

@@ -5,8 +5,8 @@
android:layout_height="26dp" android:layout_height="26dp"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/dp_7" android:paddingLeft="@dimen/dp_8"
android:paddingRight="@dimen/dp_7"> android:paddingRight="@dimen/dp_8">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
@@ -17,12 +17,18 @@
tools:ignore="SpUsage" tools:ignore="SpUsage"
tools:text="全部礼物" /> tools:text="全部礼物" />
<ImageView <TextView
android:id="@+id/iv_new_tag" android:id="@+id/tv_new_tag"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="11dp"
android:layout_gravity="top" android:layout_gravity="top"
android:src="@drawable/ic_gift_dialog_new" android:layout_marginStart="-15dp"
android:background="@drawable/shape_ff425b_6dp"
android:gravity="center"
android:paddingHorizontal="3dp"
android:text="New"
android:textColor="@color/white"
android:textSize="8dp"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />

View File

@@ -15,38 +15,51 @@
<RelativeLayout <RelativeLayout
android:id="@+id/gift_layout" android:id="@+id/gift_layout"
android:layout_width="86dp" android:layout_width="match_parent"
android:layout_height="98dp" android:layout_height="96dp"
android:layout_marginTop="6dp" android:layout_marginTop="3dp"
android:layout_marginBottom="6dp" android:layout_marginBottom="3dp"
android:gravity="center"> android:gravity="center"
tools:layout_width="88dp">
<View <View
android:id="@+id/view_room_gift_select" android:id="@+id/view_room_gift_select"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@{item.isPrivateChat?@drawable/shape_gift_item_select : @drawable/shape_gift_item_select_room}" android:background="@{item.isPrivateChat?@drawable/shape_gift_item_select : @drawable/gift_dialog_bg_item}"
android:visibility="@{item.isSelect ? View.VISIBLE : View.INVISIBLE}" android:visibility="@{item.isSelect ? View.VISIBLE : View.INVISIBLE}"
tools:visibility="visible" /> tools:visibility="visible" />
<ImageView <ImageView
android:id="@+id/gift_image" android:id="@+id/gift_image"
nomalUrl="@{item.data().giftUrl}" nomalUrl="@{item.data().giftUrl}"
android:layout_width="60dp" android:layout_width="52dp"
android:layout_height="60dp" android:layout_height="52dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_3" android:layout_marginTop="7dp"
android:alpha="@{item.isLocked?0.5f:1f}" /> android:alpha="@{item.isLocked?0.5f:1f}" />
<ImageView
nomalUrl="@{item.data().giftTag}"
android:alpha="@{item.isLocked?0.5f:1f}"
android:visibility="@{TextUtils.isEmpty(item.data().giftTag) ? View.GONE : View.VISIBLE}"
android:id="@+id/iv_tag"
android:layout_width="wrap_content"
android:layout_height="12dp"
android:layout_alignStart="@id/gift_image"
android:layout_alignBottom="@id/gift_image"
android:adjustViewBounds="true" />
<TextView <TextView
android:id="@+id/gift_name" android:id="@+id/gift_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/gift_image" android:layout_below="@id/gift_image"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:alpha="@{item.isLocked?0.5f:1f}"
android:text="@{item.data().giftName}" android:text="@{item.data().giftName}"
android:textColor="@{item.isPrivateChat? @color/text_normal_282828 : @color/white}" android:textColor="@{item.isPrivateChat? @color/text_normal_282828 : @color/white}"
android:textSize="@dimen/dp_10" android:textSize="@dimen/dp_12"
tools:ignore="SpUsage" tools:ignore="SpUsage"
tools:text="123" tools:text="123"
tools:textColor="@color/text_secondary_878b9c" /> tools:textColor="@color/text_secondary_878b9c" />
@@ -57,30 +70,33 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/gift_name" android:layout_below="@id/gift_name"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:alpha="@{item.isLocked?0.5f:1f}"
android:drawableStart="@{item.isSelect?item.radishDrawableSelected:item.radishDrawable}" android:drawableStart="@{item.isSelect?item.radishDrawableSelected:item.radishDrawable}"
android:drawablePadding="2dp" android:drawablePadding="2dp"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="@{item.goldText}" android:text="@{item.goldText}"
android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/white_transparent_60}" android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/color_CED1DB}"
android:textSize="@dimen/dp_10" android:textSize="@dimen/dp_10"
tools:ignore="SpUsage" tools:ignore="SpUsage"
tools:text="123" tools:text="123"
tools:textColor="@color/white_transparent_60"/> tools:textColor="@color/white_transparent_60" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:alpha="@{item.isLocked?0.5f:1f}"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal"
android:paddingEnd="2dp">
<ImageView <ImageView
android:id="@+id/icon_gift_exclusive" android:id="@+id/icon_gift_exclusive"
android:layout_width="@dimen/dp_14" android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14" android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_3" android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_exclusive" android:src="@drawable/icon_gift_exclusive"
android:visibility="@{item.isExclusive ? View.VISIBLE : View.GONE}" android:visibility="@{item.isExclusive ? View.VISIBLE : View.GONE}"
tools:visibility="visible" /> tools:visibility="visible" />
@@ -89,7 +105,7 @@
android:id="@+id/icon_gift_new" android:id="@+id/icon_gift_new"
android:layout_width="@dimen/dp_14" android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14" android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_3" android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_new" android:src="@drawable/icon_gift_new"
android:visibility="@{item.isShowNew ? View.VISIBLE : View.GONE}" android:visibility="@{item.isShowNew ? View.VISIBLE : View.GONE}"
tools:visibility="visible" /> tools:visibility="visible" />
@@ -98,7 +114,7 @@
android:id="@+id/icon_gift_limit_time" android:id="@+id/icon_gift_limit_time"
android:layout_width="@dimen/dp_14" android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14" android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_3" android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_limit_time" android:src="@drawable/icon_gift_limit_time"
android:visibility="@{item.isShowLimit ? View.VISIBLE : View.GONE}" android:visibility="@{item.isShowLimit ? View.VISIBLE : View.GONE}"
tools:visibility="visible" /> tools:visibility="visible" />
@@ -107,7 +123,7 @@
android:id="@+id/icon_gift_effect" android:id="@+id/icon_gift_effect"
android:layout_width="@dimen/dp_14" android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14" android:layout_height="@dimen/dp_14"
android:layout_marginEnd="@dimen/dp_4" android:layout_marginEnd="@dimen/dp_2"
android:src="@drawable/icon_gift_effect" android:src="@drawable/icon_gift_effect"
android:visibility="@{item.isShowEffect ? View.VISIBLE : View.GONE}" android:visibility="@{item.isShowEffect ? View.VISIBLE : View.GONE}"
tools:visibility="visible" /> tools:visibility="visible" />
@@ -117,7 +133,7 @@
nomalUrl="@{item.vipIcon}" nomalUrl="@{item.vipIcon}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginEnd="@dimen/dp_3" android:layout_marginEnd="@dimen/dp_2"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:visibility="@{TextUtils.isEmpty(item.vipIcon) ? View.GONE : View.VISIBLE}" android:visibility="@{TextUtils.isEmpty(item.vipIcon) ? View.GONE : View.VISIBLE}"
tools:src="@drawable/icon_gift_effect" /> tools:src="@drawable/icon_gift_effect" />
@@ -135,18 +151,17 @@
android:text="@{item.countText}" android:text="@{item.countText}"
android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/white}" android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/white}"
android:textSize="@dimen/sp_9" android:textSize="@dimen/sp_9"
android:visibility="@{item.isKnap ? View.VISIBLE : View.GONE}" /> android:visibility="@{item.isKnap ? View.VISIBLE : View.GONE}"
tools:text="x100"
tools:visibility="visible" />
<ImageView <ImageView
android:id="@+id/iv_vip_locked" android:id="@+id/iv_vip_locked"
android:layout_width="wrap_content" android:layout_width="9dp"
android:layout_height="wrap_content" android:layout_height="9dp"
android:layout_alignParentEnd="true" android:layout_alignStart="@id/gift_image"
android:layout_alignParentBottom="true" android:layout_alignTop="@id/gift_image"
android:layout_marginEnd="2dp" android:src="@drawable/gift_dialog_ic_lock"
android:layout_marginBottom="2dp"
android:src="@drawable/ic_vip_locked"
android:visibility="@{item.isLocked ? View.VISIBLE : View.GONE}" /> android:visibility="@{item.isLocked ? View.VISIBLE : View.GONE}" />
</RelativeLayout> </RelativeLayout>

View File

@@ -1,58 +1,82 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginHorizontal="2.5dp"
android:layout_marginTop="7dp" android:layout_marginVertical="4dp"
android:layout_marginEnd="8dp" tools:layout_width="84dp">
android:layout_marginBottom="7dp"
android:background="@drawable/shape_f3f5fa_corner_8dp" <ImageView
android:gravity="center" android:id="@+id/iv_bg"
android:orientation="vertical" android:layout_width="match_parent"
android:paddingBottom="5dp"> android:layout_height="0dp"
android:src="@drawable/gift_wall_bg_level_0"
app:layout_constraintDimensionRatio="84:122"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/line_icon_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.0655" />
<ImageView <ImageView
android:id="@+id/gift_img" android:id="@+id/gift_img"
android:layout_width="60dp" android:layout_width="0dp"
android:layout_height="60dp" android:layout_height="0dp"
android:layout_marginTop="10dp" /> app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line_icon_top"
app:layout_constraintWidth_percent="0.654"
tools:src="@drawable/default_cover" />
<TextView <TextView
android:id="@+id/gift_num" android:id="@+id/gift_num"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="1dp"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:textColor="#7F8494"
android:paddingStart="8dp" android:textSize="10dp"
android:paddingEnd="@dimen/dp_8" app:layout_constraintEnd_toEndOf="parent"
android:textColor="#6D6B89" app:layout_constraintStart_toStartOf="parent"
android:textSize="12dp" app:layout_constraintTop_toBottomOf="@id/gift_img"
tools:text="x120" /> tools:text="x120" />
<TextView <TextView
android:id="@+id/gift_name" android:id="@+id/gift_name"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp" android:layout_marginTop="1dp"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_horizontal"
android:lines="1" android:lines="1"
android:textColor="@color/text_normal_282828" android:paddingHorizontal="3dp"
android:textColor="#696D7A"
android:textSize="12dp" android:textSize="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gift_num"
tools:text="天使" /> tools:text="天使" />
<TextView <TextView
android:id="@+id/gift_price" android:id="@+id/gift_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:drawableStart="@drawable/gift_wall_ic_diamond"
android:layout_marginTop="3dp" android:drawablePadding="1dp"
android:drawableStart="@drawable/ic_gift_diamond"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textColor="@color/text_secondary_878b9c" android:textColor="#7F8494"
android:textSize="11dp" android:textSize="9dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gift_name"
tools:text="10" /> tools:text="10" />
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -629,5 +629,6 @@
<color name="color_FFD46C">#FFD46C</color> <color name="color_FFD46C">#FFD46C</color>
<color name="color_695CEB">#695CEB</color> <color name="color_695CEB">#695CEB</color>
<color name="color_FFF265">#FFFFF265</color> <color name="color_FFF265">#FFFFF265</color>
<color name="color_5CEFFF">#FF5CEFFF</color>
<color name="color_7F8494">#7F8494</color>
</resources> </resources>

View File

@@ -50,15 +50,15 @@
<TextView <TextView
android:id="@+id/tv_used" android:id="@+id/tv_used"
android:layout_width="64dp" android:layout_width="78dp"
android:layout_height="20dp" android:layout_height="30dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_13"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textColor="@color/white" android:textColor="#2B2D33"
android:textSize="11sp" android:textSize="13sp"
android:visibility="gone" android:visibility="gone"
tools:background="@drawable/bg_my_head_buy" tools:background="@drawable/bg_my_head_buy"
tools:text="@string/label_can_use" tools:text="@string/label_can_use"
@@ -74,8 +74,8 @@
android:layout_toEndOf="@id/ll_nameplate_cover" android:layout_toEndOf="@id/ll_nameplate_cover"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/color_666666" android:textColor="#696D7A"
android:textSize="12sp" android:textSize="11sp"
tools:text="- 1567天 -" /> tools:text="- 1567天 -" />
</RelativeLayout> </RelativeLayout>

View File

@@ -528,4 +528,10 @@ public class UriProvider {
return WEB_URL.concat("/yinmeng/modules/rule/privilegeCardRule.html"); return WEB_URL.concat("/yinmeng/modules/rule/privilegeCardRule.html");
} }
/**
* 礼物等级
*/
public static String getGiftLevelRuleUrl() {
return WEB_URL.concat("/yinmeng/modules/rule/giftWallRule.html");
}
} }

View File

@@ -1443,6 +1443,14 @@ public final class IMNetEaseManager {
.setEvent(RoomEvent.ROOM_HOUR_RANK)); .setEvent(RoomEvent.ROOM_HOUR_RANK));
} }
} }
break;
case CUSTOM_MSG_GIFT:
if (customAttachment.getSecond() == CUSTOM_MSG_GIFT_UNLOCK) {
addMessages(msg);
} else if (customAttachment.getSecond() == CUSTOM_MSG_GIFT_DRESS) {
addMessages(msg);
}
break;
default: default:
break; break;
} }

View File

@@ -381,6 +381,14 @@ public class DemoCache {
return SettingsPref.instance().getBoolean(KEY_NEW_GIFT_TYPE_TIP, true); return SettingsPref.instance().getBoolean(KEY_NEW_GIFT_TYPE_TIP, true);
} }
public static void saveNewGiftTypeTip(int type,boolean value) {
SettingsPref.instance().putBoolean(KEY_NEW_GIFT_TYPE_TIP + "_" + type, value);
}
public static boolean readNewGiftTypeTip(int type) {
return SettingsPref.instance().getBoolean(KEY_NEW_GIFT_TYPE_TIP + "_" + type, true);
}
public static void saveNewGiftTypeTipIndicator(boolean value) { public static void saveNewGiftTypeTipIndicator(boolean value) {
SettingsPref.instance().putBoolean(KEY_NEW_GIFT_TYPE_TIP_INDICATOR, value); SettingsPref.instance().putBoolean(KEY_NEW_GIFT_TYPE_TIP_INDICATOR, value);
} }

View File

@@ -35,6 +35,8 @@ public class CarInfo extends BaseDecoration implements Serializable {
//public static final String EFFECT = "effect"; //public static final String EFFECT = "effect";
public static final String CAR_NAME = "carName"; public static final String CAR_NAME = "carName";
public int expireDays; public int expireDays;
private int expireHour;
private int expireMinute;
public int limitType; public int limitType;
/** /**
* 该状态状态 * 该状态状态
@@ -105,6 +107,10 @@ public class CarInfo extends BaseDecoration implements Serializable {
return valueMap; return valueMap;
} }
public String getExpireText() {
return expireDays + "" + expireHour + "小时" + expireMinute + "分钟";
}
@Override @Override
public int getRealPrice() { public int getRealPrice() {
if (getRemainingDay() > 0 && getStatus() == CarInfo.STATUS_USER_CAN_USE) { if (getRemainingDay() > 0 && getStatus() == CarInfo.STATUS_USER_CAN_USE) {

View File

@@ -4,6 +4,8 @@ public class ChatBubbleInfo {
private String bubbleId; private String bubbleId;
private int comeFrom; private int comeFrom;
private int expireDays; private int expireDays;
private int expireHour;
private int expireMinute;
private String expireTime; private String expireTime;
private boolean hasExpired; private boolean hasExpired;
private String name; private String name;
@@ -11,6 +13,10 @@ public class ChatBubbleInfo {
private boolean hasUsed; private boolean hasUsed;
private int labelType; private int labelType;
public String getExpireText() {
return expireDays + "" + expireHour + "小时" + expireMinute + "分钟";
}
@SuppressWarnings("all") @SuppressWarnings("all")
public ChatBubbleInfo() { public ChatBubbleInfo() {
} }

View File

@@ -41,6 +41,8 @@ public class HeadWearInfo extends BaseDecoration implements Serializable {
private int seq; private int seq;
private int days; private int days;
private int expireDays; private int expireDays;
private int expireHour;
private int expireMinute;
private int status; private int status;
private int comeFrom; private int comeFrom;
private boolean enable; private boolean enable;
@@ -60,6 +62,10 @@ public class HeadWearInfo extends BaseDecoration implements Serializable {
return map; return map;
} }
public String getExpireText() {
return expireDays + "" + expireHour + "小时" + expireMinute + "分钟";
}
/** /**
* 实际购买价格 * 实际购买价格
*/ */
@@ -96,6 +102,22 @@ public class HeadWearInfo extends BaseDecoration implements Serializable {
return status == HeadWearInfo.STATUS_IN_USED; return status == HeadWearInfo.STATUS_IN_USED;
} }
public int getExpireHour() {
return expireHour;
}
public void setExpireHour(int expireHour) {
this.expireHour = expireHour;
}
public int getExpireMinute() {
return expireMinute;
}
public void setExpireMinute(int expireMinute) {
this.expireMinute = expireMinute;
}
//<editor-fold defaultstate="collapsed" desc="delombok"> //<editor-fold defaultstate="collapsed" desc="delombok">
/** /**
* headwearId : 1 * headwearId : 1

View File

@@ -4,6 +4,8 @@ public class UserCardWearInfo {
private String cardId; private String cardId;
private int comeFrom; private int comeFrom;
private int expireDays; private int expireDays;
private int expireHour;
private int expireMinute;
private String expireTime; private String expireTime;
private boolean hasExpired; private boolean hasExpired;
private String name; private String name;
@@ -11,6 +13,9 @@ public class UserCardWearInfo {
private boolean used; private boolean used;
private int labelType; private int labelType;
public String getExpireText() {
return expireDays + "" + expireHour + "小时" + expireMinute + "分钟";
}
@SuppressWarnings("all") @SuppressWarnings("all")
public UserCardWearInfo() { public UserCardWearInfo() {
} }

View File

@@ -57,8 +57,29 @@ public class NamePlateInfo {
private String nameplateImage; private String nameplateImage;
private boolean isExpired; private boolean isExpired;
private int expireDays; private int expireDays;
private int expireHour;
private int expireMinute;
private boolean isUsing; private boolean isUsing;
private String word; private String word;
public String getExpireText() {
return expireDays + "" + expireHour + "小时" + expireMinute + "分钟";
}
public int getExpireHour() {
return expireHour;
}
public void setExpireHour(int expireHour) {
this.expireHour = expireHour;
}
public int getExpireMinute() {
return expireMinute;
}
public void setExpireMinute(int expireMinute) {
this.expireMinute = expireMinute;
}
public String getWord() { public String getWord() {
return word; return word;

View File

@@ -236,6 +236,10 @@ public class GiftModel extends BaseModel implements IGiftModel {
case GiftType.GIFT_TYPE_PENALTY: case GiftType.GIFT_TYPE_PENALTY:
giftInfos = allGiftListInfo.getPenaltyGift(); giftInfos = allGiftListInfo.getPenaltyGift();
break; break;
case GiftType.GIFT_TYPE_INTEREST:
case GiftType.GIFT_TYPE_UNLOCK:
giftInfos = allGiftListInfo.getInterestGift();
break;
} }
return giftInfos == null ? new ArrayList<>() : giftInfos; return giftInfos == null ? new ArrayList<>() : giftInfos;
} }
@@ -616,6 +620,9 @@ public class GiftModel extends BaseModel implements IGiftModel {
if (giftInfo == null) { if (giftInfo == null) {
giftInfo = findGiftInfoById(allGiftListInfo.getPenaltyGift(), giftId); giftInfo = findGiftInfoById(allGiftListInfo.getPenaltyGift(), giftId);
} }
if (giftInfo == null) {
giftInfo = findGiftInfoById(allGiftListInfo.getInterestGift(), giftId);
}
} }
return giftInfo; return giftInfo;
} }
@@ -686,7 +693,7 @@ public class GiftModel extends BaseModel implements IGiftModel {
* *
* @return - * @return -
*/ */
@GET("/gift/listV4") @GET("/gift/listV5")
Single<ServiceResult<GiftListInfo>> requestGiftInfos(@Query("roomUid") String roomUid); Single<ServiceResult<GiftListInfo>> requestGiftInfos(@Query("roomUid") String roomUid);
/** /**

View File

@@ -2,6 +2,7 @@ package com.nnbc123.core.gift.bean;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* Created by * Created by
@@ -73,6 +74,84 @@ public class GiftInfo implements Serializable {
private SimpleUserInfo firstLevelRankUser; private SimpleUserInfo firstLevelRankUser;
private SimpleUserInfo firstCharmRankUser; private SimpleUserInfo firstCharmRankUser;
private boolean drawGift; private boolean drawGift;
private boolean unlocked;
private GiftInfo baseGift;
private List<UnLockGiftInfo> unlockGiftList;
private String giftTag;
private String bannerUrl;
private String bannerSkipUrl;
public String getBannerUrl() {
return bannerUrl;
}
public void setBannerUrl(String bannerUrl) {
this.bannerUrl = bannerUrl;
}
public GiftInfo getBaseGift() {
return baseGift;
}
public void setBaseGift(GiftInfo baseGift) {
this.baseGift = baseGift;
}
public List<UnLockGiftInfo> getUnlockGiftList() {
return unlockGiftList;
}
public void setUnlockGiftList(List<UnLockGiftInfo> unlockGiftList) {
this.unlockGiftList = unlockGiftList;
}
public String getGiftTag() {
return giftTag;
}
public void setGiftTag(String giftTag) {
this.giftTag = giftTag;
}
public boolean isUnlocked() {
return unlocked;
}
public void setUnlocked(boolean unlocked) {
this.unlocked = unlocked;
}
/**
* 更新解锁进度
*/
public void updateUnlockProgress(int addNumber) {
List<UnLockGiftInfo> childGiftList = getUnlockGiftList();
if (childGiftList == null) {
return;
}
for (int j = 0; j < childGiftList.size(); j++) {
UnLockGiftInfo childItem = childGiftList.get(j);
if (childItem == null) {
continue;
}
childItem.addProgress(addNumber);
GiftInfo childGiftInfo = childItem.getTargetGift();
if (childGiftInfo != null && childGiftInfo.getGiftId() == getGiftId()) {
Boolean unlocked = childItem.getUnlocked();
if (unlocked != null) {
this.setUnlocked(unlocked);
}
}
}
}
public String getBannerSkipUrl() {
return bannerSkipUrl;
}
public void setBannerSkipUrl(String bannerSkipUrl) {
this.bannerSkipUrl = bannerSkipUrl;
}
//<editor-fold defaultstate="collapsed" desc="delombok"> //<editor-fold defaultstate="collapsed" desc="delombok">
@SuppressWarnings("all") @SuppressWarnings("all")
@@ -463,6 +542,7 @@ public class GiftInfo implements Serializable {
if (this.isRoomExclude() != other.isRoomExclude()) return false; if (this.isRoomExclude() != other.isRoomExclude()) return false;
if (this.getOtherViewType() != other.getOtherViewType()) return false; if (this.getOtherViewType() != other.getOtherViewType()) return false;
if (this.isDrawGift() != other.isDrawGift()) return false; if (this.isDrawGift() != other.isDrawGift()) return false;
if (this.isUnlocked() != other.isUnlocked()) return false;
final Object this$giftName = this.getGiftName(); final Object this$giftName = this.getGiftName();
final Object other$giftName = other.getGiftName(); final Object other$giftName = other.getGiftName();
if (this$giftName == null ? other$giftName != null : !this$giftName.equals(other$giftName)) return false; if (this$giftName == null ? other$giftName != null : !this$giftName.equals(other$giftName)) return false;
@@ -499,6 +579,21 @@ public class GiftInfo implements Serializable {
final Object this$firstCharmRankUser = this.getFirstCharmRankUser(); final Object this$firstCharmRankUser = this.getFirstCharmRankUser();
final Object other$firstCharmRankUser = other.getFirstCharmRankUser(); final Object other$firstCharmRankUser = other.getFirstCharmRankUser();
if (this$firstCharmRankUser == null ? other$firstCharmRankUser != null : !this$firstCharmRankUser.equals(other$firstCharmRankUser)) return false; if (this$firstCharmRankUser == null ? other$firstCharmRankUser != null : !this$firstCharmRankUser.equals(other$firstCharmRankUser)) return false;
final Object this$baseGift = this.getBaseGift();
final Object other$baseGift = other.getBaseGift();
if (this$baseGift == null ? other$baseGift != null : !this$baseGift.equals(other$baseGift)) return false;
final Object this$unlockGiftList = this.getUnlockGiftList();
final Object other$unlockGiftList = other.getUnlockGiftList();
if (this$unlockGiftList == null ? other$unlockGiftList != null : !this$unlockGiftList.equals(other$unlockGiftList)) return false;
final Object this$giftTag = this.getGiftTag();
final Object other$giftTag = other.getGiftTag();
if (this$giftTag == null ? other$giftTag != null : !this$giftTag.equals(other$giftTag)) return false;
final Object this$bannerUrl = this.getBannerUrl();
final Object other$bannerUrl = other.getBannerUrl();
if (this$bannerUrl == null ? other$bannerUrl != null : !this$bannerUrl.equals(other$bannerUrl)) return false;
final Object this$bannerSkipUrl = this.getBannerSkipUrl();
final Object other$bannerSkipUrl = other.getBannerSkipUrl();
if (this$bannerSkipUrl == null ? other$bannerSkipUrl != null : !this$bannerSkipUrl.equals(other$bannerSkipUrl)) return false;
return true; return true;
} }
@@ -531,6 +626,7 @@ public class GiftInfo implements Serializable {
result = result * PRIME + (this.isRoomExclude() ? 79 : 97); result = result * PRIME + (this.isRoomExclude() ? 79 : 97);
result = result * PRIME + this.getOtherViewType(); result = result * PRIME + this.getOtherViewType();
result = result * PRIME + (this.isDrawGift() ? 79 : 97); result = result * PRIME + (this.isDrawGift() ? 79 : 97);
result = result * PRIME + (this.isUnlocked() ? 79 : 97);
final Object $giftName = this.getGiftName(); final Object $giftName = this.getGiftName();
result = result * PRIME + ($giftName == null ? 43 : $giftName.hashCode()); result = result * PRIME + ($giftName == null ? 43 : $giftName.hashCode());
final Object $giftUrl = this.getGiftUrl(); final Object $giftUrl = this.getGiftUrl();
@@ -555,6 +651,16 @@ public class GiftInfo implements Serializable {
result = result * PRIME + ($firstLevelRankUser == null ? 43 : $firstLevelRankUser.hashCode()); result = result * PRIME + ($firstLevelRankUser == null ? 43 : $firstLevelRankUser.hashCode());
final Object $firstCharmRankUser = this.getFirstCharmRankUser(); final Object $firstCharmRankUser = this.getFirstCharmRankUser();
result = result * PRIME + ($firstCharmRankUser == null ? 43 : $firstCharmRankUser.hashCode()); result = result * PRIME + ($firstCharmRankUser == null ? 43 : $firstCharmRankUser.hashCode());
final Object $baseGift = this.getBaseGift();
result = result * PRIME + ($baseGift == null ? 43 : $baseGift.hashCode());
final Object $unlockGiftList = this.getUnlockGiftList();
result = result * PRIME + ($unlockGiftList == null ? 43 : $unlockGiftList.hashCode());
final Object $giftTag = this.getGiftTag();
result = result * PRIME + ($giftTag == null ? 43 : $giftTag.hashCode());
final Object $bannerUrl = this.getBannerUrl();
result = result * PRIME + ($bannerUrl == null ? 43 : $bannerUrl.hashCode());
final Object $bannerSkipUrl = this.getBannerSkipUrl();
result = result * PRIME + ($bannerSkipUrl == null ? 43 : $bannerSkipUrl.hashCode());
return result; return result;
} }

View File

@@ -16,6 +16,7 @@ public class GiftListInfo implements Serializable {
private List<GiftInfo> drawGift; private List<GiftInfo> drawGift;
private List<GiftInfo> singlePopularGift; private List<GiftInfo> singlePopularGift;
private List<GiftInfo> penaltyGift; private List<GiftInfo> penaltyGift;
private List<GiftInfo> interestGift;
private String giftVersion; private String giftVersion;
//<editor-fold defaultstate="collapsed" desc="delombok"> //<editor-fold defaultstate="collapsed" desc="delombok">
@@ -113,6 +114,14 @@ public class GiftListInfo implements Serializable {
this.giftVersion = giftVersion; this.giftVersion = giftVersion;
} }
public List<GiftInfo> getInterestGift() {
return interestGift;
}
public void setInterestGift(List<GiftInfo> interestGift) {
this.interestGift = interestGift;
}
@Override @Override
@SuppressWarnings("all") @SuppressWarnings("all")
public boolean equals(final Object o) { public boolean equals(final Object o) {
@@ -144,6 +153,9 @@ public class GiftListInfo implements Serializable {
final Object this$penaltyGift = this.getPenaltyGift(); final Object this$penaltyGift = this.getPenaltyGift();
final Object other$penaltyGift = other.getPenaltyGift(); final Object other$penaltyGift = other.getPenaltyGift();
if (this$penaltyGift == null ? other$penaltyGift != null : !this$penaltyGift.equals(other$penaltyGift)) return false; if (this$penaltyGift == null ? other$penaltyGift != null : !this$penaltyGift.equals(other$penaltyGift)) return false;
final Object this$interestGift = this.getInterestGift();
final Object other$interestGift = other.getInterestGift();
if (this$interestGift == null ? other$interestGift != null : !this$interestGift.equals(other$interestGift)) return false;
final Object this$giftVersion = this.getGiftVersion(); final Object this$giftVersion = this.getGiftVersion();
final Object other$giftVersion = other.getGiftVersion(); final Object other$giftVersion = other.getGiftVersion();
if (this$giftVersion == null ? other$giftVersion != null : !this$giftVersion.equals(other$giftVersion)) return false; if (this$giftVersion == null ? other$giftVersion != null : !this$giftVersion.equals(other$giftVersion)) return false;
@@ -176,6 +188,8 @@ public class GiftListInfo implements Serializable {
result = result * PRIME + ($singlePopularGift == null ? 43 : $singlePopularGift.hashCode()); result = result * PRIME + ($singlePopularGift == null ? 43 : $singlePopularGift.hashCode());
final Object $penaltyGift = this.getPenaltyGift(); final Object $penaltyGift = this.getPenaltyGift();
result = result * PRIME + ($penaltyGift == null ? 43 : $penaltyGift.hashCode()); result = result * PRIME + ($penaltyGift == null ? 43 : $penaltyGift.hashCode());
final Object $interestGift = this.getInterestGift();
result = result * PRIME + ($interestGift == null ? 43 : $interestGift.hashCode());
final Object $giftVersion = this.getGiftVersion(); final Object $giftVersion = this.getGiftVersion();
result = result * PRIME + ($giftVersion == null ? 43 : $giftVersion.hashCode()); result = result * PRIME + ($giftVersion == null ? 43 : $giftVersion.hashCode());
return result; return result;

View File

@@ -13,10 +13,19 @@ public class GiftTab {
this.selectedTitle = selectedTitle; this.selectedTitle = selectedTitle;
} }
public GiftTab(int type, String unSelectedTitle, String selectedTitle, boolean needNewTips) {
this.type = type;
this.unSelectedTitle = unSelectedTitle;
this.selectedTitle = selectedTitle;
this.needNewTips = needNewTips;
}
private int type; private int type;
private String selectedTitle; private String selectedTitle;
private String unSelectedTitle; private String unSelectedTitle;
private View itemView; private View itemView;
// 是否需要提示“new”
private boolean needNewTips;
//<editor-fold defaultstate="collapsed" desc="delombok"> //<editor-fold defaultstate="collapsed" desc="delombok">
@SuppressWarnings("all") @SuppressWarnings("all")
@@ -59,6 +68,14 @@ public class GiftTab {
this.itemView = itemView; this.itemView = itemView;
} }
public boolean isNeedNewTips() {
return needNewTips;
}
public void setNeedNewTips(boolean needNewTips) {
this.needNewTips = needNewTips;
}
@Override @Override
@SuppressWarnings("all") @SuppressWarnings("all")
public boolean equals(final Object o) { public boolean equals(final Object o) {

View File

@@ -42,4 +42,18 @@ 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_PENALTY = 12; public static final int GIFT_TYPE_PENALTY = 12;
/**
* 礼物类型 -- 解锁礼物
*/
public static final int GIFT_TYPE_UNLOCK = 16;
/**
* 礼物类型 -- 装扮礼物
*/
public static final int GIFT_TYPE_DRESS_UP = 17;
// 趣味礼物(本地自定义维护的)
@Deprecated()
public static final int GIFT_TYPE_INTEREST = 1000;
} }

View File

@@ -0,0 +1,15 @@
package com.nnbc123.core.gift.bean
/**
* Created by Max on 2024/1/26 17:09
* Desc:
**/
data class UnLockBaseGiftInfo(val giftInfo: GiftInfo) : UnlockItem {
override fun getGiftData(): GiftInfo? {
return giftInfo
}
override fun getItemType(): Int {
return UnlockItem.ITEM_TYPE_BASE
}
}

View File

@@ -0,0 +1,31 @@
package com.nnbc123.core.gift.bean
/**
* Created by Max on 2024/1/26 15:36
* Desc:可解锁礼物
**/
data class UnLockGiftInfo(
val targetGift: GiftInfo? = null,
val condition: Int? = null,
var process: Int? = null,
var unlocked: Boolean? = null
) : UnlockItem {
override fun getGiftData(): GiftInfo? {
return targetGift
}
override fun getItemType(): Int {
return UnlockItem.ITEM_TYPE_CHILD
}
// 加进度(发送基础礼物成功后:数量累加)
fun addProgress(count: Int) {
val p = process ?: 0
process = p + count
if ((process ?: 0) >= (condition ?: 0)) {
unlocked = true
}
}
}

View File

@@ -0,0 +1,16 @@
package com.nnbc123.core.gift.bean
import com.chad.library.adapter.base.entity.MultiItemEntity
/**
* Created by Max on 2024/1/26 17:06
* Desc:
**/
interface UnlockItem : MultiItemEntity {
companion object {
const val ITEM_TYPE_BASE = 0
const val ITEM_TYPE_CHILD = 1
}
fun getGiftData(): GiftInfo?
}

View File

@@ -19,6 +19,7 @@ import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_EXPER_
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_EXPER_LEVEL_UP_NOTICE; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_EXPER_LEVEL_UP_NOTICE;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GAME_INVITE; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GAME_INVITE;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GAME_INVITE_SECOND; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GAME_INVITE_SECOND;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_MEMBER_COUNT; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_MEMBER_COUNT;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_ROOM_NOTIFY; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_ROOM_NOTIFY;
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_TOPIC; import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GROUP_CHAT_TOPIC;
@@ -622,6 +623,13 @@ public class CustomAttachParser implements MsgAttachmentParser {
attachment = new GameInviteAttachment(first, second); attachment = new GameInviteAttachment(first, second);
} }
break; break;
case CUSTOM_MSG_GIFT:
if (second == CustomAttachment.CUSTOM_MSG_GIFT_UNLOCK) {
attachment = new UnLockGiftAttachment(first, second);
} else if (second == CustomAttachment.CUSTOM_MSG_GIFT_DRESS) {
attachment = new DressUpGiftAttachment(first, second);
}
break;
default: default:
LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second); LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second);
break; break;

View File

@@ -437,6 +437,10 @@ public class CustomAttachment implements MsgAttachment {
public static final int CUSTOM_MSG_HOUR_RANK = 97; // 小时榜 public static final int CUSTOM_MSG_HOUR_RANK = 97; // 小时榜
public static final int CUSTOM_MSG_HOUR_RANK_UPDATE = 971; // 小时榜更新 public static final int CUSTOM_MSG_HOUR_RANK_UPDATE = 971; // 小时榜更新
public static final int CUSTOM_MSG_GIFT = 98; // 礼物相关
public static final int CUSTOM_MSG_GIFT_UNLOCK = 981; // 解锁了礼物
public static final int CUSTOM_MSG_GIFT_DRESS = 982; // 获得装扮礼物
public static final int CUSTOM_MSG_PRIVILEGE = 102; //特权卡 public static final int CUSTOM_MSG_PRIVILEGE = 102; //特权卡
public static final int CUSTOM_MSG_PRIVILEGE_SECOND = 1020;//特权卡(图片、gif) public static final int CUSTOM_MSG_PRIVILEGE_SECOND = 1020;//特权卡(图片、gif)
public static final int CUSTOM_MSG_PRIVILEGE_SECOND_VIDEO = 1021;//特权卡(视频类型) public static final int CUSTOM_MSG_PRIVILEGE_SECOND_VIDEO = 1021;//特权卡(视频类型)

View File

@@ -0,0 +1,49 @@
package com.nnbc123.core.im.custom.bean
import com.alibaba.fastjson.JSONObject
/**
* Created by Max on 2024/1/29 15:54
* Desc:
**/
class DressUpGiftAttachment : CustomAttachment {
var uid: Long? = null
var nick: String? = null
var dressId: Long? = null
var dressName: String? = null
var dressUrl: String? = null
constructor() : super()
constructor(first: Int, second: Int) : super(first, second)
fun getDressNameNotNull(): String {
return dressName ?: ""
}
fun getDressUrlNotNull(): String {
return dressName ?: ""
}
override fun parseData(data: JSONObject?) {
super.parseData(data)
if (data == null) {
return
}
if (data.containsKey("uid")) {
this.uid = data.getLong("uid")
}
if (data.containsKey("nick")) {
this.nick = data.getString("nick")
}
if (data.containsKey("dressId")) {
this.dressId = data.getLong("dressId")
}
if (data.containsKey("dressName")) {
this.dressName = data.getString("dressName")
}
if (data.containsKey("dressUrl")) {
this.dressUrl = data.getString("dressUrl")
}
}
}

View File

@@ -0,0 +1,50 @@
package com.nnbc123.core.im.custom.bean
import com.alibaba.fastjson.JSONObject
/**
* Created by Max on 2024/1/29 15:54
* Desc:
**/
class UnLockGiftAttachment : CustomAttachment{
var uid: Long? = null
var nick: String? = null
var giftId: Long? = null
var giftName: String? = null
var giftUrl: String? = null
constructor() : super()
constructor(first: Int, second: Int) : super(first, second)
fun getGiftNameNotNull(): String {
return giftName ?: ""
}
fun getGiftUrlNotNull(): String {
return giftUrl ?: ""
}
override fun parseData(data: JSONObject?) {
super.parseData(data)
if (data == null) {
return
}
if (data.containsKey("uid")) {
this.uid = data.getLong("uid")
}
if (data.containsKey("nick")) {
this.nick = data.getString("nick")
}
if (data.containsKey("giftId")) {
this.giftId = data.getLong("giftId")
}
if (data.containsKey("giftName")) {
this.giftName = data.getString("giftName")
}
if (data.containsKey("giftUrl")) {
this.giftUrl = data.getString("giftUrl")
}
}
}

View File

@@ -13,6 +13,15 @@ public class GiftWallInfo implements Serializable {
private String giftName; private String giftName;
private String picUrl; private String picUrl;
private int giftPrice; private int giftPrice;
private int giftLevel;
public int getGiftLevel() {
return giftLevel;
}
public void setGiftLevel(int giftLevel) {
this.giftLevel = giftLevel;
}
public long getUid() { public long getUid() {
return uid; return uid;

View File

@@ -2,7 +2,9 @@ package com.nnbc123.library.utils;
import android.app.Application; import android.app.Application;
import androidx.annotation.ColorRes;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import androidx.core.content.ContextCompat;
public class ResUtil { public class ResUtil {
@@ -15,4 +17,9 @@ public class ResUtil {
public static String getString(@StringRes int resId) { public static String getString(@StringRes int resId) {
return context.getString(resId); return context.getString(resId);
} }
public static int getColor(@ColorRes int resId) {
return ContextCompat.getColor(context, resId);
}
} }