礼物面板UI修改
@@ -28,48 +28,49 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
||||
|
||||
public final ObservableField<String> countText = new ObservableField<>();
|
||||
|
||||
public Drawable nobleDrawable = null;
|
||||
public Drawable nobleDrawable;
|
||||
|
||||
public Drawable radishDrawable = null;
|
||||
public Drawable radishDrawable;
|
||||
|
||||
public Drawable radishDrawableSelected = null;
|
||||
public Drawable radishDrawableSelected;
|
||||
|
||||
/**
|
||||
* 是否显示新
|
||||
*/
|
||||
public boolean isShowNew = false;
|
||||
public boolean isShowNew;
|
||||
|
||||
/**
|
||||
* 显示限定
|
||||
*/
|
||||
public boolean isShowLimit = false;
|
||||
public boolean isShowLimit;
|
||||
|
||||
/**
|
||||
* 显示特定
|
||||
*/
|
||||
public boolean isShowEffect = false;
|
||||
public boolean isShowEffect;
|
||||
|
||||
/**
|
||||
* 是否显示专属礼物
|
||||
*/
|
||||
public boolean isExclusive = false;
|
||||
public boolean isExclusive;
|
||||
|
||||
public boolean isLocked = false;
|
||||
public boolean isLocked;
|
||||
|
||||
public String vipIcon;
|
||||
|
||||
public boolean isPrivateChat;
|
||||
|
||||
public GiftInfoVm(Context context, GiftInfo data, boolean select, boolean isKnap) {
|
||||
super(context, data);
|
||||
this.isSelect.set(select);
|
||||
if (data.getConsumeType() == GiftInfo.CONSUME_TYPE_GOLD) {
|
||||
radishDrawable = null;
|
||||
radishDrawableSelected = null;
|
||||
goldText.set(String.valueOf(data.getGoldPrice()));
|
||||
} else {
|
||||
radishDrawable = context.getResources().getDrawable(R.drawable.icon_radish_transparent);
|
||||
radishDrawableSelected = context.getResources().getDrawable(R.drawable.icon_radish_transparent_selected);
|
||||
goldText.set(String.valueOf(data.getGoldPrice()));
|
||||
}
|
||||
goldText.set(data.getGoldPrice() + "钻石");
|
||||
this.isKnap.set(isKnap);
|
||||
updateCount();
|
||||
int nobleId = data.getLevel();
|
||||
|
@@ -1,32 +1,19 @@
|
||||
package com.nnbc123.app.ui.im.actions;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.netease.nim.uikit.business.session.actions.BaseAction;
|
||||
import com.netease.nim.uikit.business.session.helper.MessageListPanelHelper;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.common.widget.dialog.DialogManager;
|
||||
import com.nnbc123.app.ui.widget.GiftDialog;
|
||||
import com.nnbc123.core.gift.GiftModel;
|
||||
import com.nnbc123.core.gift.bean.GiftInfo;
|
||||
import com.nnbc123.core.gift.toolbox.GiftToolbox;
|
||||
import com.nnbc123.core.room.queue.bean.MicMemberInfo;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.core.utils.net.VipLevelNotEnoughException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.nnbc123.app.ui.widget.PrivateChatGiftDialog;
|
||||
|
||||
/**
|
||||
* Created by xiaoyu
|
||||
* on 2017/10/2.
|
||||
*/
|
||||
|
||||
public class GiftAction extends BaseAction implements GiftDialog.OnGiftDialogBtnClickListener {
|
||||
public class GiftAction extends BaseAction {
|
||||
|
||||
|
||||
transient private GiftDialog giftDialog;
|
||||
transient private PrivateChatGiftDialog giftDialog;
|
||||
|
||||
public GiftAction() {
|
||||
super(R.drawable.icon_gift_action, R.string.gift_action);
|
||||
@@ -36,43 +23,11 @@ public class GiftAction extends BaseAction implements GiftDialog.OnGiftDialogBtn
|
||||
public void onClick() {
|
||||
if (giftDialog == null) {
|
||||
GiftDialog.GIFT_DIALOG_FROM = "私聊";
|
||||
|
||||
giftDialog = new GiftDialog(getActivity(), Long.valueOf(getAccount()), false, false, true);
|
||||
giftDialog.setGiftDialogBtnClickListener(this);
|
||||
giftDialog = new PrivateChatGiftDialog(getActivity(), Long.valueOf(getAccount()));
|
||||
giftDialog.setOnDismissListener(dialog -> giftDialog = null);
|
||||
}
|
||||
if (!giftDialog.isShowing()) {
|
||||
giftDialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onSendGiftBtnClick(GiftInfo giftInfo, ArrayList<MicMemberInfo> micMemberInfos, int number, String msg, boolean isknap, boolean isWholeMic, List<List<Integer>> drawFixedArray, GiftDialog.SenGiftCallback callback) {
|
||||
if (giftInfo == null) return;
|
||||
GiftModel.get().sendPersonalGift(giftInfo.getGiftId(), micMemberInfos.get(0).getAccount(), number, msg, isknap)
|
||||
.doOnError(throwable -> {
|
||||
if (callback != null) {
|
||||
callback.onFail();
|
||||
}
|
||||
if (throwable instanceof VipLevelNotEnoughException) {
|
||||
new DialogManager(getActivity()).showOkDialog("尚未达到赠送" +
|
||||
giftInfo.getGiftName() +
|
||||
"所需贵族等级,所需贵族等级:" +
|
||||
giftInfo.getGiftVipInfo().getVipName());
|
||||
}
|
||||
})
|
||||
.flatMap(serviceResult -> GiftToolbox.sendGiftPrivateChatMessage(serviceResult.getData()))
|
||||
.subscribe(imMessage -> {
|
||||
// 手动更新送礼物的消息
|
||||
MessageListPanelHelper.getInstance().notifyAddMessage(imMessage);
|
||||
if (callback != null) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_PRIVATECHAT_SENDGIFT,
|
||||
"私聊_送礼物");
|
||||
callback.onSuccess();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,24 +1,22 @@
|
||||
package com.nnbc123.app.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.coorchice.library.SuperTextView;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.common.widget.CircleImageView;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.core.manager.AvRoomDataManager;
|
||||
import com.nnbc123.core.room.pk.bean.PKTeamInfo;
|
||||
import com.nnbc123.library.utils.ListUtils;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.core.room.queue.bean.MicMemberInfo;
|
||||
import com.nnbc123.library.utils.ListUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -82,16 +80,8 @@ public class GiftAvatarAdapter extends RecyclerView.Adapter<GiftAvatarAdapter.Vi
|
||||
@Override
|
||||
public void onBindViewHolder(GiftAvatarAdapter.ViewHolder holder, int position) {
|
||||
holder.avatarContainer.setTag(holder.getAdapterPosition());
|
||||
if (position == 0) {
|
||||
holder.micNumber.setVisibility(View.GONE);
|
||||
holder.avatar.setVisibility(View.GONE);
|
||||
holder.ivAll.setVisibility(View.VISIBLE);
|
||||
holder.ivAll.setAlpha(selectType == SELECT_TYPE_WHOLE_MIC ? 1f : 0.5f);
|
||||
holder.avatarCover.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.avatar.setVisibility(View.VISIBLE);
|
||||
holder.ivAll.setVisibility(View.GONE);
|
||||
final MicMemberInfo micMemberInfo = micMemberInfos.get(position - 1);
|
||||
final MicMemberInfo micMemberInfo = micMemberInfos.get(position);
|
||||
ImageLoadUtils.loadAvatar(holder.avatar.getContext(), micMemberInfo.getAvatar(), holder.avatar);
|
||||
// 强制给一个透明的边框,避免因为复用导致的出现边框
|
||||
holder.avatar.setBorderColor(context.getResources().getColor(R.color.transparent));
|
||||
@@ -103,19 +93,18 @@ public class GiftAvatarAdapter extends RecyclerView.Adapter<GiftAvatarAdapter.Vi
|
||||
} else {
|
||||
holder.micNumber.setText(String.valueOf(micMemberInfo.getMicPosition() + 1));
|
||||
}
|
||||
|
||||
int boardColor = context.getResources().getColor(R.color.color_5FCCE4);
|
||||
int solidColor = context.getResources().getColor(R.color.color_5FCCE4);
|
||||
int boardColor = context.getResources().getColor(R.color.color_ffe710);
|
||||
int solidColor = context.getResources().getColor(R.color.color_ffe710);
|
||||
if (selectType == SELECT_TYPE_WHOLE_MIC || micMemberInfo.isSelected()) {
|
||||
//选中
|
||||
holder.avatarCover.setVisibility(View.GONE);
|
||||
holder.avatar.setBorderColor(boardColor);
|
||||
holder.micNumber.setTextColor(context.getResources().getColor(R.color.color_161958));
|
||||
holder.micNumber.setTextColor(context.getResources().getColor(R.color.text_normal_282828));
|
||||
holder.micNumber.setSolid(solidColor);
|
||||
} else {
|
||||
holder.avatarCover.setVisibility(View.VISIBLE);
|
||||
holder.micNumber.setTextColor(context.getResources().getColor(R.color.white));
|
||||
holder.micNumber.setSolid(context.getResources().getColor(R.color.color_999999));
|
||||
holder.micNumber.setSolid(context.getResources().getColor(R.color.color_bdbfd0));
|
||||
holder.avatar.setBorderColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
@@ -128,44 +117,47 @@ public class GiftAvatarAdapter extends RecyclerView.Adapter<GiftAvatarAdapter.Vi
|
||||
holder.avatar.setBorderColor(boardColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
if (ListUtils.isListEmpty(micMemberInfos)) {
|
||||
return 0;
|
||||
} else {
|
||||
return micMemberInfos.size() + 1;
|
||||
return micMemberInfos.size();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Integer position = (Integer) v.getTag();
|
||||
if (position > 0) {
|
||||
micMemberInfos.get(position - 1).setSelected(!micMemberInfos.get(position - 1).isSelected());
|
||||
micMemberInfos.get(position).setSelected(!micMemberInfos.get(position).isSelected());
|
||||
if (selectType == SELECT_TYPE_WHOLE_MIC && !isSelectAll()) {
|
||||
selectType = SELECT_TYPE_MULTI_MIC;
|
||||
} else if (selectType == SELECT_TYPE_MULTI_MIC && isSelectAll()) {
|
||||
selectType = SELECT_TYPE_WHOLE_MIC;
|
||||
}
|
||||
} else {
|
||||
if (selectType == SELECT_TYPE_WHOLE_MIC && position == 0) {
|
||||
|
||||
notifyDataSetChanged();
|
||||
if (onItemSelectedListener != null) {
|
||||
onItemSelectedListener.onItemSelected(position);
|
||||
}
|
||||
}
|
||||
|
||||
public void selectAll() {
|
||||
if (isSelectAll()) {
|
||||
selectType = SELECT_TYPE_MULTI_MIC;
|
||||
for (MicMemberInfo micMemberInfo : micMemberInfos) {
|
||||
micMemberInfo.setSelected(false);
|
||||
}
|
||||
micMemberInfos.get(0).setSelected(true);
|
||||
} else {
|
||||
selectType = SELECT_TYPE_WHOLE_MIC;
|
||||
for (MicMemberInfo micMemberInfo : micMemberInfos) {
|
||||
micMemberInfo.setSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
if (onItemSelectedListener != null) {
|
||||
onItemSelectedListener.onItemSelected(position);
|
||||
onItemSelectedListener.onItemSelected(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +179,6 @@ public class GiftAvatarAdapter extends RecyclerView.Adapter<GiftAvatarAdapter.Vi
|
||||
private View avatarCover;
|
||||
private SuperTextView micNumber;
|
||||
private RelativeLayout avatarContainer;
|
||||
private ImageView ivAll;
|
||||
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
@@ -196,7 +187,6 @@ public class GiftAvatarAdapter extends RecyclerView.Adapter<GiftAvatarAdapter.Vi
|
||||
micNumber = itemView.findViewById(R.id.mic_number);
|
||||
avatarContainer = itemView.findViewById(R.id.avatar_container);
|
||||
avatarContainer.setOnClickListener(GiftAvatarAdapter.this);
|
||||
ivAll = itemView.findViewById(R.id.iv_all);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -70,7 +70,6 @@ import com.nnbc123.app.base.BaseActivity;
|
||||
import com.nnbc123.app.common.widget.CircleImageView;
|
||||
import com.nnbc123.app.radish.task.activity.TaskCenterActivity;
|
||||
import com.nnbc123.app.ui.gift.dialog.GiftInfoVm;
|
||||
import com.nnbc123.app.ui.gift.dialog.PageIndicatorView;
|
||||
import com.nnbc123.app.ui.pay.ChargeDialog;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||
@@ -136,9 +135,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
*/
|
||||
private final boolean userOnMic;
|
||||
private ViewPager gridView;
|
||||
private PageIndicatorView indicatorView;
|
||||
private RecyclerView avatarList;
|
||||
private View llAvatarList;
|
||||
private GiftAvatarAdapter avatarListAdapter;
|
||||
private TextView tvSelectAll;
|
||||
private BaseQuickAdapter<LuckyBagNoticeInfo, BaseViewHolder> luckyMsgAdapter;
|
||||
@Nullable
|
||||
private GiftInfo currentGiftInfo;
|
||||
@@ -164,7 +164,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private int giftNumber = 1;
|
||||
private View sendContainer;
|
||||
private TextView tvTextGold;
|
||||
private TextView tvRecharge;
|
||||
private View tvRecharge;
|
||||
private List<MicMemberInfo> micMemberInfos;
|
||||
private View giftNumLayout;
|
||||
private Disposable mSubscribe;
|
||||
@@ -422,8 +422,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
giftIndicator = findViewById(R.id.gift_indicator);
|
||||
giftIndicator.initTab(
|
||||
tabInfoList,
|
||||
context.getResources().getColor(R.color.white),
|
||||
context.getResources().getColor(R.color.color_5FCCE4)
|
||||
context.getResources().getColor(R.color.color_bdbfd0),
|
||||
context.getResources().getColor(R.color.color_ffe710)
|
||||
);
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
giftIndicator.addClick()
|
||||
@@ -446,8 +446,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
lineTabType.setVisibility(View.GONE);
|
||||
}
|
||||
gridView = findViewById(R.id.gridView);
|
||||
indicatorView = findViewById(R.id.indicator);
|
||||
indicatorView.setVisibility(View.INVISIBLE);
|
||||
tvTextGold = findViewById(R.id.tv_text_gold);
|
||||
tvRecharge = findViewById(R.id.tv_recharge);
|
||||
tvTextGold.setSelected(true);
|
||||
@@ -466,6 +464,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
giftNumberOptions = findViewById(R.id.iv_gift_number_options);
|
||||
avatarImage = findViewById(R.id.avatar);
|
||||
nickText = findViewById(R.id.nick);
|
||||
llAvatarList = findViewById(R.id.ll_avatar_list);
|
||||
avatarList = findViewById(R.id.avatar_list);
|
||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false);
|
||||
avatarList.setLayoutManager(mLayoutManager);
|
||||
@@ -476,7 +475,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
flLuckyDesc = findViewById(R.id.fl_lucky_desc);
|
||||
rvLuckyMsg = findViewById(R.id.rv_lucky_msg);
|
||||
tvGiftValue = findViewById(R.id.tv_gift_value);
|
||||
tvSelectAll = findViewById(R.id.tv_select_all);
|
||||
tvSelectAll.setSelected(false);
|
||||
tvSelectAll.setOnClickListener(v -> avatarListAdapter.selectAll());
|
||||
ivLuckyBagIntro.setOnClickListener(this);
|
||||
findViewById(R.id.ll_gold).setOnClickListener(this);
|
||||
if (giftId == 0) {
|
||||
// 更新所有礼物
|
||||
showGiftTab();
|
||||
@@ -505,16 +508,18 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
View descLayout = findViewById(R.id.desc_layout);
|
||||
|
||||
if (isInRoom && (userOnMic || uid == 0)) {
|
||||
avatarList.setVisibility(View.VISIBLE);
|
||||
descLayout.setVisibility(View.GONE);
|
||||
if (micMemberInfos != null && micMemberInfos.size() > 0) {
|
||||
llAvatarList.setVisibility(View.VISIBLE);
|
||||
avatarListAdapter = new GiftAvatarAdapter(getContext());
|
||||
avatarListAdapter.setMicMemberInfos(micMemberInfos);
|
||||
avatarListAdapter.setOnItemSelectedListener(this);
|
||||
avatarList.setAdapter(avatarListAdapter);
|
||||
} else {
|
||||
llAvatarList.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
avatarList.setVisibility(View.INVISIBLE);
|
||||
llAvatarList.setVisibility(View.GONE);
|
||||
descLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
Single<UserInfo> single = UserModel.get().getUserInfo(uid);
|
||||
@@ -614,16 +619,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
itemType = ITEM_TYPE_GOLD;
|
||||
|
||||
tvRecharge.setVisibility(View.VISIBLE);
|
||||
tvRecharge.setText(context.getText(R.string.charge));
|
||||
if (goldWalletInfo == null) {
|
||||
return;
|
||||
}
|
||||
String goldNumText = getContext().getString(R.string.gold_num_text, goldWalletInfo.getDiamondNum());
|
||||
SpannableBuilder builder = new SpannableBuilder();
|
||||
builder.append(context.getText(R.string.gift_wallet_overage), new ForegroundColorSpan(
|
||||
context.getResources().getColor(R.color.white_transparent_50)))
|
||||
.append(goldNumText);
|
||||
tvTextGold.setText(builder.build());
|
||||
tvTextGold.setText(goldNumText);
|
||||
}
|
||||
|
||||
private void setUpdateTipsText() {
|
||||
@@ -682,7 +682,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
if (currentGiftInfo.isSendMsg()) {
|
||||
etSendMessage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
pagerList = beanTransformVm(context, currentGiftInfoList, isKnap, 8, selectGiftInfo);
|
||||
pagerList = beanTransformVm(context, currentGiftInfoList, isKnap, Integer.MAX_VALUE, selectGiftInfo);
|
||||
setGridViewData(pagerList);
|
||||
if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
@@ -729,7 +729,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
.flatMap(luckyBagNoticeInfos -> Observable.intervalRange(0, Integer.MAX_VALUE, 0, 5, TimeUnit.SECONDS))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> {
|
||||
int index = Math.toIntExact(aLong) % luckyMsgAdapter.getItemCount();
|
||||
int index = aLong.intValue() % luckyMsgAdapter.getItemCount();
|
||||
if (index == 0) {
|
||||
rvLuckyMsg.scrollToPosition(index);
|
||||
} else {
|
||||
@@ -746,7 +746,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
initInfo != null && initInfo.isTwelveStarSwitch()) {
|
||||
llStarWeek.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
llStarWeek.setVisibility(View.INVISIBLE);
|
||||
llStarWeek.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -835,7 +835,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
}
|
||||
|
||||
private void updateDrawGiftTips() {
|
||||
if (drawGiftHelper == null) return;
|
||||
if (drawGiftHelper == null || !isShowDrawGiftModel) return;
|
||||
if (drawGiftHelper.getDrawGiftSize() >= 10) {
|
||||
int memberSize = 0;
|
||||
if (!userOnMic && uid > 0) {
|
||||
@@ -883,7 +883,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
layoutLoading.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.INVISIBLE);
|
||||
etSendMessage.setVisibility(View.GONE);
|
||||
indicatorView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
private void showLoadFailedView() {
|
||||
@@ -892,7 +891,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.GONE);
|
||||
etSendMessage.setVisibility(View.GONE);
|
||||
indicatorView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void showLoadingView() {
|
||||
@@ -911,7 +909,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
flLuckyDesc.setVisibility(View.GONE);
|
||||
|
||||
gridView.setVisibility(View.VISIBLE);
|
||||
indicatorView.setVisibility(View.VISIBLE);
|
||||
sendContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@@ -919,7 +916,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
if (ListUtils.isListEmpty(pagerList)) {
|
||||
return;
|
||||
}
|
||||
indicatorView.initIndicator(pagerList.size());
|
||||
int defaultSelectPage = 0;
|
||||
int defaultSelectItem = 0;
|
||||
wai:
|
||||
@@ -934,12 +930,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
}
|
||||
}
|
||||
}
|
||||
indicatorView.setSelectedPage(defaultSelectPage);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.VISIBLE);
|
||||
|
||||
indicatorView.setVisibility(pagerList.size() > 1 ? View.VISIBLE : View.INVISIBLE);
|
||||
SparseArray<RecyclerView> cacheItemView = new SparseArray<>();
|
||||
SparseArray<RecyclerViewNoViewpagerScroll> cacheItemView = new SparseArray<>();
|
||||
lastSelectedItem = pagerList.get(defaultSelectPage).get(defaultSelectItem);
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
gridView.setAdapter(new PagerAdapter() {
|
||||
@@ -957,10 +951,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
@NonNull
|
||||
@Override
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int pagePos) {
|
||||
RecyclerView recyclerView;
|
||||
RecyclerViewNoViewpagerScroll recyclerView;
|
||||
MultiTypeAdapter<GiftInfoVm> giftAdapter;
|
||||
if (cacheItemView.get(pagePos) == null) {
|
||||
recyclerView = new RecyclerView(context);
|
||||
recyclerView = new RecyclerViewNoViewpagerScroll(context);
|
||||
recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 4));
|
||||
@@ -1005,14 +999,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
}
|
||||
});
|
||||
gridView.setCurrentItem(defaultSelectPage);
|
||||
gridView.addOnPageChangeListener(new OnPageSelectedListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (pagerList.size() > 1) {
|
||||
indicatorView.setSelectedPage(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private List<GiftInfo> loadGiftInfoList() {
|
||||
@@ -1110,7 +1096,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.tv_recharge:
|
||||
case R.id.ll_gold:
|
||||
if (itemType == ITEM_TYPE_GOLD) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_GIFT_PANEL_TO_RECHARGE, "礼物面板_去充值:" + GIFT_DIALOG_FROM);
|
||||
|
||||
@@ -1529,9 +1515,12 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
|
||||
@Override
|
||||
public void onItemSelected(int position) {
|
||||
if (position != -1) {
|
||||
avatarList.smoothScrollToPosition(position);
|
||||
updateDrawGiftTips();
|
||||
}
|
||||
tvSelectAll.setSelected(avatarListAdapter.getSelectType() == GiftAvatarAdapter.SELECT_TYPE_WHOLE_MIC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
|
@@ -0,0 +1,884 @@
|
||||
package com.nnbc123.app.ui.widget;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.view.Display;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.animation.RotateAnimation;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.nnbc123.core.UriProvider;
|
||||
import com.nnbc123.core.auth.AuthModel;
|
||||
import com.nnbc123.core.gift.GiftModel;
|
||||
import com.nnbc123.core.gift.bean.GiftInfo;
|
||||
import com.nnbc123.core.gift.bean.GiftTab;
|
||||
import com.nnbc123.core.gift.bean.GiftType;
|
||||
import com.nnbc123.core.gift.event.UpdateKnapEvent;
|
||||
import com.nnbc123.core.gift.toolbox.GiftToolbox;
|
||||
import com.nnbc123.core.initial.InitialModel;
|
||||
import com.nnbc123.core.initial.bean.InitInfo;
|
||||
import com.nnbc123.core.manager.AvRoomDataManager;
|
||||
import com.nnbc123.core.manager.IMNetEaseManager;
|
||||
import com.nnbc123.core.manager.RoomEvent;
|
||||
import com.nnbc123.core.pay.PayModel;
|
||||
import com.nnbc123.core.pay.bean.WalletInfo;
|
||||
import com.nnbc123.core.pay.event.UpdateWalletInfoEvent;
|
||||
import com.nnbc123.core.statistic.StatisticManager;
|
||||
import com.nnbc123.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.nnbc123.core.utils.LogUtils;
|
||||
import com.nnbc123.core.utils.net.RxHelper;
|
||||
import com.nnbc123.core.utils.net.VipLevelNotEnoughException;
|
||||
import com.nnbc123.app.BR;
|
||||
import com.nnbc123.app.R;
|
||||
import com.nnbc123.app.base.BaseActivity;
|
||||
import com.nnbc123.app.common.widget.CircleImageView;
|
||||
import com.nnbc123.app.common.widget.dialog.DialogManager;
|
||||
import com.nnbc123.app.ui.gift.dialog.GiftInfoVm;
|
||||
import com.nnbc123.app.ui.gift.dialog.PageIndicatorView;
|
||||
import com.nnbc123.app.ui.pay.ChargeDialog;
|
||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity;
|
||||
import com.nnbc123.app.ui.webview.DialogWebViewActivity;
|
||||
import com.nnbc123.app.ui.widget.dialog.GiftManualQuantityDialog;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.GiftIndicator;
|
||||
import com.nnbc123.app.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.nnbc123.app.utils.SpannableBuilder;
|
||||
import com.nnbc123.library.bindinglist.IItem;
|
||||
import com.nnbc123.library.bindinglist.MultiTypeAdapter;
|
||||
import com.nnbc123.library.utils.FormatUtils;
|
||||
import com.nnbc123.library.utils.ListUtils;
|
||||
import com.nnbc123.library.utils.LogUtil;
|
||||
import com.nnbc123.library.utils.SingleToastUtil;
|
||||
import com.nnbc123.library.utils.TextWatcherWrapper;
|
||||
import com.nnbc123.library.widget.DrawableCenterTextView;
|
||||
import com.netease.nim.uikit.business.session.helper.MessageListPanelHelper;
|
||||
import com.zyyoona7.lib.EasyPopup;
|
||||
import com.zyyoona7.lib.HorizontalGravity;
|
||||
import com.zyyoona7.lib.VerticalGravity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* @author chenran
|
||||
* @date 2017/7/27
|
||||
*/
|
||||
|
||||
public class PrivateChatGiftDialog extends BottomSheetDialog implements View.OnClickListener {
|
||||
|
||||
private static final String TAG = "GiftDialog";
|
||||
public static String GIFT_DIALOG_FROM = ""; // 埋点用,标识从哪个位置打开弹框
|
||||
private final Context context;
|
||||
private final long uid;
|
||||
@Nullable
|
||||
private GiftInfo currentGiftInfo;
|
||||
private List<GiftInfo> currentGiftInfoList;
|
||||
private EasyPopup easyPopup;
|
||||
private int giftNumber = 1;
|
||||
private Disposable mSubscribe;
|
||||
private CompositeDisposable compositeDisposable;
|
||||
private GiftInfoVm lastSelectedItem;
|
||||
private List<List<GiftInfoVm>> pagerList;
|
||||
private WalletInfo goldWalletInfo = PayModel.get().getCurrentWalletInfo();
|
||||
|
||||
private GiftIndicator giftIndicator;
|
||||
private LinearLayout llStarWeek;
|
||||
private LinearLayout llWeekStarDetail;
|
||||
private ImageView ivWeekStarIcon;
|
||||
private CircleImageView ivAvatarCharm;
|
||||
private TextView tvWeekStarDesc;
|
||||
private TextView tvWeekStarFirstUsername;
|
||||
private TextView tvWeekStarEmpty;
|
||||
private DrawableCenterTextView tvWeekStarIn;
|
||||
private TextView tvGiftValue;
|
||||
private LinearLayout layoutLoading;
|
||||
private ImageView ivLoading;
|
||||
private LinearLayout layoutLoadFailed;
|
||||
private TextView tvReload;
|
||||
private ViewPager gridView;
|
||||
private LinearLayout layoutEmpty;
|
||||
private EditText etGiftMessage;
|
||||
private View tvRecharge;
|
||||
private TextView tvTextGold;
|
||||
private LinearLayout sendContainer;
|
||||
private LinearLayout giftNumberLayout;
|
||||
private TextView giftNumberText;
|
||||
private ImageView ivGiftNumberOptions;
|
||||
private Button btnSend;
|
||||
|
||||
/***
|
||||
*
|
||||
* @param context context
|
||||
* @param OtherUid 送礼人uid
|
||||
*/
|
||||
public PrivateChatGiftDialog(Context context, long OtherUid) {
|
||||
super(context, R.style.ErbanBottomSheetDialog);
|
||||
this.context = context;
|
||||
this.uid = OtherUid;
|
||||
}
|
||||
|
||||
private List<List<GiftInfoVm>> beanTransformVm(Context context,
|
||||
List<GiftInfo> data,
|
||||
boolean isKnap,
|
||||
int pageSize,
|
||||
@Nullable GiftInfo selectGiftInfo) {
|
||||
List<List<GiftInfoVm>> result = new ArrayList<>();
|
||||
if (ListUtils.isListEmpty(data)) {
|
||||
return result;
|
||||
}
|
||||
boolean hasSelectGift = false;
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
GiftInfoVm item = null;
|
||||
List<GiftInfoVm> page = null;
|
||||
if (i % pageSize == 0) {
|
||||
page = new ArrayList<>();
|
||||
result.add(page);
|
||||
} else {
|
||||
if (result.size() > 0) {
|
||||
page = result.get(result.size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
boolean select = false;
|
||||
if (selectGiftInfo != null && selectGiftInfo.getGiftId() == data.get(i).getGiftId()) {
|
||||
hasSelectGift = true;
|
||||
select = true;
|
||||
}
|
||||
item = new GiftInfoVm(context, data.get(i), select, isKnap);
|
||||
item.isPrivateChat = true;
|
||||
if (page != null) {
|
||||
page.add(item);
|
||||
}
|
||||
}
|
||||
if (!hasSelectGift) {
|
||||
result.get(0).get(0).isSelect.set(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EventBus.getDefault().register(this);
|
||||
setCanceledOnTouchOutside(true);
|
||||
setContentView(R.layout.dialog_private_chat_gift);
|
||||
compositeDisposable = new CompositeDisposable();
|
||||
init();
|
||||
|
||||
FrameLayout bottomSheet = findViewById(R.id.design_bottom_sheet);
|
||||
if (bottomSheet != null) {
|
||||
BottomSheetBehavior.from(bottomSheet).setSkipCollapsed(false);
|
||||
BottomSheetBehavior.from(bottomSheet).setHideable(false);
|
||||
}
|
||||
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
Display d = windowManager.getDefaultDisplay();
|
||||
DisplayMetrics realDisplayMetrics = new DisplayMetrics();
|
||||
d.getRealMetrics(realDisplayMetrics);
|
||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.dimAmount = 0.5f;
|
||||
getWindow().setAttributes(params);
|
||||
mSubscribe = IMNetEaseManager.get().getChatRoomEventObservable().subscribe(this::onReceiveRoomEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
GIFT_DIALOG_FROM = "";
|
||||
}
|
||||
|
||||
private void onReceiveRoomEvent(RoomEvent roomEvent) {
|
||||
int event = roomEvent.getEvent();
|
||||
if (event == RoomEvent.GIFT_OUT_OF_DATE) {
|
||||
onGiftOutOfDate(roomEvent.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void init() {
|
||||
initView();
|
||||
findViewById(R.id.tv_recharge).setOnClickListener(this);
|
||||
tvReload.setOnClickListener(this);
|
||||
showLoadingView();
|
||||
showLoadingAnimation();
|
||||
btnSend.setOnClickListener(this);
|
||||
giftNumberLayout.setOnClickListener(this);
|
||||
List<GiftTab> tabInfoList = new ArrayList<>();
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NORMAL, "礼物", "礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_NOBLE, "贵族", "贵族"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_WEEK, "星座礼物", "星座礼物"));
|
||||
tabInfoList.add(new GiftTab(GiftIndicator.TYPE_KNAP, "背包", "背包"));
|
||||
giftIndicator = findViewById(R.id.gift_indicator);
|
||||
giftIndicator.initTab(
|
||||
tabInfoList,
|
||||
Color.parseColor("#878B9C"),
|
||||
Color.parseColor("#282828")
|
||||
);
|
||||
|
||||
giftIndicator.addClick()
|
||||
.subscribeOn(AndroidSchedulers.mainThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(integer -> {
|
||||
updateGiftView(integer);
|
||||
//福袋礼物有定时更新逻辑,每次点击都需要刷新福袋礼物信息
|
||||
if (integer == GiftIndicator.TYPE_LUCKY) {
|
||||
reloadData(false);
|
||||
}
|
||||
});
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_LUCKY);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
tvTextGold.setSelected(true);
|
||||
tvWeekStarIn.setOnClickListener(this);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
etGiftMessage.addTextChangedListener(new TextWatcherWrapper() {
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if (s.toString().trim().length() > 15) {
|
||||
SingleToastUtil.showToast(getContext().getString(R.string.tips_input_gift_message_limit));
|
||||
btnSend.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
compositeDisposable.add(GiftModel.get().requestKnapGiftInfos().subscribe());
|
||||
showGiftTab();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
llStarWeek = findViewById(R.id.ll_star_week);
|
||||
llWeekStarDetail = findViewById(R.id.ll_week_star_detail);
|
||||
ivWeekStarIcon = findViewById(R.id.iv_week_star_icon);
|
||||
ivAvatarCharm = findViewById(R.id.iv_avatar_charm);
|
||||
tvWeekStarDesc = findViewById(R.id.tv_week_star_desc);
|
||||
tvWeekStarFirstUsername = findViewById(R.id.tv_week_star_first_username);
|
||||
tvWeekStarEmpty = findViewById(R.id.tv_week_star_empty);
|
||||
tvWeekStarIn = findViewById(R.id.tv_week_star_in);
|
||||
tvGiftValue = findViewById(R.id.tv_gift_value);
|
||||
layoutLoading = findViewById(R.id.layout_loading);
|
||||
ivLoading = findViewById(R.id.iv_loading);
|
||||
layoutLoadFailed = findViewById(R.id.layout_load_failed);
|
||||
tvReload = findViewById(R.id.tv_reload);
|
||||
gridView = findViewById(R.id.gridView);
|
||||
layoutEmpty = findViewById(R.id.layout_empty);
|
||||
etGiftMessage = findViewById(R.id.et_gift_message);
|
||||
tvRecharge = findViewById(R.id.tv_recharge);
|
||||
tvTextGold = findViewById(R.id.tv_text_gold);
|
||||
sendContainer = findViewById(R.id.send_container);
|
||||
giftNumberLayout = findViewById(R.id.gift_number_layout);
|
||||
giftNumberText = findViewById(R.id.gift_number_text);
|
||||
ivGiftNumberOptions = findViewById(R.id.iv_gift_number_options);
|
||||
btnSend = findViewById(R.id.btn_send);
|
||||
findViewById(R.id.ll_gold).setOnClickListener(this);
|
||||
}
|
||||
|
||||
|
||||
private void showLoadingAnimation() {
|
||||
Animation rotateAnimation = new RotateAnimation(0, 360,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f);
|
||||
rotateAnimation.setFillAfter(true);
|
||||
rotateAnimation.setDuration(1000);
|
||||
rotateAnimation.setRepeatCount(-1);
|
||||
rotateAnimation.setInterpolator(new LinearInterpolator());
|
||||
ivLoading.startAnimation(rotateAnimation);
|
||||
}
|
||||
|
||||
private void setGoldOrRadishText(IItem lastSelectedItem) {
|
||||
if (lastSelectedItem == null) {
|
||||
setTvGoldText();
|
||||
return;
|
||||
}
|
||||
if (lastSelectedItem instanceof GiftInfoVm) {
|
||||
GiftInfoVm giftInfoVm = (GiftInfoVm) lastSelectedItem;
|
||||
btnSend.setEnabled(true);
|
||||
setTvGoldText();
|
||||
}
|
||||
}
|
||||
|
||||
private void setTvGoldText() {
|
||||
tvRecharge.setVisibility(View.VISIBLE);
|
||||
if (goldWalletInfo == null) {
|
||||
return;
|
||||
}
|
||||
String goldNumText = getContext().getString(R.string.gold_num_text, goldWalletInfo.getDiamondNum());
|
||||
tvTextGold.setText(goldNumText);
|
||||
}
|
||||
|
||||
private void updateGiftView(int position) {
|
||||
updateGiftView(position, null);
|
||||
}
|
||||
|
||||
private void updateGiftView(int position, @Nullable GiftInfo selectGiftInfo) {
|
||||
showDataView();
|
||||
// 获得对应的普通礼物/贵族礼物/背包礼物
|
||||
List<GiftInfo> nobleGiftInfos = getNobleGiftInfos();
|
||||
if (position == GiftIndicator.TYPE_KNAP) {
|
||||
currentGiftInfoList = GiftModel.get().getKnapList();
|
||||
} else if (position == GiftIndicator.TYPE_NOBLE) {
|
||||
currentGiftInfoList = nobleGiftInfos;
|
||||
} else if (position == GiftIndicator.TYPE_NORMAL) {
|
||||
currentGiftInfoList = getNormalGiftInfos();
|
||||
} else if (position == GiftIndicator.TYPE_WEEK) {
|
||||
currentGiftInfoList = getWeekStarGiftInfos();
|
||||
}
|
||||
//是否背包礼物
|
||||
final boolean isKnap = (position == GiftIndicator.TYPE_KNAP);
|
||||
initEasyPop(isKnap);
|
||||
if (ListUtils.isListEmpty(currentGiftInfoList)) {
|
||||
currentGiftInfo = null;
|
||||
if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
showEmptyView();
|
||||
} else if (position == GiftIndicator.TYPE_LUCKY ||
|
||||
position == GiftIndicator.TYPE_WEEK ||
|
||||
position == GiftIndicator.TYPE_DRAW_GIFT ||
|
||||
position == GiftIndicator.TYPE_SING_ROOM ||
|
||||
position == GiftIndicator.TYPE_PENALTY) {
|
||||
showEmptyView();
|
||||
updateWeekStarDesc();
|
||||
} else {
|
||||
showLoadFailedView();
|
||||
}
|
||||
return;
|
||||
}
|
||||
currentGiftInfo = selectGiftInfo == null ? currentGiftInfoList.get(0) : selectGiftInfo;
|
||||
if (currentGiftInfo.isSendMsg()) {
|
||||
etGiftMessage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
pagerList = beanTransformVm(context, currentGiftInfoList, isKnap, Integer.MAX_VALUE, selectGiftInfo);
|
||||
setGridViewData(pagerList);
|
||||
if (isKnap) {
|
||||
tvGiftValue.setVisibility(View.VISIBLE);
|
||||
updateTotalPrice();
|
||||
} else {
|
||||
if (giftNumber == -1) {
|
||||
updateNumber(1);
|
||||
}
|
||||
}
|
||||
updateWeekStarDesc();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void updateWeekStarDesc() {
|
||||
InitInfo initInfo = InitialModel.get().getCacheInitInfo();
|
||||
if (giftIndicator.getCurrrentType() == GiftIndicator.TYPE_WEEK &&
|
||||
initInfo != null && initInfo.isTwelveStarSwitch()) {
|
||||
llStarWeek.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
llStarWeek.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
GiftModel.get().getLastRankFirst()
|
||||
.subscribe(weekStarInfo -> {
|
||||
if (TextUtils.isEmpty(weekStarInfo.getNick())) {
|
||||
tvWeekStarEmpty.setVisibility(View.VISIBLE);
|
||||
llWeekStarDetail.setVisibility(View.GONE);
|
||||
} else {
|
||||
tvWeekStarEmpty.setVisibility(View.GONE);
|
||||
llWeekStarDetail.setVisibility(View.VISIBLE);
|
||||
ImageLoadUtils.loadImage(context, weekStarInfo.getAvatar(), ivAvatarCharm);
|
||||
ImageLoadUtils.loadImage(context, weekStarInfo.getMarkUrl(), ivWeekStarIcon);
|
||||
tvWeekStarFirstUsername.setText(weekStarInfo.getNick());
|
||||
tvWeekStarDesc.setText("上期星座月" + weekStarInfo.getTwelveStarName() + "星主");
|
||||
}
|
||||
}, throwable -> {
|
||||
tvWeekStarEmpty.setVisibility(View.VISIBLE);
|
||||
llWeekStarDetail.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void updateTotalPrice() {
|
||||
String diamond = "";
|
||||
double totalValue = 0;
|
||||
for (int i = 0; i < currentGiftInfoList.size(); i++) {
|
||||
totalValue += currentGiftInfoList.get(i).getCount() * currentGiftInfoList.get(i).getGoldPrice();
|
||||
}
|
||||
if (totalValue >= 10000) {
|
||||
totalValue = totalValue / 10000.0f;
|
||||
diamond = FormatUtils.formatBigDecimal(totalValue) + "W+";
|
||||
} else {
|
||||
diamond = String.valueOf((int) totalValue);
|
||||
}
|
||||
SpannableBuilder text = new SpannableBuilder()
|
||||
.append("总价值: ", new ForegroundColorSpan(Color.parseColor("#BABBCD")))
|
||||
.append(diamond + "", new ForegroundColorSpan(Color.parseColor("#5FCCE4")));
|
||||
tvGiftValue.setText(text.build());
|
||||
}
|
||||
|
||||
private void showEmptyView() {
|
||||
//tab对应的礼物列表为空的情况
|
||||
layoutEmpty.setVisibility(View.VISIBLE);
|
||||
layoutLoadFailed.setVisibility(View.GONE);
|
||||
layoutLoading.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.INVISIBLE);
|
||||
etGiftMessage.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void showLoadFailedView() {
|
||||
layoutLoading.setVisibility(View.GONE);
|
||||
layoutLoadFailed.setVisibility(View.VISIBLE);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.GONE);
|
||||
etGiftMessage.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void showLoadingView() {
|
||||
layoutLoading.setVisibility(View.VISIBLE);
|
||||
layoutLoadFailed.setVisibility(View.GONE);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void showDataView() {
|
||||
layoutLoading.setVisibility(View.GONE);
|
||||
layoutLoadFailed.setVisibility(View.GONE);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
etGiftMessage.setVisibility(View.GONE);
|
||||
tvGiftValue.setVisibility(View.GONE);
|
||||
llStarWeek.setVisibility(View.GONE);
|
||||
|
||||
gridView.setVisibility(View.VISIBLE);
|
||||
sendContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void setGridViewData(List<List<GiftInfoVm>> pagerList) {
|
||||
if (ListUtils.isListEmpty(pagerList)) {
|
||||
return;
|
||||
}
|
||||
int defaultSelectPage = 0;
|
||||
int defaultSelectItem = 0;
|
||||
wai:
|
||||
for (int i = 0; i < pagerList.size(); i++) {
|
||||
List<GiftInfoVm> pager = pagerList.get(i);
|
||||
for (int j = 0; j < pager.size(); j++) {
|
||||
GiftInfoVm iItem = pager.get(j);
|
||||
if (iItem != null && iItem.isSelect.get()) {
|
||||
defaultSelectPage = i;
|
||||
defaultSelectItem = j;
|
||||
break wai;
|
||||
}
|
||||
}
|
||||
}
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
gridView.setVisibility(View.VISIBLE);
|
||||
|
||||
SparseArray<RecyclerViewNoViewpagerScroll> cacheItemView = new SparseArray<>();
|
||||
lastSelectedItem = pagerList.get(defaultSelectPage).get(defaultSelectItem);
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
gridView.setAdapter(new PagerAdapter() {
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return pagerList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
|
||||
return view == object;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int pagePos) {
|
||||
RecyclerViewNoViewpagerScroll recyclerView;
|
||||
MultiTypeAdapter<GiftInfoVm> giftAdapter;
|
||||
if (cacheItemView.get(pagePos) == null) {
|
||||
recyclerView = new RecyclerViewNoViewpagerScroll(context);
|
||||
recyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(context, 4));
|
||||
giftAdapter = new MultiTypeAdapter<>(BR.item, true);
|
||||
recyclerView.setAdapter(giftAdapter);
|
||||
cacheItemView.put(pagePos, recyclerView);
|
||||
} else {
|
||||
recyclerView = cacheItemView.get(pagePos);
|
||||
giftAdapter = (MultiTypeAdapter<GiftInfoVm>) recyclerView.getAdapter();
|
||||
}
|
||||
giftAdapter.clearAllItem();
|
||||
giftAdapter.addData(pagerList.get(pagePos));
|
||||
|
||||
giftAdapter.setOnItemClickListener(item -> {
|
||||
if (item.data.isSendMsg()) {
|
||||
etGiftMessage.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
etGiftMessage.setVisibility(View.GONE);
|
||||
}
|
||||
if (lastSelectedItem != null) {
|
||||
lastSelectedItem.isSelect.set(false);
|
||||
}
|
||||
item.isSelect.set(true);
|
||||
lastSelectedItem = item;
|
||||
currentGiftInfo = item.data;
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
updateWeekStarDesc();
|
||||
});
|
||||
container.addView(recyclerView);
|
||||
return recyclerView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
|
||||
RecyclerView recyclerView = cacheItemView.get(position);
|
||||
MultiTypeAdapter<GiftInfoVm> adapter = (MultiTypeAdapter) recyclerView.getAdapter();
|
||||
adapter.getAllItems().clear();
|
||||
container.removeView(recyclerView);
|
||||
}
|
||||
});
|
||||
gridView.setCurrentItem(defaultSelectPage);
|
||||
}
|
||||
|
||||
private List<GiftInfo> loadGiftInfoList() {
|
||||
List<GiftInfo> giftInfos;
|
||||
// 私聊送礼面板 不在房间内,直接在普通的列表里选出房间礼物进行显示
|
||||
giftInfos = GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_NORMAL);
|
||||
if (ListUtils.isListEmpty(giftInfos)) return new ArrayList<>();
|
||||
return giftInfos;
|
||||
}
|
||||
|
||||
private List<GiftInfo> getNormalGiftInfos() {
|
||||
List<GiftInfo> giftInfos = loadGiftInfoList();
|
||||
List<GiftInfo> infos = new ArrayList<>();
|
||||
for (int i = 0; i < giftInfos.size(); i++) {
|
||||
GiftInfo giftInfo = giftInfos.get(i);
|
||||
if (!giftInfo.isNobleGift() || giftInfo.getLevel() == 0) {
|
||||
infos.add(giftInfo);
|
||||
}
|
||||
}
|
||||
return infos;
|
||||
}
|
||||
|
||||
private List<GiftInfo> getWeekStarGiftInfos() {
|
||||
return GiftModel.get().getGiftInfosByType(
|
||||
String.valueOf(AvRoomDataManager.get().getRoomUid()),
|
||||
GiftType.GIFT_TYPE_WEEK_STAR);
|
||||
}
|
||||
|
||||
private List<GiftInfo> getNobleGiftInfos() {
|
||||
return GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_VIP);
|
||||
}
|
||||
|
||||
private void initEasyPop(boolean isBag) {
|
||||
|
||||
easyPopup = new EasyPopup(getContext())
|
||||
.setContentView(R.layout.dialog_gift_number)
|
||||
.setFocusAndOutsideEnable(true)
|
||||
.createPopup();
|
||||
|
||||
easyPopup.getView(R.id.number_1).setOnClickListener(this);
|
||||
easyPopup.getView(R.id.number_10).setOnClickListener(this);
|
||||
easyPopup.getView(R.id.number_66).setOnClickListener(this);
|
||||
easyPopup.getView(R.id.number_99).setOnClickListener(this);
|
||||
easyPopup.getView(R.id.number_188).setOnClickListener(this);
|
||||
easyPopup.getView(R.id.number_520).setOnClickListener(this);
|
||||
easyPopup.getView(R.id.number_1314).setOnClickListener(this);
|
||||
if (isBag) {
|
||||
easyPopup.getView(R.id.number_all).setVisibility(View.VISIBLE);
|
||||
easyPopup.getView(R.id.number_all).setOnClickListener(this);
|
||||
} else {
|
||||
easyPopup.getView(R.id.number_all).setVisibility(View.GONE);
|
||||
}
|
||||
easyPopup.getView(R.id.number_manual).setOnClickListener(this);
|
||||
|
||||
easyPopup.setOnDismissListener(() -> ivGiftNumberOptions.animate().rotationBy(180).start());
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.ll_gold:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_GIFT_PANEL_TO_RECHARGE, "礼物面板_去充值:" + GIFT_DIALOG_FROM);
|
||||
ChargeDialog.start(getContext());
|
||||
dismiss();
|
||||
break;
|
||||
//送礼物
|
||||
case R.id.btn_send:
|
||||
final GiftInfo finalCurrentGiftInfo = currentGiftInfo;
|
||||
btnSend.setEnabled(false);
|
||||
btnSend.setText("赠送中...");
|
||||
Log.e(TAG, "onClick: indicator type: " + giftIndicator.getCurrrentType());
|
||||
if (!AuthModel.get().isImLogin()) {
|
||||
SingleToastUtil.showToast("网络异常,请重试!");
|
||||
btnSend.setText("赠送");
|
||||
btnSend.setEnabled(true);
|
||||
return;
|
||||
}
|
||||
if (finalCurrentGiftInfo == null) {
|
||||
btnSend.setText("赠送");
|
||||
btnSend.setEnabled(true);
|
||||
return;
|
||||
}
|
||||
String giftMessage = getGiftMessage();
|
||||
if (Objects.equals(giftMessage, "")) {
|
||||
SingleToastUtil.showToast("请输入喊话内容");
|
||||
btnSend.setText("赠送");
|
||||
btnSend.setEnabled(true);
|
||||
} else {
|
||||
GiftModel.get().sendPersonalGift(finalCurrentGiftInfo.getGiftId(), String.valueOf(uid), giftNumber == -1 ? finalCurrentGiftInfo.getCount() : giftNumber,
|
||||
giftMessage,
|
||||
giftIndicator.getCurrrentType() == GiftIndicator.TYPE_KNAP)
|
||||
.doOnError(throwable -> {
|
||||
if (btnSend == null) return;
|
||||
btnSend.setText("赠送");
|
||||
btnSend.setEnabled(true);
|
||||
if (throwable instanceof VipLevelNotEnoughException) {
|
||||
new DialogManager(context).showOkDialog("尚未达到赠送" +
|
||||
finalCurrentGiftInfo.getGiftName() +
|
||||
"所需贵族等级,所需贵族等级:" +
|
||||
finalCurrentGiftInfo.getGiftVipInfo().getVipName());
|
||||
}
|
||||
})
|
||||
.flatMap(serviceResult -> GiftToolbox.sendGiftPrivateChatMessage(serviceResult.getData()))
|
||||
.subscribe(imMessage -> {
|
||||
// 手动更新送礼物的消息
|
||||
MessageListPanelHelper.getInstance().notifyAddMessage(imMessage);
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_PRIVATECHAT_SENDGIFT,
|
||||
"私聊_送礼物");
|
||||
onSendGiftSuccess(finalCurrentGiftInfo);
|
||||
});
|
||||
etGiftMessage.setText("");
|
||||
}
|
||||
|
||||
break;
|
||||
case R.id.number_1:
|
||||
updateNumber(1);
|
||||
break;
|
||||
case R.id.number_10:
|
||||
updateNumber(10);
|
||||
break;
|
||||
case R.id.number_66:
|
||||
updateNumber(66);
|
||||
break;
|
||||
case R.id.number_99:
|
||||
updateNumber(99);
|
||||
break;
|
||||
case R.id.number_188:
|
||||
updateNumber(188);
|
||||
break;
|
||||
case R.id.number_520:
|
||||
updateNumber(520);
|
||||
break;
|
||||
case R.id.number_1314:
|
||||
updateNumber(1314);
|
||||
break;
|
||||
case R.id.number_all:
|
||||
updateNumber(-1);
|
||||
break;
|
||||
case R.id.number_manual:
|
||||
GiftManualQuantityDialog giftManualQuantityDialog = new GiftManualQuantityDialog(context);
|
||||
giftManualQuantityDialog.setOnConfirmClick(new GiftManualQuantityDialog.OnConfirmClick() {
|
||||
@Override
|
||||
public void onConfirm(int quantity) {
|
||||
updateNumber(quantity);
|
||||
giftManualQuantityDialog.dismiss();
|
||||
}
|
||||
});
|
||||
giftManualQuantityDialog.show();
|
||||
easyPopup.dismiss();
|
||||
break;
|
||||
case R.id.gift_number_layout:
|
||||
showEasyPopup();
|
||||
break;
|
||||
case R.id.iv_lucky_bag_intro:
|
||||
if (currentGiftInfo == null) break;
|
||||
DialogWebViewActivity.start(context, UriProvider.getLuckyGiftRule(currentGiftInfo.getGiftId()), true);
|
||||
break;
|
||||
|
||||
case R.id.tv_reload:
|
||||
reloadData(true);
|
||||
break;
|
||||
case R.id.tv_week_star_in:
|
||||
CommonWebViewActivity.start(context, UriProvider.getWeekStarUrl());
|
||||
break;
|
||||
case R.id.tv_tab_send_gift:
|
||||
showGiftTab();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void showGiftTab() {
|
||||
showGiftTab(GiftIndicator.TYPE_NORMAL, null);
|
||||
}
|
||||
|
||||
private void showGiftTab(int position, @Nullable GiftInfo selectGiftInfo) {
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_DRAW_GIFT);
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_PENALTY);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_LUCKY);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_NOBLE);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_WEEK);
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_NORMAL);
|
||||
if (AvRoomDataManager.get().isSingleRoom()) {
|
||||
giftIndicator.showPosition(GiftIndicator.TYPE_SING_ROOM);
|
||||
} else {
|
||||
giftIndicator.hidePosition(GiftIndicator.TYPE_SING_ROOM);
|
||||
}
|
||||
|
||||
giftIndicator.setPosition(position);
|
||||
updateGiftView(giftIndicator.getCurrrentType(), selectGiftInfo);
|
||||
}
|
||||
|
||||
private void onSendGiftSuccess(GiftInfo giftInfo) {
|
||||
if (btnSend == null) return;
|
||||
btnSend.setText("赠送");
|
||||
btnSend.setEnabled(true);
|
||||
}
|
||||
|
||||
private void reloadData(final boolean needShowLoading) {
|
||||
if (needShowLoading) showLoadingView();
|
||||
int currentType = giftIndicator.getCurrrentType();
|
||||
switch (currentType) {
|
||||
case GiftIndicator.TYPE_NORMAL:
|
||||
case GiftIndicator.TYPE_LUCKY:
|
||||
case GiftIndicator.TYPE_NOBLE:
|
||||
case GiftIndicator.TYPE_WEEK:
|
||||
compositeDisposable.add(GiftModel.get().refreshGiftList(null)
|
||||
.subscribe((giftListInfoServiceResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
// 返回结果时,当前选中选项与请求时的选项一样时才显示
|
||||
if (currentType == giftIndicator.getCurrrentType()) {
|
||||
updateGiftView(giftIndicator.getCurrrentType());
|
||||
}
|
||||
} else {
|
||||
if (needShowLoading) showLoadFailedView();
|
||||
}
|
||||
})
|
||||
);
|
||||
break;
|
||||
|
||||
case GiftIndicator.TYPE_KNAP:
|
||||
compositeDisposable.add(GiftModel.get()
|
||||
.requestKnapGiftInfos()
|
||||
.subscribe((listServiceResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
if (currentType == giftIndicator.getCurrrentType()) {
|
||||
updateGiftView(giftIndicator.getCurrrentType());
|
||||
}
|
||||
} else {
|
||||
if (needShowLoading) showLoadFailedView();
|
||||
}
|
||||
})
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private String getGiftMessage() {
|
||||
if (currentGiftInfo != null && currentGiftInfo.isSendMsg()) {
|
||||
if (etGiftMessage.getText().toString().length() == 0) {
|
||||
return getContext().getString(R.string.tips_input_gift_message);
|
||||
} else {
|
||||
if (Objects.equals(etGiftMessage.getText().toString().trim(), "")) {
|
||||
return "";
|
||||
} else {
|
||||
return etGiftMessage.getText().toString().trim();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateNumber(int number) {
|
||||
giftNumber = number;
|
||||
giftNumberText.setText(giftNumber == -1 ? "all" : giftNumber + "");
|
||||
easyPopup.dismiss();
|
||||
}
|
||||
|
||||
private void showEasyPopup() {
|
||||
ivGiftNumberOptions.animate().rotationBy(180).start();
|
||||
easyPopup.showAtAnchorView(giftNumberLayout, VerticalGravity.ABOVE, HorizontalGravity.ALIGN_LEFT,
|
||||
0, -UIUtil.dip2px(context, 11));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
EventBus.getDefault().unregister(this);
|
||||
if (mSubscribe != null) {
|
||||
mSubscribe.dispose();
|
||||
mSubscribe = null;
|
||||
}
|
||||
if (compositeDisposable != null) {
|
||||
compositeDisposable.dispose();
|
||||
compositeDisposable = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onWalletInfoUpdate(UpdateWalletInfoEvent event) {
|
||||
goldWalletInfo = PayModel.get().getCurrentWalletInfo();
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onRecieveGiftKnapMsg(UpdateKnapEvent event) {
|
||||
//刷新背包礼物
|
||||
compositeDisposable.add(GiftModel.get().requestKnapGiftInfos()
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
.subscribe());
|
||||
if (giftIndicator.getCurrrentType() != GiftIndicator.TYPE_KNAP) {
|
||||
return;
|
||||
}
|
||||
int giftId = event.getGiftId();
|
||||
int sendNum = event.getSendNumber();
|
||||
if (ListUtils.isListEmpty(pagerList)) {
|
||||
return;
|
||||
}
|
||||
for (List<GiftInfoVm> page : pagerList) {
|
||||
for (GiftInfoVm item : page) {
|
||||
if (item.data.getGiftId() == giftId) {
|
||||
int count = item.data.getCount() - sendNum;
|
||||
item.data.setCount(Math.max(count, 0));
|
||||
item.updateCount();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
updateTotalPrice();
|
||||
}
|
||||
|
||||
private void onGiftOutOfDate(String message) {
|
||||
((BaseActivity) getContext()).toast(message);
|
||||
}
|
||||
|
||||
}
|
8
app/src/main/res/color/color_selector_gift_all.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:color="@color/text_normal_282828" android:state_selected="true" />
|
||||
|
||||
<item android:color="@color/text_secondary_878b9c" />
|
||||
|
||||
</selector>
|
BIN
app/src/main/res/drawable-xhdpi/ic_arrow_recharge_white.png
Normal file
After Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 181 B After Width: | Height: | Size: 449 B |
BIN
app/src/main/res/drawable-xhdpi/icon_room_send_arrow_white.png
Normal file
After Width: | Height: | Size: 360 B |
21
app/src/main/res/drawable/bg_dialog_private_chat.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:centerColor="@color/white"
|
||||
android:centerX="0.9"
|
||||
android:endColor="#FFF55B"
|
||||
android:startColor="@color/white"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="20dp"
|
||||
android:topRightRadius="20dp" />
|
||||
|
||||
</shape>
|
||||
|
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<solid android:color="#F20D0C11" />
|
||||
<solid android:color="#161722" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="8dp"
|
||||
android:topRightRadius="8dp" />
|
||||
android:topLeftRadius="20dp"
|
||||
android:topRightRadius="20dp" />
|
||||
|
||||
</shape>
|
18
app/src/main/res/drawable/bg_gift_dialog_all.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="@color/color_ffe710" android:startColor="@color/color_ffe710" android:type="linear" android:useLevel="true" />
|
||||
<corners android:radius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFD2D5D7" />
|
||||
<corners android:radius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</selector>
|
@@ -2,18 +2,14 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="true">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180"
|
||||
android:endColor="#5BC8F8"
|
||||
android:startColor="#66D9D9"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners android:bottomLeftRadius="100dp" android:bottomRightRadius="100dp" android:topLeftRadius="100dp" android:topRightRadius="100dp" />
|
||||
<solid android:color="#FFE710" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_enabled="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/color_CCCCCC" />
|
||||
<corners android:radius="50dp" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
@@ -1,29 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#66D9D9" android:startColor="#5BC8F8" android:type="linear" android:useLevel="true" /> <corners android:radius="100dp" />
|
||||
<gradient android:angle="180" android:endColor="@color/color_ffe710" android:startColor="@color/color_ffe710" android:type="linear" android:useLevel="true" />
|
||||
<corners android:radius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_focused="true">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#66D9D9" android:startColor="#5BC8F8" android:type="linear" android:useLevel="true" />
|
||||
<gradient android:angle="180" android:endColor="@color/color_ffe710" android:startColor="@color/color_ffe710" android:type="linear" android:useLevel="true" />
|
||||
<corners android:radius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_enabled="false">
|
||||
<item android:state_enabled="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFD2D5D7" />
|
||||
<gradient android:angle="180" android:endColor="@color/color_ffe710" android:startColor="@color/color_ffe710" android:type="linear" android:useLevel="true" />
|
||||
<corners android:radius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#66D9D9" android:startColor="#5BC8F8" android:type="linear" android:useLevel="true" />
|
||||
<solid android:color="#FFD2D5D7" />
|
||||
<corners android:radius="100dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</selector>
|
||||
|
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#ff21202f" />
|
||||
<corners
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="0dp"
|
||||
android:topRightRadius="20dp" />
|
||||
</shape>
|
@@ -1,9 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/color_1A1A1A" />
|
||||
<corners android:radius="10dp" />
|
||||
<padding
|
||||
android:left="2dp"
|
||||
android:right="2dp" />
|
||||
<solid android:color="@color/black" />
|
||||
<corners android:radius="100dp" />
|
||||
</shape>
|
8
app/src/main/res/drawable/shape_ffe710_20dp_round.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#4dffe710" />
|
||||
|
||||
<corners android:radius="20dp" />
|
||||
</shape>
|
@@ -1,7 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/color_5FCCE4" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
android:width="1.5dp"
|
||||
android:color="#ffe710" />
|
||||
|
||||
<solid android:color="@color/transparent" />
|
||||
|
||||
<corners android:radius="12dp" />
|
||||
|
||||
</shape>
|
13
app/src/main/res/drawable/shape_gift_item_select_room.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?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>
|
@@ -2,7 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/color_5FCCE4"
|
||||
android:color="#FFE710"
|
||||
/>
|
||||
<solid
|
||||
android:color="@color/transparent"
|
||||
|
@@ -56,9 +56,9 @@
|
||||
android:background="@drawable/bg_star_week"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
tools:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
@@ -141,34 +141,15 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.nnbc123.app.ui.widget.TopRoundLinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#01ffffff"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ll_dialog_bottom_gift">
|
||||
|
||||
<com.github.mmin18.widget.RealtimeBlurView
|
||||
android:id="@+id/realtime_blur_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:realtimeBlurRadius="30dp"
|
||||
app:realtimeDownsampleFactor="3"
|
||||
app:realtimeOverlayColor="#CC0D0E2C" />
|
||||
|
||||
</com.nnbc123.app.ui.widget.TopRoundLinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dialog_bottom_gift"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog_room_operation"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:background="@drawable/bg_dialog_room_operation">
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_draw_gift"
|
||||
@@ -219,7 +200,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_tab_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginTop="10dp">
|
||||
@@ -256,19 +237,8 @@
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_marginStart="-4dp"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/shap_red_point" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/pager_view_vip"
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginEnd="15dp" />
|
||||
android:background="@drawable/shap_red_point"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -290,14 +260,13 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="invisible"
|
||||
tools:contentDescription="聊天窗口赠送礼物时才显示"
|
||||
tools:visibility="visible">
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="聊天窗口赠送礼物时才显示">
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="@dimen/dp_38"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:layout_width="@dimen/dp_35"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
@@ -313,14 +282,51 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_avatar_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:visibility="gone"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:text="送给"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/avatar_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_weight="1"
|
||||
tools:layout_height="35dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="66dp"
|
||||
android:layout_height="35dp"
|
||||
android:background="#ff21202f">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_select_all"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bg_gift_dialog_all"
|
||||
android:gravity="center"
|
||||
android:text="全选"
|
||||
android:textColor="@color/color_selector_gift_all"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
@@ -361,7 +367,7 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_gifts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="202dp"
|
||||
android:layout_height="261dp"
|
||||
android:layout_marginTop="@dimen/dp_10">
|
||||
|
||||
<LinearLayout
|
||||
@@ -390,6 +396,7 @@
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:visibility="visible"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -432,8 +439,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="6dp" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -462,20 +469,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.nnbc123.app.ui.gift.dialog.PageIndicatorView
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<EditText
|
||||
@@ -498,30 +491,25 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_recharge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_50">
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:background="#161722">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_recharge"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="25dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@+id/tv_text_gold"
|
||||
android:drawableEnd="@drawable/ic_arrow_recharge"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_13"
|
||||
android:paddingEnd="@dimen/dp_13"
|
||||
android:text="@string/charge"
|
||||
android:textColor="#FFB606"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/shape_black_solid_round"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="9dp"
|
||||
android:paddingEnd="9dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_text_gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:drawableEnd="@drawable/ic_gift_diamond"
|
||||
android:drawableStart="@drawable/ic_gift_diamond"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
@@ -529,6 +517,25 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_recharge"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_arrow_recharge_white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.nnbc123.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/pager_view_vip"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@id/ll_gold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/send_container"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -561,7 +568,7 @@
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/icon_room_send_arrow" />
|
||||
android:src="@drawable/icon_room_send_arrow_white" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
364
app/src/main/res/layout/dialog_private_chat_gift.xml
Normal file
@@ -0,0 +1,364 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_star_week"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="@drawable/bg_star_week"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_week_star_detail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_week_star_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="33dp"
|
||||
tools:layout_width="40dp"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_charm"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/default_avatar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_week_star_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="上期星座月天蝎座星主"
|
||||
android:textColor="#FDE19B"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_week_star_first_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
tools:text="用户昵称" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_week_star_empty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="星座物语,限定开启星座月!"
|
||||
android:textColor="#FDE19B"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.nnbc123.library.widget.DrawableCenterTextView
|
||||
android:id="@+id/tv_week_star_in"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="18dp"
|
||||
android:background="@drawable/shape_black_40_100dp"
|
||||
android:drawableEnd="@drawable/ic_week_star_in_right"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:text="活动详情"
|
||||
android:textColor="#00EEFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dialog_bottom_gift"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog_private_chat"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/ll_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp">
|
||||
|
||||
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
|
||||
android:id="@+id/gift_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="42dp"
|
||||
android:drawableEnd="@drawable/ic_gift_dialog_diamond"
|
||||
android:drawablePadding="2dp"
|
||||
android:fontFamily="@string/sans_serif"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="总价值:0"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_gifts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="261dp"
|
||||
android:layout_marginTop="@dimen/dp_6">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
tools:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_gift_loading" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_loading"
|
||||
android:textColor="@color/white_transparent_20"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:visibility="visible"
|
||||
tools:ignore="SpUsage" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_load_failed"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/tips_gift_load_failed"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:visibility="visible"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reload"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:background="@drawable/shape_round_white_radius_19dp_transparent_16"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_gift_reload"
|
||||
android:textColor="@color/white_transparent_70"
|
||||
android:textSize="@dimen/dp_15"
|
||||
android:visibility="visible"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/gridView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="6dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
tools:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_knap_gift_empty" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_gift_knapsack_empty"
|
||||
android:textColor="@color/white_transparent_20"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_gift_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="34dp"
|
||||
android:background="@color/color_F5F5F5_transparent_5"
|
||||
android:hint="@string/hints_tips_gift_message"
|
||||
android:maxLength="15"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="0dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textColorHint="@color/white_transparent_30"
|
||||
android:textSize="@dimen/dp_14"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SpUsage"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_recharge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:background="@color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/shape_ffe710_20dp_round"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="9dp"
|
||||
android:paddingEnd="9dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_text_gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_gift_diamond"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tv_recharge"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_arrow_recharge" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/send_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@drawable/shape_room_bg_send"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_number_layout"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_number_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:text="1"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift_number_options"
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/icon_room_send_arrow" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_send"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:background="@drawable/bg_magic_dialog_button_send"
|
||||
android:text="赠送"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="14dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -2,7 +2,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="26dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/dp_7"
|
||||
|
@@ -15,26 +15,27 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/gift_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="86dp"
|
||||
android:layout_height="98dp"
|
||||
android:gravity="center"
|
||||
tools:layout_width="100dp">
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:gravity="center">
|
||||
|
||||
<View
|
||||
android:id="@+id/view_room_gift_select"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/shape_gift_item_select"
|
||||
android:background="@{item.isPrivateChat?@drawable/shape_gift_item_select : @drawable/shape_gift_item_select_room}"
|
||||
android:visibility="@{item.isSelect ? View.VISIBLE : View.INVISIBLE}"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_image"
|
||||
nomalUrl="@{item.data().giftUrl}"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:alpha="@{item.isLocked?0.5f:1f}" />
|
||||
|
||||
<TextView
|
||||
@@ -43,12 +44,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/gift_image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@{item.data().giftName}"
|
||||
android:textColor="@{item.isSelect ? @color/color_5FCCE4 : @color/white}"
|
||||
android:textColor="@{item.isPrivateChat? @color/text_normal_282828 : @color/white}"
|
||||
android:textSize="@dimen/dp_10"
|
||||
tools:ignore="SpUsage"
|
||||
tools:text="123" />
|
||||
tools:text="123"
|
||||
tools:textColor="@color/text_secondary_878b9c" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_gold"
|
||||
@@ -57,16 +58,15 @@
|
||||
android:layout_below="@id/gift_name"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:drawableStart="@{item.isSelect?item.radishDrawableSelected:item.radishDrawable}"
|
||||
android:drawableEnd="@drawable/ic_gift_dialog_diamond"
|
||||
android:drawablePadding="2dp"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@{item.goldText}"
|
||||
android:textColor="@{item.isSelect ? @color/color_5FCCE4 : @color/white}"
|
||||
android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/white_transparent_60}"
|
||||
android:textSize="@dimen/dp_10"
|
||||
tools:ignore="SpUsage"
|
||||
tools:text="123" />
|
||||
|
||||
tools:text="123"
|
||||
tools:textColor="@color/white_transparent_60"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -133,7 +133,7 @@
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="3dp"
|
||||
android:text="@{item.countText}"
|
||||
android:textColor="@color/white_transparent_50"
|
||||
android:textColor="@{item.isPrivateChat? @color/text_secondary_878b9c : @color/white}"
|
||||
android:textSize="@dimen/sp_9"
|
||||
android:visibility="@{item.isKnap ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
|
@@ -6,7 +6,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="5dp">
|
||||
|
||||
<com.nnbc123.app.common.widget.CircleImageView
|
||||
@@ -14,16 +13,10 @@
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:cborder_color="#FFE710"
|
||||
app:cborder_width="1dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_all"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/icon_gift_all_mic_ture"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/avatar_cover"
|
||||
android:layout_width="28dp"
|
||||
@@ -44,10 +37,10 @@
|
||||
android:minWidth="@dimen/dp_11"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="3dp"
|
||||
android:textColor="#161958"
|
||||
android:textSize="8sp"
|
||||
android:textColor="@color/text_normal_282828"
|
||||
android:textSize="9sp"
|
||||
app:corner="@dimen/dp_50"
|
||||
app:solid="#5FCCE4"
|
||||
app:solid="#FFE710"
|
||||
tools:text="VIP" />
|
||||
|
||||
</RelativeLayout>
|
@@ -552,7 +552,7 @@
|
||||
<color name="color_fe5d7f">#fe5d7f</color>
|
||||
|
||||
<color name="color_2D93FF">#2D93FF</color>
|
||||
|
||||
<color name="color_ffe710">#FFE710</color>
|
||||
<!-- 音萌UI规范 start-->
|
||||
|
||||
<!-- 主题色 -->
|
||||
|
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 270 B |