From 1346a1de5244f2c0a432fa3840e6e5937e76f68d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 18 Nov 2022 17:28:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 4 +- .../live/activity/WebViewActivityMedal.java | 24 ++---- .../yunbao/main/activity/MainActivity.java | 42 +++++------ .../yunbao/main/adapter/MainListAdapter.java | 73 +++++++++---------- .../yunbao/main/adapter/SettingAdapter.java | 4 +- .../yunbao/main/views/MainMeViewHolder.java | 4 +- 6 files changed, 67 insertions(+), 84 deletions(-) diff --git a/config.gradle b/config.gradle index 1115407de..8b066aa90 100644 --- a/config.gradle +++ b/config.gradle @@ -5,7 +5,7 @@ ext { minSdkVersion : 21, targetSdkVersion : 31, versionCode : 302, - versionName : "6.4.4" + versionName : "6.4.5" ] manifestPlaceholders = [ //正式 @@ -25,7 +25,7 @@ ext { baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false - isGooglePlay : false, + isGooglePlay : true, //是否上报异常日志 isUploadLog : true ] diff --git a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java index df4dffae0..9a7f36b66 100644 --- a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java +++ b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java @@ -8,7 +8,6 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.provider.MediaStore; -import androidx.annotation.RequiresApi; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -22,19 +21,21 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; +import androidx.annotation.RequiresApi; + import com.alibaba.fastjson.JSON; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; import com.yunbao.common.R; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; -import com.yunbao.common.bean.LiveBean; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; @@ -168,7 +169,6 @@ public class WebViewActivityMedal extends AbsActivity { } } - private LiveRoomCheckLivePresenter mCheckLivePresenter; private void gotoLive(final String live_id) { LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() { @@ -177,22 +177,10 @@ public class WebViewActivityMedal extends AbsActivity { 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/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 2c886c223..c88d5e068 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -42,7 +42,6 @@ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.jakewharton.rxbinding3.view.RxView; import com.lzf.easyfloat.EasyFloat; -import com.lzf.easyfloat.interfaces.OnPermissionResult; import com.lzf.easyfloat.permission.PermissionUtils; import com.tencent.imsdk.v2.V2TIMCallback; import com.tencent.imsdk.v2.V2TIMManager; @@ -91,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; @@ -204,7 +202,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene CommonHttpUtil.getConfig(mContext, new CommonCallback() { @Override public void callback(ConfigBean bean) { - if(bean==null){ + if (bean == null) { return; } //是否需要老用户回归弹窗 @@ -630,25 +628,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); + } + } @@ -731,7 +726,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene bundle.putString("send_exp", obj.getString("send_exp")); bundle.putString("sign_day", obj.getString("sign_day")); fragment.setArguments(bundle); - if(!getSupportFragmentManager().isStateSaved()) { + if (!getSupportFragmentManager().isStateSaved()) { fragment.show(getSupportFragmentManager(), "SigninDialog"); } } @@ -938,6 +933,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene mMainHomeCommunityViewHolder.loadNewUrl(); } } + @Override public void onBackPressed() { if (isTabClose && isWebClose) { diff --git a/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java index 6f8584617..326f45377 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java @@ -23,10 +23,9 @@ import com.yunbao.common.custom.MyRadioButton; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.utils.CommonIconUtil; -import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.SVGAViewUtils; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; -import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.main.R; import com.yunbao.main.bean.ListBean; @@ -69,51 +68,51 @@ public class MainListAdapter extends RefreshAdapter { mItemClickListener = new View.OnClickListener() { @Override public void onClick(View v) { - ViewClicksAntiShake.clicksAntiShake(v, () -> { - Object tag = v.getTag(); - if (tag != null && mOnItemClickListener != null) { - ListBean model = (ListBean) tag; - if (model.isHide()) { - ToastUtil.show(R.string.can_not_go); - } else { - mOnItemClickListener.onItemClick(model, 0); - } + Object tag = v.getTag(); + if (tag != null && mOnItemClickListener != null) { + ListBean model = (ListBean) tag; + if (model.isHide()) { + ToastUtil.show(R.string.can_not_go); + } else { + mOnItemClickListener.onItemClick(model, 0); } - }); + + } + } }; mFollowClickListener1 = new View.OnClickListener() { @Override public void onClick(View v) { - ViewClicksAntiShake.clicksAntiShake(v, () -> { - if (!canClick()) { - return; - } - Object tag = v.getTag(); - if (tag != null) { - final ListBean bean = (ListBean) tag; - CommonHttpUtil.setAttention(bean.getUid(), null); - } - }); + + if (!canClick()) { + return; + } + Object tag = v.getTag(); + if (tag != null) { + final ListBean bean = (ListBean) tag; + CommonHttpUtil.setAttention(bean.getUid(), null); + } + } }; mFollowClickListener2 = new View.OnClickListener() { @Override public void onClick(View v) { - ViewClicksAntiShake.clicksAntiShake(v, () -> { - if (!canClick()) { - return; - } - Object tag = v.getTag(); - if (tag != null) { - final int position = (int) tag; - final ListBean bean = mList.get(position); - CommonHttpUtil.setAttention(bean.getUid(), null); - } - }); + + if (!canClick()) { + return; + } + Object tag = v.getTag(); + if (tag != null) { + final int position = (int) tag; + final ListBean bean = mList.get(position); + CommonHttpUtil.setAttention(bean.getUid(), null); + } + } }; @@ -288,7 +287,7 @@ public class MainListAdapter extends RefreshAdapter { public void onComplete(SVGAVideoEntity videoItem) { SVGADrawable drawable = new SVGADrawable(videoItem); svga1.setImageDrawable(drawable); - SVGAViewUtils.playEndClear(svga1,false); + SVGAViewUtils.playEndClear(svga1, false); } @Override @@ -365,7 +364,7 @@ public class MainListAdapter extends RefreshAdapter { public void onComplete(SVGAVideoEntity videoItem) { SVGADrawable drawable = new SVGADrawable(videoItem); svga2.setImageDrawable(drawable); - SVGAViewUtils.playEndClear(svga2,false); + SVGAViewUtils.playEndClear(svga2, false); } @Override @@ -441,7 +440,7 @@ public class MainListAdapter extends RefreshAdapter { public void onComplete(SVGAVideoEntity videoItem) { SVGADrawable drawable = new SVGADrawable(videoItem); svga3.setImageDrawable(drawable); - SVGAViewUtils.playEndClear(svga3,false); + SVGAViewUtils.playEndClear(svga3, false); } @Override @@ -544,7 +543,7 @@ public class MainListAdapter extends RefreshAdapter { public void onComplete(SVGAVideoEntity videoItem) { SVGADrawable drawable = new SVGADrawable(videoItem); svga.setImageDrawable(drawable); - SVGAViewUtils.playEndClear(svga,false); + SVGAViewUtils.playEndClear(svga, false); } @Override 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 88f5ba1fc..d4d3e05f2 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SettingAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SettingAdapter.java @@ -45,7 +45,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; @@ -54,7 +54,7 @@ public class SettingAdapter extends RecyclerView.Adapter { mOnItemClickListener.onItemClick(bean, position); } } - }); + } }; 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 740285f63..0cd438588 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -452,7 +452,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)); @@ -477,7 +477,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); } - }); +