6.5.4礼物冠名

This commit is contained in:
18401019693 2023-08-04 15:50:32 +08:00
parent 45c256cbbb
commit 545c69ff8b
5 changed files with 39 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.core.BottomPopupView; import com.lxj.xpopup.core.BottomPopupView;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.adapter.GiftNumberAdapter; import com.yunbao.common.adapter.GiftNumberAdapter;
@ -41,6 +42,23 @@ public class GiftNumberPopup extends BottomPopupView {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
dismiss(); 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();
} }
}); });
} }

View File

@ -1,6 +1,7 @@
package com.yunbao.common.views; package com.yunbao.common.views;
import android.content.Context; import android.content.Context;
import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
@ -20,6 +21,7 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
public class InputCustomPopup extends CenterPopupView { public class InputCustomPopup extends CenterPopupView {
private String message = ""; private String message = "";
private int title = R.string.dialog_tip; private int title = R.string.dialog_tip;
private boolean isType;
public InputCustomPopup(@NonNull Context context, String message, int title) { public InputCustomPopup(@NonNull Context context, String message, int title) {
super(context); super(context);
@ -27,7 +29,14 @@ public class InputCustomPopup extends CenterPopupView {
this.title = title; 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); super(context);
this.title = title; this.title = title;
} }
@ -44,7 +53,13 @@ public class InputCustomPopup extends CenterPopupView {
super.onCreate(); super.onCreate();
EditText content = findViewById(R.id.content); EditText content = findViewById(R.id.content);
TextView titleText = findViewById(R.id.title); TextView titleText = findViewById(R.id.title);
if (isType) {
content.setHint(message);
content.setInputType(InputType.TYPE_CLASS_NUMBER);
} else {
content.setText(message); content.setText(message);
}
titleText.setText(title); titleText.setText(title);
findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() { findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() {
@Override @Override

View File

@ -15,7 +15,7 @@
<LinearLayout <LinearLayout
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="212dp" android:layout_height="190dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginEnd="48dp" android:layout_marginEnd="48dp"

View File

@ -1299,5 +1299,6 @@ Limited ride And limited avatar frame</string>
<string name="title_anchor">冠名主播:</string> <string name="title_anchor">冠名主播:</string>
<string name="the_title_financier">冠名金主:</string> <string name="the_title_financier">冠名金主:</string>
<string name="the_title_financier2">冠名</string> <string name="the_title_financier2">冠名</string>
<string name="the_title_financier3">请输入自定义数量</string>
</resources> </resources>

View File

@ -640,8 +640,9 @@ public class LiveGiftPopup extends AbsDialogFragment {
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onGiftNumberEvent(GiftNumberEvent event) { public void onGiftNumberEvent(GiftNumberEvent event) {
if (TextUtils.equals(event.getmCount(), "-1")) { if (TextUtils.equals(event.getmCount(), "-1")) {
ImgLoader.display(getContext(), R.mipmap.icon_arrow_right_2, iconArrow);
} else { } else {
ImgLoader.display(getContext(), R.mipmap.icon_arrow_right_2, iconArrow);
mCount = event.getmCount(); mCount = event.getmCount();
giftNumber.setText(mCount); giftNumber.setText(mCount);
} }