私聊改造:私聊礼物面板UI修改
This commit is contained in:
@@ -28,36 +28,38 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
|
|||||||
|
|
||||||
public final ObservableField<String> countText = new ObservableField<>();
|
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 String vipIcon;
|
||||||
|
|
||||||
|
public boolean isPrivateChat;
|
||||||
|
|
||||||
public GiftInfoVm(Context context, GiftInfo data, boolean select, boolean isKnap) {
|
public GiftInfoVm(Context context, GiftInfo data, boolean select, boolean isKnap) {
|
||||||
super(context, data);
|
super(context, data);
|
||||||
this.isSelect.set(select);
|
this.isSelect.set(select);
|
||||||
|
@@ -1,32 +1,19 @@
|
|||||||
package com.mango.moshen.ui.im.actions;
|
package com.mango.moshen.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.mango.moshen.R;
|
import com.mango.moshen.R;
|
||||||
import com.mango.moshen.common.widget.dialog.DialogManager;
|
|
||||||
import com.mango.moshen.ui.widget.GiftDialog;
|
import com.mango.moshen.ui.widget.GiftDialog;
|
||||||
import com.mango.core.gift.GiftModel;
|
import com.mango.moshen.ui.widget.PrivateChatGiftDialog;
|
||||||
import com.mango.core.gift.bean.GiftInfo;
|
import com.netease.nim.uikit.business.session.actions.BaseAction;
|
||||||
import com.mango.core.gift.toolbox.GiftToolbox;
|
|
||||||
import com.mango.core.room.queue.bean.MicMemberInfo;
|
|
||||||
import com.mango.core.statistic.StatisticManager;
|
|
||||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
|
||||||
import com.mango.core.utils.net.VipLevelNotEnoughException;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by xiaoyu
|
* Created by xiaoyu
|
||||||
* on 2017/10/2.
|
* 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() {
|
public GiftAction() {
|
||||||
super(R.drawable.icon_gift_action, R.string.gift_action);
|
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() {
|
public void onClick() {
|
||||||
if (giftDialog == null) {
|
if (giftDialog == null) {
|
||||||
GiftDialog.GIFT_DIALOG_FROM = "私聊";
|
GiftDialog.GIFT_DIALOG_FROM = "私聊";
|
||||||
|
giftDialog = new PrivateChatGiftDialog(getActivity(), Long.valueOf(getAccount()));
|
||||||
giftDialog = new GiftDialog(getActivity(), Long.valueOf(getAccount()), false, false, true);
|
|
||||||
giftDialog.setGiftDialogBtnClickListener(this);
|
|
||||||
giftDialog.setOnDismissListener(dialog -> giftDialog = null);
|
giftDialog.setOnDismissListener(dialog -> giftDialog = null);
|
||||||
}
|
}
|
||||||
if (!giftDialog.isShowing()) {
|
if (!giftDialog.isShowing()) {
|
||||||
giftDialog.show();
|
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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@@ -0,0 +1,902 @@
|
|||||||
|
package com.mango.moshen.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.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.mango.core.UriProvider;
|
||||||
|
import com.mango.core.auth.AuthModel;
|
||||||
|
import com.mango.core.gift.GiftModel;
|
||||||
|
import com.mango.core.gift.bean.GiftInfo;
|
||||||
|
import com.mango.core.gift.bean.GiftTab;
|
||||||
|
import com.mango.core.gift.bean.GiftType;
|
||||||
|
import com.mango.core.gift.event.UpdateKnapEvent;
|
||||||
|
import com.mango.core.gift.toolbox.GiftToolbox;
|
||||||
|
import com.mango.core.initial.InitialModel;
|
||||||
|
import com.mango.core.initial.bean.InitInfo;
|
||||||
|
import com.mango.core.manager.AvRoomDataManager;
|
||||||
|
import com.mango.core.manager.IMNetEaseManager;
|
||||||
|
import com.mango.core.manager.RoomEvent;
|
||||||
|
import com.mango.core.pay.PayModel;
|
||||||
|
import com.mango.core.pay.bean.WalletInfo;
|
||||||
|
import com.mango.core.pay.event.UpdateWalletInfoEvent;
|
||||||
|
import com.mango.core.statistic.StatisticManager;
|
||||||
|
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||||
|
import com.mango.core.utils.net.RxHelper;
|
||||||
|
import com.mango.core.utils.net.VipLevelNotEnoughException;
|
||||||
|
import com.mango.moshen.BR;
|
||||||
|
import com.mango.moshen.R;
|
||||||
|
import com.mango.moshen.base.BaseActivity;
|
||||||
|
import com.mango.moshen.common.widget.CircleImageView;
|
||||||
|
import com.mango.moshen.common.widget.dialog.DialogManager;
|
||||||
|
import com.mango.moshen.ui.gift.dialog.GiftInfoVm;
|
||||||
|
import com.mango.moshen.ui.gift.dialog.PageIndicatorView;
|
||||||
|
import com.mango.moshen.ui.pay.ChargeDialog;
|
||||||
|
import com.mango.moshen.ui.utils.ImageLoadUtils;
|
||||||
|
import com.mango.moshen.ui.webview.CommonWebViewActivity;
|
||||||
|
import com.mango.moshen.ui.webview.DialogWebViewActivity;
|
||||||
|
import com.mango.moshen.ui.widget.dialog.GiftManualQuantityDialog;
|
||||||
|
import com.mango.moshen.ui.widget.magicindicator.GiftIndicator;
|
||||||
|
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||||
|
import com.mango.moshen.utils.SpannableBuilder;
|
||||||
|
import com.mango.xchat_android_library.bindinglist.IItem;
|
||||||
|
import com.mango.xchat_android_library.bindinglist.MultiTypeAdapter;
|
||||||
|
import com.mango.xchat_android_library.utils.FormatUtils;
|
||||||
|
import com.mango.xchat_android_library.utils.ListUtils;
|
||||||
|
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||||
|
import com.mango.xchat_android_library.utils.TextWatcherWrapper;
|
||||||
|
import com.mango.xchat_android_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 PageIndicatorView indicator;
|
||||||
|
private EditText etGiftMessage;
|
||||||
|
private TextView 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 = 0f;
|
||||||
|
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("#BABBCD"),
|
||||||
|
Color.parseColor("#171A58")
|
||||||
|
);
|
||||||
|
|
||||||
|
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);
|
||||||
|
indicator.setVisibility(View.INVISIBLE);
|
||||||
|
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);
|
||||||
|
indicator = findViewById(R.id.indicator);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
|
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, 8, 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.INVISIBLE);
|
||||||
|
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);
|
||||||
|
indicator.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showLoadFailedView() {
|
||||||
|
layoutLoading.setVisibility(View.GONE);
|
||||||
|
layoutLoadFailed.setVisibility(View.VISIBLE);
|
||||||
|
layoutEmpty.setVisibility(View.GONE);
|
||||||
|
gridView.setVisibility(View.GONE);
|
||||||
|
etGiftMessage.setVisibility(View.GONE);
|
||||||
|
indicator.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);
|
||||||
|
indicator.setVisibility(View.VISIBLE);
|
||||||
|
sendContainer.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setGridViewData(List<List<GiftInfoVm>> pagerList) {
|
||||||
|
if (ListUtils.isListEmpty(pagerList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
indicator.initIndicator(pagerList.size());
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
indicator.setSelectedPage(defaultSelectPage);
|
||||||
|
layoutEmpty.setVisibility(View.GONE);
|
||||||
|
gridView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
indicator.setVisibility(pagerList.size() > 1 ? View.VISIBLE : View.INVISIBLE);
|
||||||
|
SparseArray<RecyclerView> 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) {
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
MultiTypeAdapter<GiftInfoVm> giftAdapter;
|
||||||
|
if (cacheItemView.get(pagePos) == null) {
|
||||||
|
recyclerView = new RecyclerView(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);
|
||||||
|
gridView.addOnPageChangeListener(new OnPageSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onPageSelected(int position) {
|
||||||
|
if (pagerList.size() > 1) {
|
||||||
|
indicator.setSelectedPage(position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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.tv_recharge:
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
21
app/src/main/res/drawable/bg_dialog_private_chat.xml
Normal file
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="#e5ffff"
|
||||||
|
android:startColor="@color/white"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="0dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="12dp"
|
||||||
|
android:topRightRadius="12dp" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
|
|
371
app/src/main/res/layout/dialog_private_chat_gift.xml
Normal file
371
app/src/main/res/layout/dialog_private_chat_gift.xml
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
<?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.mango.moshen.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.mango.xchat_android_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:orientation="vertical"
|
||||||
|
android:background="@drawable/bg_dialog_private_chat"
|
||||||
|
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="44dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingEnd="8dp">
|
||||||
|
|
||||||
|
<com.mango.moshen.ui.widget.magicindicator.GiftIndicator
|
||||||
|
android:id="@+id/gift_indicator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_gift_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
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="#BABBCD"
|
||||||
|
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="202dp"
|
||||||
|
android:layout_marginTop="@dimen/dp_10">
|
||||||
|
|
||||||
|
<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_15"
|
||||||
|
android:layout_marginEnd="@dimen/dp_15"
|
||||||
|
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>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.mango.moshen.ui.gift.dialog.PageIndicatorView
|
||||||
|
android:id="@+id/indicator"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="6dp"
|
||||||
|
android:layout_marginTop="4dp" />
|
||||||
|
|
||||||
|
</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">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_recharge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
<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:drawablePadding="3dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:text="0"
|
||||||
|
android:textColor="#5FCCE4"
|
||||||
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
|
<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="65dp"
|
||||||
|
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="#1A1A1A"
|
||||||
|
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="65dp"
|
||||||
|
android:layout_height="@dimen/dp_30"
|
||||||
|
android:background="@drawable/bg_magic_dialog_button_send"
|
||||||
|
android:text="赠送"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -45,7 +45,7 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="3dp"
|
||||||
android:text="@{item.data().giftName}"
|
android:text="@{item.data().giftName}"
|
||||||
android:textColor="@{item.isSelect ? @color/color_5FCCE4 : @color/white}"
|
android:textColor="@{item.isSelect ? @color/color_5FCCE4 :(item.isPrivateChat? @color/color_1A1A1A : @color/white)}"
|
||||||
android:textSize="@dimen/dp_10"
|
android:textSize="@dimen/dp_10"
|
||||||
tools:ignore="SpUsage"
|
tools:ignore="SpUsage"
|
||||||
tools:text="123" />
|
tools:text="123" />
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:text="@{item.goldText}"
|
android:text="@{item.goldText}"
|
||||||
android:textColor="@{item.isSelect ? @color/color_5FCCE4 : @color/white}"
|
android:textColor="@{item.isSelect ? @color/color_5FCCE4 :(item.isPrivateChat? @color/text_hint_555574 : @color/white)}"
|
||||||
android:textSize="@dimen/dp_10"
|
android:textSize="@dimen/dp_10"
|
||||||
tools:ignore="SpUsage"
|
tools:ignore="SpUsage"
|
||||||
tools:text="123" />
|
tools:text="123" />
|
||||||
|
Reference in New Issue
Block a user