diff --git a/common/src/main/java/com/yunbao/common/views/GiftNumberPopup.java b/common/src/main/java/com/yunbao/common/views/GiftNumberPopup.java index 54ddcdfea..bb9057ec9 100644 --- a/common/src/main/java/com/yunbao/common/views/GiftNumberPopup.java +++ b/common/src/main/java/com/yunbao/common/views/GiftNumberPopup.java @@ -6,6 +6,7 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.lxj.xpopup.XPopup; import com.lxj.xpopup.core.BottomPopupView; import com.yunbao.common.R; import com.yunbao.common.adapter.GiftNumberAdapter; @@ -41,6 +42,23 @@ public class GiftNumberPopup extends BottomPopupView { @Override public void onViewClicks() { dismiss(); + Bus.get().post(new GiftNumberEvent().setmCount("-1")); + } + }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.custom_quantity), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + dismiss(); + new XPopup.Builder(getContext()) + .asCustom(new InputCustomPopup(getContext(), + getContext().getString(R.string.the_title_financier3), + R.string.custom_quantity,true).setListener(new InputCustomPopup.InputCustomListener() { + @Override + public void onConfirm(String text) { + Bus.get().post(new GiftNumberEvent().setmCount(text)); + } + })).show(); + } }); } diff --git a/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java b/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java index bfffdb1d5..b2598cd14 100644 --- a/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java @@ -1,6 +1,7 @@ package com.yunbao.common.views; import android.content.Context; +import android.text.InputType; import android.text.TextUtils; import android.view.View; import android.widget.EditText; @@ -20,6 +21,7 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake; public class InputCustomPopup extends CenterPopupView { private String message = ""; private int title = R.string.dialog_tip; + private boolean isType; public InputCustomPopup(@NonNull Context context, String message, int title) { super(context); @@ -27,7 +29,14 @@ public class InputCustomPopup extends CenterPopupView { this.title = title; } - public InputCustomPopup(@NonNull Context context,int title) { + public InputCustomPopup(@NonNull Context context, String message, int title, boolean isType) { + super(context); + this.message = message; + this.title = title; + this.isType = isType; + } + + public InputCustomPopup(@NonNull Context context, int title) { super(context); this.title = title; } @@ -44,7 +53,13 @@ public class InputCustomPopup extends CenterPopupView { super.onCreate(); EditText content = findViewById(R.id.content); TextView titleText = findViewById(R.id.title); - content.setText(message); + + if (isType) { + content.setHint(message); + content.setInputType(InputType.TYPE_CLASS_NUMBER); + } else { + content.setText(message); + } titleText.setText(title); findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() { @Override diff --git a/common/src/main/res/layout/view_live_gift_number.xml b/common/src/main/res/layout/view_live_gift_number.xml index 241947d70..8d9958c16 100644 --- a/common/src/main/res/layout/view_live_gift_number.xml +++ b/common/src/main/res/layout/view_live_gift_number.xml @@ -15,7 +15,7 @@ 冠名主播: 冠名金主: 冠名 + 请输入自定义数量 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index 3e99a8762..34cb9db3e 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -640,8 +640,9 @@ public class LiveGiftPopup extends AbsDialogFragment { @Subscribe(threadMode = ThreadMode.MAIN) public void onGiftNumberEvent(GiftNumberEvent event) { if (TextUtils.equals(event.getmCount(), "-1")) { - + ImgLoader.display(getContext(), R.mipmap.icon_arrow_right_2, iconArrow); } else { + ImgLoader.display(getContext(), R.mipmap.icon_arrow_right_2, iconArrow); mCount = event.getmCount(); giftNumber.setText(mCount); }