From 3deb3693b3b3d956da056b5529adb20a5ebcbfcc Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 18 Nov 2022 17:40:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/main/activity/MainActivity.java | 36 +++++++++---------- .../yunbao/main/adapter/SettingAdapter.java | 4 +-- .../views/MainHomeCommunityViewHolder.java | 25 ++++--------- .../yunbao/main/views/MainMeViewHolder.java | 4 +-- 4 files changed, 27 insertions(+), 42 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index d967f9e68..0def9b415 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -90,7 +90,6 @@ import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.floatingview.APPEasyFloat; import com.yunbao.common.views.weight.LiveFloatView; -import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; @@ -634,25 +633,22 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene // }); public void mainClick(View v) { - ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() { - @Override - public void onViewClicks() { - if (!canClick()) { - return; - } - int i = v.getId(); - if (i == R.id.btn_start) { - showStartDialog(); - } else if (i == R.id.btn_search) { - SearchActivity.forward(mContext); - } else if (i == R.id.btn_follow) { - //关注 - FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0); - } else if (i == R.id.img_trophy) { - MainListActivity.forward(mContext, 0); - } - } - }); + + if (!canClick()) { + return; + } + int i = v.getId(); + if (i == R.id.btn_start) { + showStartDialog(); + } else if (i == R.id.btn_search) { + SearchActivity.forward(mContext); + } else if (i == R.id.btn_follow) { + //关注 + FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0); + } else if (i == R.id.img_trophy) { + MainListActivity.forward(mContext, 0); + } + } diff --git a/main/src/main/java/com/yunbao/main/adapter/SettingAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SettingAdapter.java index b1ce5e971..22e04c560 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SettingAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SettingAdapter.java @@ -46,7 +46,7 @@ public class SettingAdapter extends RecyclerView.Adapter { mOnClickListener = new View.OnClickListener() { @Override public void onClick(View v) { - ViewClicksAntiShake.clicksAntiShake(v, () -> { + Object tag = v.getTag(); if (tag != null) { int position = (int) tag; @@ -58,7 +58,7 @@ public class SettingAdapter extends RecyclerView.Adapter { mOnItemClickListener.onItemClick(bean, position); } } - }); + } }; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index b5c4924f5..e6935af5e 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -227,34 +227,23 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl } - private LiveRoomCheckLivePresenter mCheckLivePresenter; private void gotoLive(final String live_id) { - LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() { + LiveHttpUtil.getLiveInfo(live_id + "", new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { if (code == 0 && info.length > 0) { LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); - if (mCheckLivePresenter == null) { - mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() { - @Override - public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) { - if (liveBean == null) { - return; - } - - LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk); - - } - }); - } - mCheckLivePresenter.checkLive(liveBean); + LiveAudienceActivity.forward(mContext, liveBean, 0, 0, "", 0, 0); } else { - RouteUtil.forwardUserHome(mContext, live_id, 0); + + RouteUtil.forwardUserHome(mContext, String.valueOf(live_id), 0); + } } - } + }); + } diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index b4f485e84..2395b6539 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -456,7 +456,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi @Override public void onClick(View v) { - ViewClicksAntiShake.clicksAntiShake(v, () -> { + int i = v.getId(); if (i == R.id.lt_name) { mContext.startActivity(new Intent(mContext, EditProfileActivity.class)); @@ -481,7 +481,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid(); ZhuangBanActivity.forward(mContext, url, false); } - }); +