From 58c988a83aa74bc99c1e82d4e7e16667d041ce02 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 12 Apr 2023 13:15:33 +0800 Subject: [PATCH 01/21] =?UTF-8?q?=E4=BF=AE=E5=A4=8DACache=E8=AF=BB?= =?UTF-8?q?=E5=A4=9A=E8=A1=8C=E6=96=87=E6=9C=AC=E6=9C=AA=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/yunbao/common/manager/base/ACache.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/yunbao/common/manager/base/ACache.java b/common/src/main/java/com/yunbao/common/manager/base/ACache.java index 3876b7f00..d414eb9cb 100644 --- a/common/src/main/java/com/yunbao/common/manager/base/ACache.java +++ b/common/src/main/java/com/yunbao/common/manager/base/ACache.java @@ -22,6 +22,7 @@ import android.graphics.Canvas; import android.graphics.PixelFormat; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; +import android.util.Log; import org.json.JSONArray; import org.json.JSONObject; @@ -160,7 +161,7 @@ public class ACache { String readString = ""; String currentLine; while ((currentLine = in.readLine()) != null) { - readString += currentLine; + readString += currentLine+"\n"; } if (!Utils.isDue(readString)) { return Utils.clearDateInfo(readString); From bec764a329e2aa9230329fcaf33f1f057190f805 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 12 Apr 2023 15:26:57 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=8E=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=97=B4=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E8=BF=9B?= =?UTF-8?q?=E5=8E=BB=E7=9A=84=E5=88=86=E4=BA=AB=E6=8C=89=E9=92=AE=E6=B2=A1?= =?UTF-8?q?=E5=8F=8D=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/main/activity/MyWebViewActivity.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java index 8b97bf421..6800b945f 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java @@ -58,6 +58,7 @@ import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.live.views.LiveRoomViewHolder; import com.yunbao.main.dialog.EncourageDialog; import com.yunbao.main.http.MainHttpUtil; +import com.yunbao.share.ui.SharePopDialog; import com.yunbao.video.activity.VideoPlayActivity; import com.yunbao.video.utils.VideoStorge; @@ -581,6 +582,12 @@ public class MyWebViewActivity extends AbsActivity { } } }); + } else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) { + JSONObject json = JSONObject.parseObject(event.getData()); + new SharePopDialog(mContext) + .setShareLink(CommonAppConfig.HOST+json.getString("link")) + .setAnchorAvatar(json.getString("avatar")) + .showDialog(); } } } From 499b73295d7e2022b2a6157b1a0ab5531e972236 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 13 Apr 2023 10:07:42 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=BA=E6=B0=94?= =?UTF-8?q?=E7=A5=A8=E6=B2=A1=E4=BC=A0liveuid=E5=92=8Cstream=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/dialog/LiveHDDialogFragment.java | 22 ++++++++++--------- .../yunbao/live/views/LiveRoomViewHolder.java | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java index d4c593d8c..22298060a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -2,6 +2,7 @@ package com.yunbao.live.dialog; import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid; +import static com.yunbao.live.views.LiveRoomViewHolder.mStream; import android.content.DialogInterface; import android.graphics.Color; @@ -66,7 +67,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { private String roomId; private DialogInterface.OnShowListener listener; private TextView htmlError; - private boolean isSetHeight =false; + private boolean isSetHeight = false; public LiveHDDialogFragment() { @@ -180,7 +181,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { findViewById(R.id.title_laout).setVisibility(View.VISIBLE); } if (bundle.getInt("height", -1) != -1) { - isSetHeight =true; + isSetHeight = true; LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, bundle.getInt("height", -1)); mWebView.setLayoutParams(params); } @@ -189,7 +190,9 @@ public class LiveHDDialogFragment extends AbsDialogFragment { params.width = bundle.getInt("width", -1); mWebView.setLayoutParams(params); } - mWebView.loadUrl(bundle.getString("url")); + String url = bundle.getString("url"); + url += "&anchorUid=" + mLiveUid+"&stream="+mStream; + mWebView.loadUrl(url); mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { @@ -201,7 +204,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { @Override public void onPageFinished(WebView view, String url) { - if(!isSetHeight) { + if (!isSetHeight) { view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth,true)"); } if (listener != null) { @@ -236,7 +239,6 @@ public class LiveHDDialogFragment extends AbsDialogFragment { } - private void gotoLive(final String live_id) { if (!TextUtils.equals(roomId, live_id)) { LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() { @@ -250,7 +252,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { if (liveBean == null) { return; } - if(MicStatusManager.getInstance().isMic(liveUid)){ + if (MicStatusManager.getInstance().isMic(liveUid)) { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } @@ -341,7 +343,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { dismiss(); ((LiveAudienceActivity) mContext).openGiftWindow(); } else if (TextUtils.equals(event.getMethod(), "androidGoBack")) { - dismiss(); + // dismiss(); } else if (TextUtils.equals(event.getMethod(), "androidMethodLookToLive")) { if (mContext instanceof LiveRyAnchorActivity) { return; @@ -363,13 +365,13 @@ public class LiveHDDialogFragment extends AbsDialogFragment { ); } //守護 - }else if(TextUtils.equals(event.getMethod(), "BuyProtection")){ + } else if (TextUtils.equals(event.getMethod(), "BuyProtection")) { ((LiveActivity) mContext).openNewBuyGuardWindow(event.getData()); - }else if(TextUtils.equals(event.getMethod(), "BuyVIP")){ + } else if (TextUtils.equals(event.getMethod(), "BuyVIP")) { UserBean u = CommonAppConfig.getInstance().getUserBean(); String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&uid=" - + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&active="+event.getData()+ "&anchorUid=" + mLiveUid; + + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&active=" + event.getData() + "&anchorUid=" + mLiveUid; ZhuangBanActivity.forward(mContext, url, false); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 73d800acb..4b8bf6f34 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -212,7 +212,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private ImageView avatarOther; private View mBtnRedPack; public static String mLiveUid; - private static String mStream; + public static String mStream; private LiveLightAnimPresenter mLightAnimPresenter; private LiveEnterRoomAnimPresenter mLiveEnterRoomAnimPresenter; private LiveDanmuPresenter mLiveDanmuPresenter; From af4176bcb76321107bdb0af0a2961456e20d015f Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 13 Apr 2023 10:43:07 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E7=A7=BB=E9=99=A4ACache=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E5=90=8E=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/yunbao/common/manager/base/ACache.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/yunbao/common/manager/base/ACache.java b/common/src/main/java/com/yunbao/common/manager/base/ACache.java index d414eb9cb..9e8f403ca 100644 --- a/common/src/main/java/com/yunbao/common/manager/base/ACache.java +++ b/common/src/main/java/com/yunbao/common/manager/base/ACache.java @@ -161,8 +161,9 @@ public class ACache { String readString = ""; String currentLine; while ((currentLine = in.readLine()) != null) { - readString += currentLine+"\n"; + readString += currentLine + "\n"; } + readString = readString.substring(0, readString.length() - 1); if (!Utils.isDue(readString)) { return Utils.clearDateInfo(readString); } else { From 9869a2376c1800c0fec5bdac0fd1b85b47f85a4c Mon Sep 17 00:00:00 2001 From: 18142669586 <1669783059@qq.com> Date: Thu, 13 Apr 2023 11:42:15 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9toat=E6=A0=B7=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/utils/GiftCacheUtil.java | 12 +++-- .../utils/JavascriptInterfaceUtils.java | 2 +- .../com/yunbao/common/utils/ToastUtils.java | 44 ++++++++++++++++++ common/src/main/res/layout/toast_utils.xml | 26 +++++++++++ .../src/main/res/mipmap-xxhdpi/bg_lwhqz.png | Bin 0 -> 1618 bytes .../yunbao/live/adapter/LiveGiftAdapter.java | 2 +- .../presenter/LiveEnterRoomAnimPresenter.java | 2 +- .../live/presenter/LiveGiftAnimPresenter.java | 2 +- .../yunbao/main/activity/MainActivity.java | 5 +- 9 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/utils/ToastUtils.java create mode 100644 common/src/main/res/layout/toast_utils.xml create mode 100644 common/src/main/res/mipmap-xxhdpi/bg_lwhqz.png diff --git a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java index 207accd38..1a42452e7 100644 --- a/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/GiftCacheUtil.java @@ -1,10 +1,12 @@ package com.yunbao.common.utils; +import android.content.Context; import android.os.Handler; import android.os.Looper; import android.util.Log; import com.yunbao.common.CommonAppConfig; +import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.R; import com.yunbao.common.bean.LiveGiftBean; @@ -43,7 +45,7 @@ public class GiftCacheUtil { /** * 单独下载 */ - public static void getFile(String fileName, String url, String forwhat, final CommonCallback commonCallback) { + public static void getFile(Context context,String fileName, String url, String forwhat, final CommonCallback commonCallback) { if (commonCallback == null) { return; } @@ -60,7 +62,9 @@ public class GiftCacheUtil { } else { DownloadUtil downloadUtil = new DownloadUtil(); if (forwhat.equals("1")) { - ToastUtil.show(R.string.gift_way); + ToastUtils toastUtil = new ToastUtils(context); + toastUtil.InitToast(); + toastUtil.show(); } downloadUtil.download(CommonHttpConsts.DOWNLOAD_GIF, dir, fileName, url, new DownloadUtil.Callback() { String TAG="下载"; @@ -141,13 +145,13 @@ public class GiftCacheUtil { /** * 插队优先下载指定id礼物 */ - public void downloadGiftForId(LiveGiftBean bean, CommonCallback mDownloadGifCallback) { + public void downloadGiftForId(Context context,LiveGiftBean bean, CommonCallback mDownloadGifCallback) { if (checkGiftIsDownload(bean.getId())) { mDownloadGifCallback.callback(getGiftForId(bean.getId())); return; } clickId.add(bean.getId()+""); - getFile(getDownloadSaveName(bean.getId()), bean.getSwf(), "0", new CommonCallback() { + getFile(context,getDownloadSaveName(bean.getId()), bean.getSwf(), "0", new CommonCallback() { @Override public void callback(File bean) { if(bean!=null) { diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 6b30e98aa..930cb2f8a 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -461,7 +461,7 @@ public class JavascriptInterfaceUtils { } else { url1 = svg; } - GiftCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback() { + GiftCacheUtil.getFile(mContext,Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback() { @Override public void callback(File bean) { diff --git a/common/src/main/java/com/yunbao/common/utils/ToastUtils.java b/common/src/main/java/com/yunbao/common/utils/ToastUtils.java new file mode 100644 index 000000000..12d7412df --- /dev/null +++ b/common/src/main/java/com/yunbao/common/utils/ToastUtils.java @@ -0,0 +1,44 @@ +package com.yunbao.common.utils; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.TextView; +import android.widget.Toast; + +import com.yunbao.common.R; + +public class ToastUtils { + private Context context; + private TextView tipsText; + private Toast toast = null; + + public ToastUtils(Context context){ + this.context = context; + } + public void InitToast(){ + if (toast == null) { + toast = new Toast(context); + View view = LayoutInflater.from(context).inflate(R.layout.toast_utils, null, false); + toast.setView(view); + } + } + public void setGravity(int gravity){ + toast.setGravity(gravity, 0, 0); + } + public void setText(String tips){ + tipsText.setText(tips); + } + public void show(){ + toast.show(); + } + public void setShowTime(int time){ + toast.setDuration(time); + } + public void setTextColor(int color){ + tipsText.setTextColor(context.getResources().getColor(color)); + } + public void setTextSize(float size){ + tipsText.setTextSize(size); + } +} diff --git a/common/src/main/res/layout/toast_utils.xml b/common/src/main/res/layout/toast_utils.xml new file mode 100644 index 000000000..8696ad3e1 --- /dev/null +++ b/common/src/main/res/layout/toast_utils.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/bg_lwhqz.png b/common/src/main/res/mipmap-xxhdpi/bg_lwhqz.png new file mode 100644 index 0000000000000000000000000000000000000000..fc50e780e255d570157a727fc5e5798da8faaa7a GIT binary patch literal 1618 zcma)7X;c$e7|p!QkT3z6K#-uUQfmZ(pa=-0jgbIRP!tLg5JqqpZH~Ah6lcN#qeXBz zY7lILoPrdUt#Y8U3`&K%V5}RWz+fxx7{#MhkaS4@_w>&@?|$EX_q*SD+y1DfVV3AL zl*M9MD#Alnuvida<~Y}k89%^T7g#Jadqv2?nB7UQA4Q&tSu3R8wmEa%|2{Tj`Qj$` zzGKee@j-T5=3)n?DoTa9d9m1<4LTQP$YOcoVHKaB(y$@5>biAgZ{`s&{8kw-V{o(r- z83IJ|N|2pUGW%&&;@lWd_E0K6y^0+6SAFr>Ja~E7n_k18vo| zR3LuIaZkEaEQFl2(NuOiQvHFsxV@oVLJoBw@tmzEr0*^Imq>DqzW4jxG;MYufvB`> z_9>2%lIxI^zV=XhLxx{z3)Zo3uSX3bo?zhO+Ph8NhEs~`Bf3%2Ct*Vyc+5(!#YxD8fMV%28WjAdAjR8NM&9y_Hkwi zUt3bn`}25;KO*Q_LMPzS0`*F2E602!a4fV+YOM*fP1eY2e9!r<2!)V$f*vdvkNk9y z3^vb?hmfxh%CLH*a8oG(9-s~dvKlMxDNmC0&{5At@WAd9rA0dFJ&?1UTd+0~H=rVY ze8d`8F<;P?NXZUm0AVX|#a+c#f+$LcPZ8+|2}qYhNVBh)!-RZHARbJadXkHZ7~W*i ziCmx~K+-fV8x_$)6JYWTFccE?X6w`dRdTOGh@d9SBzVGXhyZ9ns0rlcn!x5sAhlL~ z(#J$ep$e-T44nZE{{x8N#4y~8G5XR}MCE8QaNf;iZ3jFl-&jCRD&6Os90rT`4W_gpb zu3b|nXoO#d+W>!PyF2WI3ne)hK3LR6IOGgFlh4dMR$Un*l_4=zm>|fTox~{*AbP$o zTK&aJZikS{pmSp2Jd0nW3w7hC<8dgJ@@o3 z=28WeiA&Dj^w0;9*C>`@rm8eJNPH*Z=Xmbb>K~8p;aF8<+9YP(xoETX8Y%#_;m?-Q zSPd^AdS7|54C{10k=;rA(0qDfrumMZzBuyXm)MfrLiQ}?SyRyQePz26xCeF~7?`IS z@NIO~7CY4w&zDN>NgRi(rD3G-bK$q2lW$8v=i~17JD=N>Ppt7XWk$=1O_zrvKV7zA P{tA{tzBJ^#3|IdH@(_<} literal 0 HcmV?d00001 diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java index b32479146..854e04856 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveGiftAdapter.java @@ -208,7 +208,7 @@ public class LiveGiftAdapter extends RecyclerView.Adapter { mLoading.startAnimation(animation); LiveGiftBean bean = mList.get((Integer) v.getTag()); GiftCacheUtil.getInstance().pause(); - GiftCacheUtil.getInstance().downloadGiftForId(bean, new CommonCallback() { + GiftCacheUtil.getInstance().downloadGiftForId(mContext,bean, new CommonCallback() { @Override public void callback(File bean) { if(bean==null){ diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java index 8612ab8d2..65a73b842 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveEnterRoomAnimPresenter.java @@ -461,7 +461,7 @@ public class LiveEnterRoomAnimPresenter { playText = car.getUser_nicename() + mContext.getResources().getString(R.string.enter_room); } if (IMLoginManager.get(mContext).isMountEffect()) { - GiftCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", mDownloadGifCallback); + GiftCacheUtil.getFile(mContext,Constants.GIF_CAR_PREFIX + id, url1, "0", mDownloadGifCallback); } else { mIsAnimating = false; } diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 9d03bcd4f..fb2b2ea0c 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -1123,7 +1123,7 @@ public class LiveGiftAnimPresenter { } }); } else { - GiftCacheUtil.getFile(Constants.GIF_GIFT_PREFIX + bean.getGiftId(), url, "1", mDownloadGifCallback); + GiftCacheUtil.getFile(mContext,Constants.GIF_GIFT_PREFIX + bean.getGiftId(), url, "1", mDownloadGifCallback); } } 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 88bda75c5..f4a8498fb 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -87,6 +87,7 @@ import com.yunbao.common.utils.ProcessResultUtil; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.ToastUtils; import com.yunbao.common.utils.VersionUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.APKUpdateCustomPopup; @@ -828,7 +829,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene Log.e("--->", list.get(j).getGiftname() + list.get(j).getSwf()); - GiftCacheUtil.getFile(Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback() { + GiftCacheUtil.getFile(MainActivity.this,Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback() { @Override public void callback(File bean) { @@ -869,7 +870,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene Log.e("tx", id); - GiftCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback() { + GiftCacheUtil.getFile(MainActivity.this,Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback() { @Override public void callback(File bean) { // Log.e("111",bean.getPath()+"是"); From 32fa77be39ea6dfa43fc87c4137e2456cf7146e9 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 13 Apr 2023 13:04:12 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9=EF=BC=8Cui=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 6 +-- .../yunbao/live/views/LiveRoomViewHolder.java | 2 +- .../live/views/PortraitLiveManager.java | 46 ++----------------- live/src/main/res/layout/view_live_room.xml | 8 ++-- 4 files changed, 12 insertions(+), 50 deletions(-) diff --git a/config.gradle b/config.gradle index fd1b383b9..95a3f25a3 100644 --- a/config.gradle +++ b/config.gradle @@ -4,14 +4,14 @@ ext { buildToolsVersion: "29.0.2", minSdkVersion : 21, targetSdkVersion : 31, - versionCode : 417, + versionCode : 418, versionName : "6.5.0" ] manifestPlaceholders = [ //正式、 serverHost : "https://napi.yaoulive.com", //测试 -// serverHost : "https://ceshi.yaoulive.com", +// serverHost : "https ://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", @@ -23,7 +23,7 @@ ext { baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnRB", baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false - isGooglePlay : false, + isGooglePlay : true, //是否上报异常日志 isUploadLog : true ] diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 4b8bf6f34..c27cf7de2 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -4727,7 +4727,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void hideAnchorSayAndCallAnchor() { mAnchorSay.setVisibility(View.GONE); - topBanner1.setVisibility(View.GONE); +// topBanner1.setVisibility(View.GONE); } public void showAnchorSayAndCallAnchor() { diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index f7816103b..7910576e2 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -191,7 +191,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe private int landscape; private String leaveStream = "", leaveGroupId = ""; public static PortraitLiveManager portraitLiveManager; - private WishModel wishListProgress; private static int waitShowTopBannerTime = 6000; public PortraitLiveManager setQuitF(boolean quitF) { @@ -256,45 +255,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void run() { loading.setVisibility(View.GONE); enterRoomLeaveHandler.post(enterRoomLeaveRunnable); - if (topBannerRunnable == null || topBannerHandler == null) { - initTopBannerHandler(); - } - topBannerHandler.postDelayed(topBannerRunnable, waitShowTopBannerTime); } }; - private Runnable topBannerRunnable = new Runnable() { - @Override - public void run() { - if (mLiveRoomViewHolder != null) { - //初始化顶部banner - mLiveRoomViewHolder.initTopBanner(); - mLiveRoomViewHolder.updateTopBanner(); - topBannerHandler.removeCallbacks(topBannerRunnable); - topBannerRunnable = null; - topBannerHandler = null; - } - } - }; - private Handler topBannerHandler = new Handler(); - private void initTopBannerHandler() { - topBannerHandler = new Handler(); - topBannerRunnable = new Runnable() { - @Override - public void run() { - if (mLiveRoomViewHolder != null) { - //初始化顶部banner - mLiveRoomViewHolder.initTopBanner(); - mLiveRoomViewHolder.updateTopBanner(); - topBannerHandler.removeCallbacks(topBannerRunnable); - topBannerRunnable = null; - topBannerHandler = null; - } - } - }; - } @Override public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) { @@ -387,9 +352,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.resetView(); enterRoomModel.clear(); enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable); - if (topBannerHandler != null && topBannerRunnable != null) { - topBannerHandler.removeCallbacks(topBannerRunnable); - } mLiveRoomViewHolder.setAvatar(data.getAvatar()); mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor()); mLiveRoomViewHolder.setName(data.getUserNiceName()); @@ -533,11 +495,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setMedaRankNum(data.getEnterRoomInfo().getMedalRankNum()); //初始化女神说 mLiveRoomViewHolder.initAnchorSay(); - - wishListProgress = data.getWishListProgress(); //心愿单顶部bannner - - mLiveRoomViewHolder.setWishListProgress(wishListProgress); + mLiveRoomViewHolder.setWishListProgress(data.getWishListProgress()); + //初始化顶部banner + mLiveRoomViewHolder.initTopBanner(); + mLiveRoomViewHolder.updateTopBanner(); isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention()); if (isattention == 0) { diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 3c5c7d43c..9984147f0 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -662,7 +662,7 @@ android:layout_below="@id/open_sidebar" android:layout_alignParentRight="true" android:layout_marginTop="16dp" - android:layout_marginRight="9dp" + android:layout_marginRight="5dp" android:background="@drawable/bg_live_other_ico" android:gravity="center"> @@ -702,7 +702,7 @@ android:layout_height="76dp" android:layout_below="@+id/live_rank_pk" android:layout_alignParentRight="true" - android:layout_marginTop="20dp" + android:layout_marginTop="50dp" android:layout_marginRight="5dp" app:delay_time="5000" app:indicator_height="8dp" @@ -2063,8 +2063,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" - android:layout_marginTop="120dp" - android:layout_marginRight="19dp" + android:layout_marginTop="230dp" + android:layout_marginRight="7dp" android:orientation="vertical"> Date: Thu, 13 Apr 2023 13:08:58 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8A=A0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/fragment/LiveNewWishListFragment.java | 4 ++++ .../java/com/yunbao/common/views/LiveNewWishListPopup.java | 5 ++++- common/src/main/res/values-zh-rHK/strings.xml | 1 + common/src/main/res/values-zh-rTW/strings.xml | 1 + common/src/main/res/values-zh/strings.xml | 1 + common/src/main/res/values/strings.xml | 2 +- 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java index 20ee6ddd7..c6dfaf62d 100644 --- a/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java +++ b/common/src/main/java/com/yunbao/common/fragment/LiveNewWishListFragment.java @@ -119,6 +119,10 @@ public class LiveNewWishListFragment extends BaseFragment { if (wishList2.size() == 0) { Bus.get().post(new PopupViewDismissEvent()); } else { + if (wishList2.size()>10){ + ToastUtil.show(R.string.must_hint); + return; + } LiveNetManager.get(getContext()). setWishlistV2(type, gson.toJson(wishList2), new HttpCallback() { @Override diff --git a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java index c532a3581..b6d8a88c6 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveNewWishListPopup.java @@ -326,7 +326,10 @@ public class LiveNewWishListPopup extends BottomPopupView { } List wishList2 = new ArrayList<>(); Gson gson = new Gson(); - + if (wishList2.size()>10){ + ToastUtil.show(R.string.must_hint); + return; + } LiveNetManager.get(getContext()). setWishlistV2(type, gson.toJson(wishList2), new HttpCallback() { @Override diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 6ee9349ce..956b12d6c 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1118,4 +1118,5 @@ 繁體中文 添加禮物、貴族、守護心願 热度加成 + 最多只能设置10条 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 6ee9349ce..956b12d6c 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1118,4 +1118,5 @@ 繁體中文 添加禮物、貴族、守護心願 热度加成 + 最多只能设置10条 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 6ee9349ce..956b12d6c 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1118,4 +1118,5 @@ 繁體中文 添加禮物、貴族、守護心願 热度加成 + 最多只能设置10条 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 842d4f078..2af8b7a70 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -282,7 +282,7 @@ Beans DO Coins - + A maximum of 10 entries can be set Personalized Dress Up Flip Mirroring From 4ae1b12be05ada8103487ef352f90aab6d2a7cb5 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 13 Apr 2023 15:45:51 +0800 Subject: [PATCH 08/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8A=A0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LiveRoomViewHolder.java | 99 ++++++++++++++++++- live/src/main/res/layout/view_live_room.xml | 20 +++- 2 files changed, 112 insertions(+), 7 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index c27cf7de2..1858253e3 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -353,7 +353,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private TextView mAnchorSayText; private ImageView mAnchorSayHide; //----!主播说组件---// - private Banner topBanner1;//心愿单&联系方式 + private Banner topBanner1, topBanner2;//心愿单&联系方式 public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow; private String mAnchorName;//主播名字 @@ -1032,6 +1032,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mRedVal = (TextView) findViewById(R.id.pk_rank_red_val); mBlueVal = (TextView) findViewById(R.id.pk_rank_blue_val); topBanner1 = (Banner) findViewById(R.id.top_banner1); + topBanner2 = (Banner) findViewById(R.id.top_banner2); if (LivePushTxViewHolder.mTRTCCloud != null || LivePushRyViewHolder.rtcRoom != null) { fans_btn.setVisibility(View.GONE); @@ -1345,6 +1346,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10); } }); + topBanner2.setOutlineProvider(new ViewOutlineProvider() { + @Override + public void getOutline(View view, Outline outline) { + outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10); + } + }); //打招呼消息 fastMsgRecyclerView = (RecyclerView) findViewById(R.id.room_fast_msg); fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); @@ -1500,6 +1507,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // initStarChallengeStatus(); enterRoomLeave.setVisibility(View.GONE); topBanner1.setVisibility(View.GONE); + topBanner2.setVisibility(View.GONE); + } public void clearChat() { @@ -4272,6 +4281,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } topBanner1.update(mTopBannerList); + topBanner2.update(mTopBannerList); new Handler().postDelayed(new Runnable() { @Override public void run() { @@ -4295,6 +4305,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis topBanner1.setVisibility(View.GONE); } else { topBanner1.update(mTopBannerList); + topBanner2.update(mTopBannerList); } } }, 500); @@ -4315,6 +4326,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis topBanner1.setVisibility(View.GONE); } else { topBanner1.update(mTopBannerList); + topBanner2.update(mTopBannerList); } } @@ -4727,7 +4739,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void hideAnchorSayAndCallAnchor() { mAnchorSay.setVisibility(View.GONE); -// topBanner1.setVisibility(View.GONE); + topBanner1.setVisibility(View.GONE); + if (topBanner1.getVisibility() == View.GONE && mTopBannerList != null && !mTopBannerList.isEmpty()) { + Log.i("女神说", "mTopBannerList: " + mTopBannerList.size()); + for (BannerBean bean : mTopBannerList) { + Log.i("女神说", "BannerBean: " + bean); + } + topBanner2.setVisibility(View.VISIBLE); + } } public void showAnchorSayAndCallAnchor() { @@ -4744,6 +4763,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis Log.i("女神说", "BannerBean: " + bean); } topBanner1.setVisibility(View.VISIBLE); + topBanner2.setVisibility(View.GONE); } } @@ -4776,6 +4796,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mTopBannerList.set(1, bannerBean); } topBanner1.update(mTopBannerList); + topBanner2.update(mTopBannerList); } } @@ -4862,6 +4883,79 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } }) .start(); + topBanner2.setAutoPlay(true) + .setPages(mTopBannerList, new TopBannerCustomViewHolder()) + .setDelayTime(3000) + .setBannerStyle(BannerConfig.NOT_INDICATOR) + .setOnBannerClickListener(new OnBannerClickListener() { + @Override + public void onBannerClick(List datas, int position) { + if (datas.size() > 0) { + if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) { + Dialog loading = DialogUitl.loadingDialog(mContext); + loading.show(); + LiveNetManager.get(mContext) + .getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback() { + + @Override + public void onSuccess(LiveAnchorCallMeModel data) { + if (data.getIsGet() == 1) { + new LiveUserAnchorMailBoxWebInfoPopDialog(mContext, mAnchorName, data.getLink()) + .setOnDismissListener(dialog -> loading.dismiss()) + .showDialog(); + return; + } + LiveGiftDialogFragment fragment = new LiveGiftDialogFragment(); + fragment.setOnDismissListener(dialog -> checkNewLetter() + ); + fragment.setOnShowListener(dialog -> mHandler.postDelayed(loading::dismiss, 500)); + Bundle bundle = new Bundle(); + bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_STREAM, mStream); + bundle.putString(Constants.LIVE_WISH_GIFTID, data.getGiftId() + ""); + bundle.putBoolean("isContactGift", true); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment"); + } + + @Override + public void onError(String error) { + loading.dismiss(); + } + }); + + } else { + BannerBean bean = mTopBannerList.get(position); + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + String type = ""; + StringBuffer htmlUrl = new StringBuffer(); + htmlUrl.append(bean.getLink()) + .append(bean.getLink().contains("?") ? "&uid=" : "?uid=") + .append(userInfo.getId()) + .append("&token=") + .append(userInfo.getToken()) + .append("&anchorUid=") + .append(mLiveUid) + .append("&liveUid=") + .append(mLiveUid) + .append("&t=") + .append(System.currentTimeMillis()) + .append("&g=Appapi&m=Wish&a=index"); + if (TextUtils.equals(type, "1")) { + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + } else { + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } + } + } + + } + }) + .start(); updateCallMe(); } @@ -4878,6 +4972,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR); mTopBannerList.add(0, call); topBanner1.update(mTopBannerList); + topBanner2.update(mTopBannerList); } } diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 9984147f0..dd202c7ad 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -662,7 +662,7 @@ android:layout_below="@id/open_sidebar" android:layout_alignParentRight="true" android:layout_marginTop="16dp" - android:layout_marginRight="5dp" + android:layout_marginRight="9dp" android:background="@drawable/bg_live_other_ico" android:gravity="center"> @@ -702,7 +702,7 @@ android:layout_height="76dp" android:layout_below="@+id/live_rank_pk" android:layout_alignParentRight="true" - android:layout_marginTop="50dp" + android:layout_marginTop="20dp" android:layout_marginRight="5dp" app:delay_time="5000" app:indicator_height="8dp" @@ -2063,8 +2063,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" - android:layout_marginTop="230dp" - android:layout_marginRight="7dp" + android:layout_marginTop="120dp" + android:layout_marginRight="19dp" android:orientation="vertical"> + + - \ No newline at end of file + From db8dc2a78178dda3799b5fd81d268ceabb24eb7e Mon Sep 17 00:00:00 2001 From: 18142669586 <1669783059@qq.com> Date: Thu, 13 Apr 2023 15:57:11 +0800 Subject: [PATCH 09/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9E=E9=BA=A6?= =?UTF-8?q?=E6=A0=B7=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/utils/ToastUtils.java | 4 +- live/src/main/res/layout/view_live_room.xml | 132 +++++++++--------- .../yunbao/main/activity/MainActivity.java | 1 - 3 files changed, 70 insertions(+), 67 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/utils/ToastUtils.java b/common/src/main/java/com/yunbao/common/utils/ToastUtils.java index 12d7412df..541f07392 100644 --- a/common/src/main/java/com/yunbao/common/utils/ToastUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/ToastUtils.java @@ -1,6 +1,7 @@ package com.yunbao.common.utils; import android.content.Context; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; @@ -21,10 +22,11 @@ public class ToastUtils { toast = new Toast(context); View view = LayoutInflater.from(context).inflate(R.layout.toast_utils, null, false); toast.setView(view); + toast.setGravity(Gravity.CENTER, 0, 0); } } public void setGravity(int gravity){ - toast.setGravity(gravity, 0, 0); + toast.setGravity(Gravity.CENTER, 0, 0); } public void setText(String tips){ tipsText.setText(tips); diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index dd202c7ad..6d7ef612e 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2067,72 +2067,7 @@ android:layout_marginRight="19dp" android:orientation="vertical"> - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + () { @Override From 4a4cc179bfac00b0c389cedaa9f430e533dab697 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 13 Apr 2023 16:26:57 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=95=E4=BA=BAPK?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=90=8E=E6=96=B0=E8=BF=9B=E6=9D=A5=E7=AB=96?= =?UTF-8?q?=E5=B1=8F=E7=9B=B4=E6=92=AD=E9=97=B4=EF=BC=8C=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/views/LivePlayRyViewHolder.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 0267d522b..6399477ad 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -209,12 +209,12 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public synchronized void setLiveBeanLandscape(int landscape) { // landscape=1; - Log.i(TAG, "setLiveBeanLandscape: " + landscape); + Log.i(TAG, "setLiveBeanLandscape: " + landscape + " isPk: " + isPk); this.landscape = landscape; this.videoLandscape = landscape; mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL); if (landscape == 2) { - Log.i("收到socket--->", "还原9:16"); + Log.i(TAG, "还原9:16"); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = RelativeLayout.LayoutParams.MATCH_PARENT; params.topMargin = 0; @@ -233,6 +233,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mCover.requestLayout(); } else { + Log.i(TAG, "还原16:9"); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = vHeight; params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); @@ -258,6 +259,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void setLiveEnterRoomNewModel(EnterRoomNewModel data) { super.setLiveEnterRoomNewModel(data); isPk = data.getEnterRoomInfo().getIsconnection().equals("1"); + if (isPk) { + setLiveBeanLandscape(1); + } } /** @@ -443,7 +447,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public void setViewUP(int i) { if (mVideoView == null) return; - Log.e("收", "整理" + i); + Log.e("PK状态", "" + i); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = vHeight; params.topMargin = contexts.getResources().getDimensionPixelOffset(R.dimen.live_top); @@ -478,7 +482,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { } mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL); if (landscape == 2) { - Log.i("收到socket--->", "还原9:16"); + Log.i(TAG, "onPrepared:还原9:16 land=" + videoLandscape); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = height; params.topMargin = 0; @@ -497,6 +501,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mCover.setLayoutParams(params2); mCover.requestLayout(); } else { + Log.i(TAG, "onPrepared:还原16:9"); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = height; params.topMargin = 0; @@ -744,7 +749,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { Log.e("ry", "下麦失败" + errorCode); leaveRoom(); } - private void leaveRoom(){ + + private void leaveRoom() { RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() { @Override public void onSuccess() { @@ -925,7 +931,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { UsertoRY(); } }); - }else{ + } else { ToastUtil.show("房间失败" + errorCode); } @@ -941,9 +947,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void run() { RCRTCEngine.getInstance().enableSpeaker(true); //遍历远端用户发布的资源列表 - Log.i(TAG, "软件资源数量:"+data.getLiveStreams().size()); + Log.i(TAG, "软件资源数量:" + data.getLiveStreams().size()); for (RCRTCInputStream stream : data.getLiveStreams()) { - Log.i(TAG, "资源流 type: "+stream.getMediaType()); + Log.i(TAG, "资源流 type: " + stream.getMediaType()); if (stream.getMediaType() == RCRTCMediaType.VIDEO) { //暂停播放 mPlayer.stop(); From bb4f8bb98e3edb18855a2ca077a0fac846a73bea Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 13 Apr 2023 16:44:40 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8A=A0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/activity/LiveRyAnchorActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 0964f123f..29e0454e3 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -42,7 +42,6 @@ import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.bean.AiAutomaticSpeechModel; -import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LiveAiRobotBean; @@ -51,7 +50,6 @@ import com.yunbao.common.bean.LiveUserGiftBean; import com.yunbao.common.bean.MicUserBean; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.NotCancelableDialog; -import com.yunbao.common.event.LiveRobotMessageEvent; import com.yunbao.common.event.LoginInvalidEvent; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; @@ -71,7 +69,6 @@ import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; -import com.yunbao.common.views.InputCustomPopup; import com.yunbao.common.views.LiveNewWishListPopup; import com.yunbao.common.views.LiveRobotSettingCustomPopup; import com.yunbao.faceunity.FaceManager; @@ -81,7 +78,6 @@ import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.dialog.FreePkDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; -import com.yunbao.live.dialog.LiveNewWishListDialogFragment; import com.yunbao.live.dialog.LivePrankDialogFragment; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.RandomPkDialogFragment; @@ -383,6 +379,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl } break; case Constants.LIVE_FUNC_DR://多人PK +// if (LiveRyLinkMicPkPresenter.inputStreamList.size() == 4) { +// return; +// } if (isDRPK != 1) { HttpClient.getInstance().get("live.getdrnum", "live.getdrnum") .execute(new HttpCallback() { @@ -520,6 +519,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl default: break; } + } From 8507fc1bb7357ae4bf98a02368cc08ad87d3ec47 Mon Sep 17 00:00:00 2001 From: 18142669586 <1669783059@qq.com> Date: Thu, 13 Apr 2023 16:44:41 +0800 Subject: [PATCH 12/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9E=E9=BA=A6?= =?UTF-8?q?=E6=A0=B7=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/live/views/LiveRoomViewHolder.java | 6 +++--- live/src/main/res/layout/view_live_room.xml | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 1858253e3..83516dd55 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -554,9 +554,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void updataCleanMic() { - mic_view.setVisibility(View.GONE); - mic_view1.setVisibility(View.GONE); - mic_view2.setVisibility(View.GONE); + mic_view.setVisibility(View.INVISIBLE); + mic_view1.setVisibility(View.INVISIBLE); + mic_view2.setVisibility(View.INVISIBLE); } public static void paygzGif(String url, String liveid) { diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 6d7ef612e..8e77fa0ec 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2065,6 +2065,7 @@ android:layout_alignParentRight="true" android:layout_marginTop="120dp" android:layout_marginRight="19dp" + android:gravity="bottom" android:orientation="vertical"> @@ -2074,7 +2075,7 @@ android:layout_width="40dp" android:layout_height="50dp" android:layout_marginTop="19dp" - android:visibility="gone"> + android:visibility="invisible"> + android:visibility="invisible"> Date: Thu, 13 Apr 2023 17:22:05 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9E=E9=BA=A6?= =?UTF-8?q?=E6=A0=B7=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/src/main/res/layout/view_live_room.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 8e77fa0ec..270f11856 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2063,8 +2063,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" - android:layout_marginTop="120dp" - android:layout_marginRight="19dp" + android:layout_marginTop="190dp" + android:layout_marginRight="18dp" android:gravity="bottom" android:orientation="vertical"> @@ -2074,7 +2074,7 @@ android:id="@+id/mic_view2" android:layout_width="40dp" android:layout_height="50dp" - android:layout_marginTop="19dp" + android:layout_marginTop="10dp" android:visibility="invisible"> Date: Thu, 13 Apr 2023 17:23:29 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A5=B3=E7=A5=9E?= =?UTF-8?q?=E8=AF=B4banner=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LiveRoomViewHolder.java | 2 +- .../live/views/TopBannerCustomViewHolder.java | 14 +++++- .../layout/view_live_top_banner_call_me2.xml | 44 +++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 live/src/main/res/layout/view_live_top_banner_call_me2.xml diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 83516dd55..3ec9c6cc6 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -4884,7 +4884,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }) .start(); topBanner2.setAutoPlay(true) - .setPages(mTopBannerList, new TopBannerCustomViewHolder()) + .setPages(mTopBannerList, new TopBannerCustomViewHolder(false)) .setDelayTime(3000) .setBannerStyle(BannerConfig.NOT_INDICATOR) .setOnBannerClickListener(new OnBannerClickListener() { diff --git a/live/src/main/java/com/yunbao/live/views/TopBannerCustomViewHolder.java b/live/src/main/java/com/yunbao/live/views/TopBannerCustomViewHolder.java index 6c8e0bd17..f38d9000c 100644 --- a/live/src/main/java/com/yunbao/live/views/TopBannerCustomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/TopBannerCustomViewHolder.java @@ -20,6 +20,14 @@ import com.yunbao.live.R; public class TopBannerCustomViewHolder implements BannerViewHolder { public static final int TYPE_CALL_ANCHOR = 0;//联系主播 public static final int TYPE_IMAGE = 1; + private boolean isTop=true; + + public TopBannerCustomViewHolder(boolean isTop) { + this.isTop = isTop; + } + + public TopBannerCustomViewHolder() { + } @Override public View createView(Context context, int position, BannerBean data) { @@ -33,7 +41,11 @@ public class TopBannerCustomViewHolder implements BannerViewHolder { wishlistName.setText(data.getWishlistName()); wishlistProgress.setText(String.format("%s/%s", data.getWishlistProgress(), data.getWishlistNum())); } else { - view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_call_me, null); + if(isTop) { + view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_call_me, null); + }else{ + view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_call_me2, null); + } SVGAImageView svga = view.findViewById(R.id.svga); new SVGAParser(context).decodeFromAssets("ic_live_anchor_call_me.svga", new SVGAParser.ParseCompletion() { @Override diff --git a/live/src/main/res/layout/view_live_top_banner_call_me2.xml b/live/src/main/res/layout/view_live_top_banner_call_me2.xml new file mode 100644 index 000000000..c600ae735 --- /dev/null +++ b/live/src/main/res/layout/view_live_top_banner_call_me2.xml @@ -0,0 +1,44 @@ + + + + + + + + + \ No newline at end of file From 06e077146b42f9c25f82bd434bf73d918e89951d Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 13 Apr 2023 17:57:40 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/views/LiveRoomViewHolder.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 3ec9c6cc6..7e8949b35 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -4533,6 +4533,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis showUserDialog(userId3); } }); + } private Runnable countdownRunnable = new Runnable() { @@ -4545,11 +4546,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis countdownHandler.postAtTime(countdownRunnable, getNextSecondTime()); hideAnchorSayAndCallAnchor(); } else { + mPkTimeCount = 0; + showAnchorSayAndCallAnchor(); timeTitle.setVisibility(View.GONE); countdownHandler.removeCallbacks(countdownRunnable); Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT)); - showAnchorSayAndCallAnchor(); } } }; @@ -4559,6 +4561,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mRoot.removeView(detailsView); detailsView = null; } + mPkTimeCount = 0; + showAnchorSayAndCallAnchor(); } /** @@ -4739,14 +4743,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void hideAnchorSayAndCallAnchor() { mAnchorSay.setVisibility(View.GONE); + topBanner2.setVisibility(View.VISIBLE); topBanner1.setVisibility(View.GONE); - if (topBanner1.getVisibility() == View.GONE && mTopBannerList != null && !mTopBannerList.isEmpty()) { - Log.i("女神说", "mTopBannerList: " + mTopBannerList.size()); - for (BannerBean bean : mTopBannerList) { - Log.i("女神说", "BannerBean: " + bean); - } - topBanner2.setVisibility(View.VISIBLE); - } } public void showAnchorSayAndCallAnchor() { From c23ed7defb3bfbc236df9093df98f8c221a18279 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 13 Apr 2023 18:25:19 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/src/main/java/com/yunbao/live/socket/SocketRyClient.java | 2 ++ .../src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 2c4dd2482..8256c2681 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -1177,6 +1177,8 @@ public class SocketRyClient { break; case 9://pk结束的回调 mListener.onLinkMicPkEnd(map.getString("win_uid")); + EventBus.getDefault().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_END)); break; case 10://系统发起PK回调 JSONObject msg1 = new JSONObject(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 7e8949b35..7f01973b5 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -4547,7 +4547,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis hideAnchorSayAndCallAnchor(); } else { mPkTimeCount = 0; - showAnchorSayAndCallAnchor(); timeTitle.setVisibility(View.GONE); countdownHandler.removeCallbacks(countdownRunnable); Bus.get().post(new LiveAudienceEvent() From 0ed37aee111c3660610683a87a9c56301019e2bd Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 14 Apr 2023 10:40:14 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/socket/SocketRyClient.java | 1 + .../yunbao/live/views/LiveRoomViewHolder.java | 18 ++++++++++++++---- .../yunbao/live/views/PortraitLiveManager.java | 12 +++++++++--- live/src/main/res/layout/view_live_room.xml | 2 ++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 8256c2681..0d0ecdf50 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -302,6 +302,7 @@ public class SocketRyClient { ); } + } else if (action3 == 5) { // endDRGif(); LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 7f01973b5..b7f2dafc4 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -356,6 +356,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private Banner topBanner1, topBanner2;//心愿单&联系方式 public SVGAImageView svga_new_user_gif, svga_new_user_double, svga_new_user_follow; private String mAnchorName;//主播名字 + private boolean isHinde = false; @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { @@ -1509,6 +1510,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis topBanner1.setVisibility(View.GONE); topBanner2.setVisibility(View.GONE); + removeDetailView(); } public void clearChat() { @@ -4240,7 +4242,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", "")); closePkTwo(); - showAnchorSayAndCallAnchor(); break; case CUSTOM_FULL_SERVICE_NOTIFY: customFullServiceNotify(event.getCustomFullServiceNotifyEvent()); @@ -4544,7 +4545,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis String s1 = StringUtil.getDurationText(mPkTimeCount * 1000); textTime.setText(String.format(mContext.getString(R.string.pk_time), s1)); countdownHandler.postAtTime(countdownRunnable, getNextSecondTime()); - hideAnchorSayAndCallAnchor(); } else { mPkTimeCount = 0; timeTitle.setVisibility(View.GONE); @@ -4562,6 +4562,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } mPkTimeCount = 0; showAnchorSayAndCallAnchor(); + if (mHandler != null) { + mHandler.removeMessages(WHAT_PK_TIME); + } } /** @@ -4741,12 +4744,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void hideAnchorSayAndCallAnchor() { + isHinde = true; mAnchorSay.setVisibility(View.GONE); topBanner2.setVisibility(View.VISIBLE); topBanner1.setVisibility(View.GONE); } public void showAnchorSayAndCallAnchor() { + isHinde = false; if (mAnchorSay.getVisibility() == View.GONE && sayModel != null && sayModel.getLivePreview() != null && sayModel.getLivePreview().getIsShow() == 1 @@ -4778,7 +4783,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mTopBannerList = new ArrayList<>(); } // if(sayModel!=null&&sayModel.getLivePreview().getIsShow()==1&&sa) - topBanner1.setVisibility(View.VISIBLE); + if (!isHinde){ + topBanner1.setVisibility(View.VISIBLE); + } + BannerBean bannerBean = new BannerBean(); bannerBean.setWishlistIcon(wishListProgress.getWishlistIcon()) .setWishlistName(wishListProgress.getWishlistName()) @@ -4963,7 +4971,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onSuccess(LiveAnchorCallMeModel data) { System.out.println(">>>>> 获取联系方式:" + data); if (data.getIsShow() == 1) { - topBanner1.setVisibility(View.VISIBLE); + if (!isHinde){ + topBanner1.setVisibility(View.VISIBLE); + } BannerBean call = new BannerBean(); call.setData(data); call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 7910576e2..2a86d0c06 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -259,8 +259,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe }; - - @Override public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) { isEnterRoom = false; @@ -652,6 +650,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } } liveHandler.postDelayed(loadRunnableGone, 15_000); + if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) { + //通知心愿单位置换地方 + EventBus.getDefault().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING)); + } } @@ -1932,6 +1935,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.upDataPkScore(pkScores, time); setPkStatus(true); } + //通知心愿单位置换地方 + EventBus.getDefault().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING)); } public void endDRGif() { @@ -1954,7 +1960,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void showXydComplete(XydCompleteModel model, LiveReceiveGiftBean liveReceiveGiftBean) { if (mLiveRoomViewHolder != null) { - mLiveRoomViewHolder.showXydComplete(model, false,liveReceiveGiftBean); + mLiveRoomViewHolder.showXydComplete(model, false, liveReceiveGiftBean); } } } diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 270f11856..ef9aa8d2a 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -704,6 +704,7 @@ android:layout_alignParentRight="true" android:layout_marginTop="20dp" android:layout_marginRight="5dp" + android:visibility="gone" app:delay_time="5000" app:indicator_height="8dp" app:indicator_width="8dp" /> @@ -2195,6 +2196,7 @@ android:layout_marginTop="20dp" android:layout_marginRight="5dp" app:delay_time="5000" + android:visibility="gone" app:indicator_height="8dp" app:indicator_width="8dp" /> From cbb15313564d5ae0924cd346094dad45dfcf6716 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 14 Apr 2023 10:46:13 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/views/LiveRoomViewHolder.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index b7f2dafc4..81a096d7f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -658,7 +658,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // } public void endDRGif() { - if (dr_pk_end_gif.getVisibility() == View.GONE) { + if (dr_pk_end_gif.getVisibility() == View.GONE && isShowGif) { dr_pk_end_gif.setVisibility(View.VISIBLE); visibility = false; RequestOptions options = new RequestOptions().skipMemoryCache(true);//配置 @@ -4400,12 +4400,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private TextView textGrade1, textGrade2, textGrade3, textGrade4; private ImageView imageGrade1, imageGrade2, imageGrade3, imageGrade4; private LinearLayout linearGrade1, linearGrade2, linearGrade3, linearGrade4; + private boolean isShowGif = false; /** * PK倒计时 */ private String userId2, userId3 = "", userId4; public void upDataPkScore(JSONArray pkScores, int time) { + isShowGif = true; if (detailsView == null) { detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null); timeTitle = detailsView.findViewById(R.id.time_title); @@ -4556,6 +4558,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }; public void removeDetailView() { + if (detailsView != null) { mRoot.removeView(detailsView); detailsView = null; @@ -4565,6 +4568,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (mHandler != null) { mHandler.removeMessages(WHAT_PK_TIME); } + isShowGif = false; } /** @@ -4783,7 +4787,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mTopBannerList = new ArrayList<>(); } // if(sayModel!=null&&sayModel.getLivePreview().getIsShow()==1&&sa) - if (!isHinde){ + if (!isHinde) { topBanner1.setVisibility(View.VISIBLE); } @@ -4971,7 +4975,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void onSuccess(LiveAnchorCallMeModel data) { System.out.println(">>>>> 获取联系方式:" + data); if (data.getIsShow() == 1) { - if (!isHinde){ + if (!isHinde) { topBanner1.setVisibility(View.VISIBLE); } BannerBean call = new BannerBean(); From e38262826d4f99d75fed23890c11707ee25acd11 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 14 Apr 2023 10:59:06 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E5=85=B3=E6=B3=A8ui=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E5=A4=9A=E4=BA=BApk=E5=80=92=E8=AE=A1=E6=97=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/src/main/res/layout/item_live_chat.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/live/src/main/res/layout/item_live_chat.xml b/live/src/main/res/layout/item_live_chat.xml index 0f04421ea..6d2fe7f30 100644 --- a/live/src/main/res/layout/item_live_chat.xml +++ b/live/src/main/res/layout/item_live_chat.xml @@ -185,6 +185,8 @@ android:id="@+id/attention_layout" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="2dp" + android:layout_marginEnd="2dp" android:background="@drawable/chat_message_bg" android:gravity="center_vertical" android:orientation="horizontal" From 90c7483dbcef540ccc63ec08d585c41513708236 Mon Sep 17 00:00:00 2001 From: 18142669586 <1669783059@qq.com> Date: Fri, 14 Apr 2023 13:41:52 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/src/main/res/layout/item_live_chat.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/live/src/main/res/layout/item_live_chat.xml b/live/src/main/res/layout/item_live_chat.xml index 6d2fe7f30..59278a785 100644 --- a/live/src/main/res/layout/item_live_chat.xml +++ b/live/src/main/res/layout/item_live_chat.xml @@ -220,6 +220,7 @@ android:layout_height="26dp" android:layout_marginStart="10dp" android:layout_marginEnd="11dp" + android:clickable="false" android:src="@mipmap/btn_attention" /> From 32e3584fef7f27511f11153338054cd9adaa64d2 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 14 Apr 2023 16:09:02 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8F=E8=B7=B3=E8=BD=AC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/JavascriptInterfaceUtils.java | 33 ++++++++++++------- .../live/activity/LiveAudienceActivity.java | 10 ++++++ .../yunbao/live/event/LiveAudienceEvent.java | 3 +- .../yunbao/live/views/LiveRoomViewHolder.java | 1 - 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 930cb2f8a..9101071ae 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -461,7 +461,7 @@ public class JavascriptInterfaceUtils { } else { url1 = svg; } - GiftCacheUtil.getFile(mContext,Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback() { + GiftCacheUtil.getFile(mContext, Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback() { @Override public void callback(File bean) { @@ -493,20 +493,21 @@ public class JavascriptInterfaceUtils { /** * 设置webView高度 + * * @param useDp 是否用dp换算 */ @JavascriptInterface - public void setHeight(String height, String width,boolean useDp) { + public void setHeight(String height, String width, boolean useDp) { if ("0".equals(height)) { return; } Handler handler = new Handler(Looper.getMainLooper()); handler.post(() -> { ViewGroup.LayoutParams params = mWebView.getLayoutParams(); - if("-1".equals(height)){ - params.height=ViewGroup.LayoutParams.MATCH_PARENT; - }else { - params.height = useDp?DpUtil.dp2px(Integer.parseInt(height)):Integer.parseInt(height); + if ("-1".equals(height)) { + params.height = ViewGroup.LayoutParams.MATCH_PARENT; + } else { + params.height = useDp ? DpUtil.dp2px(Integer.parseInt(height)) : Integer.parseInt(height); } mWebView.setLayoutParams(params); mWebView.setVisibility(View.VISIBLE); @@ -515,22 +516,30 @@ public class JavascriptInterfaceUtils { /** * 社区分享 + * * @param avatar 头像 - * @param link 分享连接 + * @param link 分享连接 */ @JavascriptInterface - public void androidCommunityShare(String avatar,String link){ - JSONObject json=new JSONObject(); - json.put("avatar",avatar); - json.put("link",link); + public void androidCommunityShare(String avatar, String link) { + JSONObject json = new JSONObject(); + json.put("avatar", avatar); + json.put("link", link); Bus.get().post(new JavascriptInterfaceEvent() .setMethod("androidCommunityShare") .setData(json.toJSONString())); } + @JavascriptInterface - public void androidInviteShare(String url){ + public void androidInviteShare(String url) { Bus.get().post(new JavascriptInterfaceEvent() .setMethod("androidInviteShare") .setData(url)); } + + @JavascriptInterface + public void closeLiveRoom() { + Bus.get().post(new JavascriptInterfaceEvent() + .setMethod("closeLiveRoom")); + } } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index cadaa3f2c..04f310dbd 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -58,6 +58,7 @@ import com.yunbao.common.dialog.SlideSettingsDialog; import com.yunbao.common.dialog.YoursystemisolderDialog; import com.yunbao.common.event.CustomDrawerPopupEvent; import com.yunbao.common.event.FollowEvent; +import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; @@ -752,6 +753,15 @@ public class LiveAudienceActivity extends LiveActivity { } } + @Subscribe(threadMode = ThreadMode.MAIN) + public void onJavascriptInterfaceEvent(JavascriptInterfaceEvent event) { + if (!TextUtils.isEmpty(event.getMethod())) { + if (TextUtils.equals(event.getMethod(), "closeLiveRoom")) { + onBackPressed(); + } + } + } + /** * 跳转页面或者弹窗展示 * diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index e1ed47740..89d8dbbd3 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -338,7 +338,8 @@ public class LiveAudienceEvent extends BaseModel { LIVE_PK_ING(59, "PK中"), LIVE_PK_END(60, "PK结束"), XYD_COMPLETE(62, "心愿单完成"), - WISH_LIST_PROGRESS(61, "心愿单进度"); + WISH_LIST_PROGRESS(61, "心愿单进度"), + CLOSE_LIVE_ROOM(62, "关闭直播间"); private int type; private String name; diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 81a096d7f..0ce17e7bf 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1939,7 +1939,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis flipper.startFlipping(); flipper.setOnClickListener(view -> { - ToastUtil.show(String.valueOf(flipper.getDisplayedChild())); Bundle bundle = new Bundle(); String path = model.getHourchartH5Url(); if (!path.startsWith("/")) {