From 3b351ffad8e69e73b59fd25aeba941bedf14c2fb Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 22 Aug 2023 10:13:57 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/activity/WebViewActivity.java | 13 ++++++---- .../common/event/GiftWallItemEvent.java | 10 +++++++ .../com/yunbao/common/http/PDLiveApi.java | 3 ++- .../common/http/live/LiveNetManager.java | 4 +-- .../com/yunbao/common/pay/PayPresenter.java | 2 +- .../views/GiftAlreadyWallViewHolder.java | 4 +-- .../views/GiftWithoutWallViewHolder.java | 2 +- .../res/layout/item_gift_already_wall.xml | 2 ++ .../res/layout/item_gift_without_wall.xml | 1 + config.gradle | 4 +-- .../live/activity/GiftWallActivity.java | 2 +- .../yunbao/live/activity/LiveActivity.java | 2 +- .../live/activity/LiveAnchorActivity.java | 2 +- .../live/activity/LiveAudienceActivity.java | 8 +++--- .../live/activity/LiveRyAnchorActivity.java | 4 +-- .../activity/MyTUIConversationFragment.java | 2 +- .../live/activity/WebViewActivityMedal.java | 19 +++----------- .../live/activity/ZhuangBanActivity.java | 26 +++++++++---------- .../adapter/SystemChatMessageAdapter.java | 2 +- .../yunbao/live/dialog/GiftWallDialog.java | 3 ++- .../yunbao/live/dialog/GiftWallItemPopup.java | 12 ++++++--- .../live/dialog/HighNobilityDialog.java | 2 +- .../dialog/LiveChatListDialogFragment.java | 2 +- .../live/dialog/LiveHDDialogFragment.java | 2 +- .../live/dialog/MedalAchievementPopup.java | 2 +- .../live/presenter/LiveGiftAnimPresenter.java | 4 +-- .../yunbao/live/views/LiveRoomViewHolder.java | 12 ++++----- .../live/views/LiveRyAnchorViewHolder.java | 4 +-- .../yunbao/live/views/SidebarViewHoler.java | 2 +- .../live/views/TurnTableWebViewHolder.java | 2 +- .../main/activity/BindUserActivity.java | 4 +-- .../main/activity/EditProfileActivity.java | 2 +- .../yunbao/main/activity/EntryActivity.java | 8 +++--- .../yunbao/main/activity/LoginActivity.java | 2 +- .../yunbao/main/activity/MainActivity.java | 2 +- .../yunbao/main/activity/MyCoinActivity.java | 4 +-- .../main/activity/MyProfitActivity.java | 2 +- .../PDLiveConversationListActivity.java | 2 +- .../main/activity/RegisterActivity.java | 4 +-- .../yunbao/main/activity/SettingActivity.java | 2 +- .../main/activity/ZhuangBanActivity.java | 15 +++-------- .../main/adapter/SystemMessageAdapter.java | 2 +- .../yunbao/main/dialog/ReturnUserDialog.java | 2 +- .../main/views/MainHomeLiveViewHolder.java | 2 +- .../yunbao/main/views/MainMeViewHolder.java | 8 +++--- .../yunbao/main/views/MainMeViewHolder1.java | 8 +++--- 46 files changed, 115 insertions(+), 113 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java index 8c44a391e..efa509052 100644 --- a/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java +++ b/common/src/main/java/com/yunbao/common/activity/WebViewActivity.java @@ -248,7 +248,10 @@ public class WebViewActivity extends AbsActivity { mValueCallback2 = null; } - public static void forward(Context context, String url, boolean addArgs) { + private static boolean mIsLive = false; + + public static void forward(Context context, String url, boolean addArgs, boolean isLive) { + mIsLive = isLive; if (Constants.LoginKefu) { if (addArgs) { url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); @@ -259,8 +262,8 @@ public class WebViewActivity extends AbsActivity { context.startActivity(intent); } - public static void forward(Context context, String url) { - forward(context, url, true); + public static void forward(Context context, String url,boolean isLive) { + forward(context, url, true, isLive); } @@ -405,9 +408,9 @@ public class WebViewActivity extends AbsActivity { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } - if (!"".endsWith(Constants.mStream)) { + if (mIsLive) { finish(); - if(MicStatusManager.getInstance().isMic(liveUid)){ + if (MicStatusManager.getInstance().isMic(liveUid)) { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } diff --git a/common/src/main/java/com/yunbao/common/event/GiftWallItemEvent.java b/common/src/main/java/com/yunbao/common/event/GiftWallItemEvent.java index 97596c1a2..54b12be0a 100644 --- a/common/src/main/java/com/yunbao/common/event/GiftWallItemEvent.java +++ b/common/src/main/java/com/yunbao/common/event/GiftWallItemEvent.java @@ -7,6 +7,16 @@ public class GiftWallItemEvent extends BaseModel { private GiftWallModel giftWallModel; private boolean unlit; + private boolean csb; + + public boolean isCsb() { + return csb; + } + + public GiftWallItemEvent setCsb(boolean csb) { + this.csb = csb; + return this; + } public GiftWallModel getGiftWallModel() { return giftWallModel; diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 17566a7b4..47049923e 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -889,7 +889,8 @@ public interface PDLiveApi { @GET("/api/public/?service=Gift.giftDetail") Observable> giftDetail( @Query("liveuid") String liveUid, - @Query("gift_id") String giftId + @Query("gift_id") String giftId, + @Query("to_uid") String toUid ); /** diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index a384b702a..b385a72fb 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -1929,9 +1929,9 @@ public class LiveNetManager { }).isDisposed(); } - public void giftDetail(String liveUid, String giftId, HttpCallback callback) { + public void giftDetail(String liveUid, String giftId, String toUid, HttpCallback callback) { API.get().pdLiveApi(mContext) - .giftDetail(liveUid, giftId) + .giftDetail(liveUid, giftId,toUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer>() { diff --git a/common/src/main/java/com/yunbao/common/pay/PayPresenter.java b/common/src/main/java/com/yunbao/common/pay/PayPresenter.java index cef5e3b2c..b8bd3f2a2 100644 --- a/common/src/main/java/com/yunbao/common/pay/PayPresenter.java +++ b/common/src/main/java/com/yunbao/common/pay/PayPresenter.java @@ -239,7 +239,7 @@ public class PayPresenter { public void open(String url){ //支付时内部跳转 false要添加 - WebViewActivity.forward(mActivity,url,false); + WebViewActivity.forward(mActivity,url,false,false); } diff --git a/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java b/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java index 56fd9798d..83eab3ae1 100644 --- a/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/GiftAlreadyWallViewHolder.java @@ -25,14 +25,14 @@ public class GiftAlreadyWallViewHolder extends RecyclerView.ViewHolder { giftNumber = itemView.findViewById(R.id.gift_number); } - public void showData(GiftWallModel giftWallModel,boolean sbWy) { + public void showData(GiftWallModel giftWallModel, boolean sbWy) { giftTitle.setText(giftWallModel.getGiftname()); giftNumber.setText("*" + giftWallModel.getGiftCountNumber()); ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg); ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - Bus.get().post(new GiftWallItemEvent().setGiftWallModel(giftWallModel).setUnlit(true)); + Bus.get().post(new GiftWallItemEvent().setGiftWallModel(giftWallModel).setUnlit(true).setCsb(true)); } }); } diff --git a/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java b/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java index 9cd0d6f9e..60ac40f6f 100644 --- a/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/GiftWithoutWallViewHolder.java @@ -30,7 +30,7 @@ public class GiftWithoutWallViewHolder extends RecyclerView.ViewHolder { ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - Bus.get().post(new GiftWallItemEvent().setGiftWallModel(giftWallModel).setUnlit(false)); + Bus.get().post(new GiftWallItemEvent().setGiftWallModel(giftWallModel).setUnlit(false).setCsb(false)); } }); } diff --git a/common/src/main/res/layout/item_gift_already_wall.xml b/common/src/main/res/layout/item_gift_already_wall.xml index b5c177cc9..80d396938 100644 --- a/common/src/main/res/layout/item_gift_already_wall.xml +++ b/common/src/main/res/layout/item_gift_already_wall.xml @@ -19,12 +19,14 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="9dp" + android:gravity="center" android:text="@string/instant_light" android:textColor="#FFFFFF" android:textSize="14sp" /> diff --git a/config.gradle b/config.gradle index 08d317359..5f3bc3427 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 -// serverHost : " https://ceshi.yaoulive.com", + serverHost : " https://ceshi.yaoulive.com", diff --git a/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java b/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java index 840ce3226..b07ce9b6d 100644 --- a/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/GiftWallActivity.java @@ -198,7 +198,7 @@ public class GiftWallActivity extends AbsActivity { @Subscribe(threadMode = ThreadMode.MAIN) public void onGiftWallItemEvent(GiftWallItemEvent event) { new XPopup.Builder(this) - .asCustom(new GiftWallItemPopup(this, event.getGiftWallModel(), event.isUnlit(), mLiveUid, mLiveUid, mStream, false)) + .asCustom(new GiftWallItemPopup(this, event.getGiftWallModel(), event.isUnlit(), mLiveUid, mLiveUid, mStream, false,event.isCsb())) .show(); } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index f04552923..64ece985f 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -898,7 +898,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL @Override public void onClick(View v) { String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"; - WebViewActivity.forward(mContext, url); + WebViewActivity.forward(mContext, url,true); dialog.dismiss(); } }); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java index 616624131..eb4ebaa30 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java @@ -282,7 +282,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"); - ZhuangBanActivity.forward(mContext, url, false); + ZhuangBanActivity.forward(mContext, url, false,0); break; case Constants.LIVE_FUNC_LINK_MIC://连麦 openLinkMicAnchorWindow(); 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 416e10995..b21768400 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -888,7 +888,7 @@ public class LiveAudienceActivity extends LiveActivity { RouteUtil.forwardEditProfileActivity(); } else { if (!screen) { - ZhuangBanActivity.forward(mContext, htmlUrl, false); + ZhuangBanActivity.forward(mContext, htmlUrl, false,1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl); @@ -1095,7 +1095,7 @@ public class LiveAudienceActivity extends LiveActivity { String weeklyStarUrl = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + userInfo.getId() + "&token=" + userInfo.getToken() + "&anchorUid=" + mLiveUid; - ZhuangBanActivity.forward(mContext, weeklyStarUrl, false); + ZhuangBanActivity.forward(mContext, weeklyStarUrl, false,1); break; case NOBLE: Constants.isTitle = true; @@ -1105,7 +1105,7 @@ public class LiveAudienceActivity extends LiveActivity { + "&anchorUid=" + mLiveBean.getUid() + "&ancherName=" + mLiveBean.getUserNiceName() + "&uid=" + userInfo.getId(); - ZhuangBanActivity.forward(mContext, nobleUrl, false); + ZhuangBanActivity.forward(mContext, nobleUrl, false,1); break; case LIAN_MAI: if (event.getMicIng() == 1) { @@ -1503,7 +1503,7 @@ public class LiveAudienceActivity extends LiveActivity { FirebaseAnalytics.getInstance(mContext).logEvent("FS_customer_service", null); AppEventsLogger.newLogger(mContext).logEvent("FB_customer_service"); if (bean.getLink() != null && !"".equals(bean.getLink())) { - WebViewActivity.forward(mContext, bean.getLink()); + WebViewActivity.forward(mContext, bean.getLink(), true); } else { startActivity(new Intent(mContext, SystemMessageActivity.class) .putExtra("type", bean.getType()) 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 008d0e75a..72f87232f 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -488,7 +488,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl break; case Constants.LIVE_FUNC_WKS: String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; - ZhuangBanActivity.forward(mContext, url, false); + ZhuangBanActivity.forward(mContext, url, false,0); break; case Constants.LIVE_FUNC_LINK_MIC://连麦 if (isDRPK != 1) { @@ -1539,7 +1539,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl String weeklyStarUrl = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + userInfo.getId() + "&token=" + userInfo.getToken() + "&anchorUid=" + mLiveUid; - ZhuangBanActivity.forward(mContext, weeklyStarUrl, false); + ZhuangBanActivity.forward(mContext, weeklyStarUrl, false,0); break; case WISH_LIST: LiveWishListDialogFragment4Audience fragment4Audience = new LiveWishListDialogFragment4Audience(); diff --git a/live/src/main/java/com/yunbao/live/activity/MyTUIConversationFragment.java b/live/src/main/java/com/yunbao/live/activity/MyTUIConversationFragment.java index f3783bc35..ffdcf9b5b 100644 --- a/live/src/main/java/com/yunbao/live/activity/MyTUIConversationFragment.java +++ b/live/src/main/java/com/yunbao/live/activity/MyTUIConversationFragment.java @@ -172,7 +172,7 @@ public class MyTUIConversationFragment extends Fragment { systemMessageActivity.forward(getContext(), bean.getType(), "", bean.getTitle(), ""); } else if ("3".equals(bean.getType())) { if (bean.getLink() != null && !"".equals(bean.getLink())) { - WebViewActivity.forward(getActivity(), bean.getLink()); + WebViewActivity.forward(getActivity(), bean.getLink(),false); } else { systemMessageActivity.forward(getContext(), bean.getType(), "", bean.getTitle(), ""); } 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 838289baa..3a762d003 100644 --- a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java +++ b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java @@ -31,21 +31,19 @@ import com.yunbao.common.R; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.event.JavascriptInterfaceEvent; -import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.L; +import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.dialog.LiveUserDialogFragment; -import com.yunbao.common.http.LiveHttpUtil; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; -import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -182,16 +180,7 @@ public class WebViewActivityMedal extends AbsActivity { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } - if (!"".endsWith(Constants.mStream)) { - finish(); - if(MicStatusManager.getInstance().isMic(liveUid)){ - MicStatusManager.getInstance().showDownMicDialog(mContext); - return; - } - EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal))); - } else { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); - } + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); finish(); } @@ -313,7 +302,7 @@ public class WebViewActivityMedal extends AbsActivity { url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); } Intent intent = new Intent(context, WebViewActivityMedal.class); - intent.putExtra(Constants.URL, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + intent.putExtra(Constants.URL, url + "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); context.startActivity(intent); } diff --git a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java index 1bebdab02..ba0c6e15f 100644 --- a/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ZhuangBanActivity.java @@ -39,19 +39,19 @@ import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.event.JavascriptInterfaceEvent; +import com.yunbao.common.event.LiveRoomChangeEvent; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.L; +import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.R; -import com.yunbao.common.event.LiveRoomChangeEvent; -import com.yunbao.common.http.LiveHttpUtil; -import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.share.ui.InvitePopDialog; import org.greenrobot.eventbus.EventBus; @@ -76,6 +76,7 @@ public class ZhuangBanActivity extends AbsActivity { private FrameLayout title; private TextView titleView, htmlError; private RelativeLayout rootView; + private boolean mIsLive = false; @Override protected int getLayoutId() { @@ -87,6 +88,7 @@ public class ZhuangBanActivity extends AbsActivity { Bus.getOn(this); String url = getIntent().getStringExtra(Constants.URL); String titleString = getIntent().getStringExtra("title"); + mIsLive = getIntent().getIntExtra("isLive", 0) == 1; L.e("H5---2s>" + url); LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); mProgressBar = (ProgressBar) findViewById(R.id.progressbar); @@ -275,11 +277,7 @@ public class ZhuangBanActivity extends AbsActivity { if (isNeedExitActivity()) { finish(); } else { -// if (canGoBack()) { -// mWebView.goBack(); -// } else { finish(); -// } } } @@ -296,7 +294,8 @@ public class ZhuangBanActivity extends AbsActivity { return false; } - public static void forward(Context context, String url, boolean addArgs) { + + public static void forward(Context context, String url, boolean addArgs, int isLive) { if (addArgs) { url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); } @@ -306,11 +305,12 @@ public class ZhuangBanActivity extends AbsActivity { if (url.contains("Noble/index.html") || url.contains("RongYuQiang")) { intent.putExtra("title", ""); } + intent.putExtra("isLive", isLive); context.startActivity(intent); } - public static void forward(Context context, String url) { - forward(context, url, true); + public static void forward(Context context, String url, int isLive) { + forward(context, url, true, isLive); } @Override @@ -407,13 +407,13 @@ public class ZhuangBanActivity extends AbsActivity { return; } - if (!"".endsWith(Constants.mStream)) { - finish(); - if(MicStatusManager.getInstance().isMic(liveUid)){ + if (mIsLive) { + if (MicStatusManager.getInstance().isMic(liveUid)) { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, Integer.parseInt(liveTypeVal))); + finish(); } else { RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveTypeVal), Integer.parseInt(liveSdk)); } diff --git a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java index d326bb009..9deef145a 100644 --- a/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/SystemChatMessageAdapter.java @@ -98,7 +98,7 @@ public class SystemChatMessageAdapter extends RecyclerView.Adapter { forward(mContext, model1.getType(), "", model1.getTitle(), ""); } else if ("3".equals(model1.getType())) { if (model1.getLink() != null && !"".equals(model1.getLink())) { - WebViewActivity.forward(mContext, model1.getLink()); + WebViewActivity.forward(mContext, model1.getLink(),false); } else { forward(mContext, model1.getType(), "", model1.getTitle(), ""); } diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java index f0607fe99..c7a669be1 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java @@ -232,7 +232,8 @@ public class GiftWallDialog extends AbsDialogFragment { mLiveUid, toUid, mStream, - sbWy)) + sbWy, + event.isCsb())) .show(); } diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java b/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java index f9dbe6165..29f4191c7 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java @@ -31,10 +31,10 @@ public class GiftWallItemPopup extends CenterPopupView { private GiftWallModel giftWallModel; private boolean unlit; private String mLiveUid, mStream, toUid; - private boolean isAnchor = false, sbWy; + private boolean isAnchor = false, sbWy, csb; public GiftWallItemPopup(@NonNull Context context, GiftWallModel giftWallModel, - boolean unlit, String mLiveUid, String toUid, String mStream, boolean sbWy) { + boolean unlit, String mLiveUid, String toUid, String mStream, boolean sbWy, boolean csb) { super(context); this.giftWallModel = giftWallModel; this.unlit = unlit; @@ -42,6 +42,7 @@ public class GiftWallItemPopup extends CenterPopupView { this.toUid = toUid; this.mStream = mStream; this.sbWy = sbWy; + this.csb = csb; if (this.mLiveUid.equals(CommonAppConfig.getInstance().getUid())) { isAnchor = true; } @@ -100,10 +101,10 @@ public class GiftWallItemPopup extends CenterPopupView { public void loadData() { LiveNetManager.get(getContext()). - giftDetail(mLiveUid, String.valueOf(giftWallModel.getId()), new HttpCallback() { + giftDetail(mLiveUid, String.valueOf(giftWallModel.getId()), toUid, new HttpCallback() { @Override public void onSuccess(GiftWallGiftDetail data) { - if (data.getUid() == 0) { + if (data.getUid() == 0 || !csb) { ImgLoader.display(getContext(), R.mipmap.icon_vacant_position_awaits, avatar); vacantPositionAwaits.setText(getContext().getText(R.string.vacant_position_awaits)); vacantPosition.setText("?"); @@ -123,6 +124,9 @@ public class GiftWallItemPopup extends CenterPopupView { @Override public void onError(String error) { ToastUtil.show(error); + ImgLoader.display(getContext(), R.mipmap.icon_vacant_position_awaits, avatar); + vacantPositionAwaits.setText(getContext().getText(R.string.vacant_position_awaits)); + vacantPosition.setText("?"); } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/HighNobilityDialog.java b/live/src/main/java/com/yunbao/live/dialog/HighNobilityDialog.java index 79c89d915..7f09f37b0 100644 --- a/live/src/main/java/com/yunbao/live/dialog/HighNobilityDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/HighNobilityDialog.java @@ -55,7 +55,7 @@ public class HighNobilityDialog extends AbsDialogFragment { String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); - ZhuangBanActivity.forward(mContext, url, false); + ZhuangBanActivity.forward(mContext, url, false,0); }); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveChatListDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveChatListDialogFragment.java index cd659a7e3..fcb2fa7d4 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveChatListDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveChatListDialogFragment.java @@ -186,7 +186,7 @@ public class LiveChatListDialogFragment extends AbsDialogFragment { systemMessageActivity.forward(getContext(), bean.getType(), "", bean.getTitle(), ""); } else if ("3".equals(bean.getType())) { if (bean.getLink() != null && !"".equals(bean.getLink())) { - WebViewActivity.forward(getActivity(), bean.getLink()); + WebViewActivity.forward(getActivity(), bean.getLink(),false); } else { systemMessageActivity.forward(getContext(), bean.getType(), "", bean.getTitle(), ""); } 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 b696900cd..06389160d 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -371,7 +371,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment { 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; - ZhuangBanActivity.forward(mContext, url, false); + ZhuangBanActivity.forward(mContext, url, false,0); } } diff --git a/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java index 7d306ee5a..0342e1b8f 100644 --- a/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/MedalAchievementPopup.java @@ -111,7 +111,7 @@ public class MedalAchievementPopup extends BottomPopupView { .append(userInfo.getToken()) .append("&uid=") .append(userInfo.getId()); - ZhuangBanActivity.forward(getContext(), htmlUrl.toString(), false); + ZhuangBanActivity.forward(getContext(), htmlUrl.toString(), false,0); } }); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() { 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 0fc0e9baf..eb980aa0f 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -373,7 +373,7 @@ public class LiveGiftAnimPresenter { mGifGiftTipGroupBuyZuoji.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"),true); } }); } @@ -382,7 +382,7 @@ public class LiveGiftAnimPresenter { mGifGiftTipGroupBuyLiangName.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"),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 12209bb58..4e780859d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1797,7 +1797,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -1863,7 +1863,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -2017,10 +2017,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else { url = CommonAppConfig.HOST + "/h5/activity/firstTopUp/newUp.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); } - ZhuangBanActivity.forward(mContext, url, false); + ZhuangBanActivity.forward(mContext, url, false,1); } else if (link.equals("zxb")) { String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; - ZhuangBanActivity.forward(mContext, url, false); + ZhuangBanActivity.forward(mContext, url, false,1); } else if (link.equals("xyd")) { openWishListWindow(); } @@ -5272,7 +5272,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -5352,7 +5352,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis .append("&isZh=") .append(((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,1); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java index d190539db..c16b61d3f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java @@ -490,7 +490,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { .append(System.currentTimeMillis()); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,0); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -549,7 +549,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { .append("&g=Appapi&m=Wish&a=index"); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,0); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); diff --git a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java index fdc19cc31..78561638b 100644 --- a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java +++ b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java @@ -73,7 +73,7 @@ public class SidebarViewHoler extends RecyclerView.ViewHolder { showLoadingDialog(); String link = bean.getSlideUrl(); if (link.contains("http")) { - WebViewActivity.forward(itemView.getContext(), link, true); + WebViewActivity.forward(itemView.getContext(), link, true,false); if (mShowLoadingDialog != null && mShowLoadingDialog.isShowing()) mShowLoadingDialog.dismiss(); } else { diff --git a/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java b/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java index a433848ad..76fdc6b21 100644 --- a/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/TurnTableWebViewHolder.java @@ -128,7 +128,7 @@ public class TurnTableWebViewHolder extends AbsLivePageViewHolder implements Vie if (!TextUtils.isEmpty(event.getMethod())) { if (TextUtils.equals(event.getMethod(), "androidMethod")) { if (event.getData() != null && !event.getData().isEmpty()) { - WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0")); + WebViewActivity.forward(mContext, HtmlConfig.SHOP + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"),false); EventBus.getDefault().post(new JsTurnTableBean(event.getData())); } } diff --git a/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java b/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java index 4b6267a74..0782325d7 100644 --- a/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/BindUserActivity.java @@ -272,9 +272,9 @@ public class BindUserActivity extends AbsActivity { } else if (i == R.id.btn_register) { register(); } else if (i == R.id.btn_tip2) { - WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY1); + WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY1,false); } else if (i == R.id.btn_tip3) { - WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY2); + WebViewActivity.forward(mContext, HtmlConfig.REG_PRIVCAY2,false); } else if (i == R.id.btn_goto_updata) { lt_now_bind.setVisibility(View.GONE); lt_first_bind.setVisibility(View.VISIBLE); diff --git a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java index 5c3e6335c..8b69bb0cc 100644 --- a/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EditProfileActivity.java @@ -411,7 +411,7 @@ public class EditProfileActivity extends AbsActivity { @Override public void onClick(View v) { String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=task&a=index&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&tabIndex=1"; - WebViewActivity.forward(mContext, url); + WebViewActivity.forward(mContext, url,false); dialog.dismiss(); } }); diff --git a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java index d5cb65fac..a7857fd8c 100644 --- a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java @@ -208,14 +208,14 @@ public class EntryActivity extends AppCompatActivity { btn_tip1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY); + WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY,false); } }); btn_tip.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY1); + WebViewActivity.forward(EntryActivity.this, HtmlConfig.LOGIN_PRIVCAY1,false); } }); @@ -268,7 +268,7 @@ public class EntryActivity extends AppCompatActivity { if (data.getType().equals("0")) { LoginManager.getInstance().logInWithReadPermissions(EntryActivity.this, Arrays.asList("public_profile")); } else { - WebViewActivity.forward(EntryActivity.this, data.getLink() + "?"); + WebViewActivity.forward(EntryActivity.this, data.getLink() + "?",false); } } @@ -387,7 +387,7 @@ public class EntryActivity extends AppCompatActivity { public void onClick(View v) { if (!"".equals(kefuUrl)) { Constants.LoginKefu = true; - WebViewActivity.forward(EntryActivity.this, kefuUrl); + WebViewActivity.forward(EntryActivity.this, kefuUrl,false); } } }); diff --git a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java index 23876dee8..8082a2efb 100644 --- a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java @@ -239,7 +239,7 @@ public class LoginActivity extends AbsActivity { //登录即代表同意服务和隐私条款 private void forwardTip() { - WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY); + WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY,false); } 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 519b17c28..b14376874 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -279,7 +279,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } } else if (getIntent().getStringExtra("type") != null && getIntent().getStringExtra("type").equals("8")) { - WebViewActivity.forward(mContext, getIntent().getStringExtra("activityUrl"), true); + WebViewActivity.forward(mContext, getIntent().getStringExtra("activityUrl"), true,false); } FirebaseMessaging.getInstance().getToken() .addOnCompleteListener(new OnCompleteListener() { diff --git a/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java b/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java index c29b6f47a..d9b791298 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyCoinActivity.java @@ -297,10 +297,10 @@ public class MyCoinActivity extends AbsActivity implements OnItemClickListener