修改防抖点击问题

This commit is contained in:
18401019693 2023-05-22 16:48:55 +08:00
parent 055d002a34
commit 4f103dadc9
3 changed files with 35 additions and 22 deletions

View File

@ -12,6 +12,7 @@ import com.lxj.xpopup.animator.PopupAnimator;
import com.lxj.xpopup.core.CenterPopupView;
import com.yunbao.common.R;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
/**
* 输入弹窗
@ -54,15 +55,21 @@ public class InputCustomPopup extends CenterPopupView {
findViewById(R.id.btn_confirm).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String textContent = content.getText().toString();
if (TextUtils.isEmpty(textContent)) {
ToastUtil.show("输入内容不可为空");
return;
}
if (listener != null) {
listener.onConfirm(textContent);
}
dismiss(); // 关闭弹窗
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
String textContent = content.getText().toString();
if (TextUtils.isEmpty(textContent)) {
ToastUtil.show("输入内容不可为空");
return;
}
if (listener != null) {
listener.onConfirm(textContent);
}
dismiss(); // 关闭弹窗
}
});
}
});
}

View File

@ -32,12 +32,11 @@
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp"
android:layout_marginRight="20dp"
android:padding="5dp"
android:src="@mipmap/icon_live_ready_close"
android:tint="@color/white"
/>
android:tint="@color/white" />
<LinearLayout
android:layout_width="match_parent"

View File

@ -52,6 +52,7 @@ import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.main.R;
@ -168,18 +169,24 @@ public class LoginActivity extends AbsActivity {
public void loginClick(View v) {
int i = v.getId();
if (i == R.id.btn_login) {
login();
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
int i = v.getId();
if (i == R.id.btn_login) {
login();
} else if (i == R.id.btn_register) {
register();
} else if (i == R.id.btn_forget_pwd) {
forgetPwd();
} else if (i == R.id.btn_register) {
register();
} else if (i == R.id.btn_forget_pwd) {
forgetPwd();
} else if (i == R.id.btn_tip) {
forwardTip();
}
}
});
} else if (i == R.id.btn_tip) {
forwardTip();
}
}
//注册