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/manager/base/ACache.java b/common/src/main/java/com/yunbao/common/manager/base/ACache.java index 3876b7f00..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 @@ -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,8 +161,9 @@ public class ACache { String readString = ""; String currentLine; while ((currentLine = in.readLine()) != null) { - readString += currentLine; + readString += currentLine + "\n"; } + readString = readString.substring(0, readString.length() - 1); if (!Utils.isDue(readString)) { return Utils.clearDateInfo(readString); } else { 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..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(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/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..541f07392 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/utils/ToastUtils.java @@ -0,0 +1,46 @@ +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; +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); + toast.setGravity(Gravity.CENTER, 0, 0); + } + } + public void setGravity(int gravity){ + toast.setGravity(Gravity.CENTER, 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/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/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 000000000..fc50e780e Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/bg_lwhqz.png differ 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 diff --git a/config.gradle b/config.gradle index 7cd3fa4b2..95a3f25a3 100644 --- a/config.gradle +++ b/config.gradle @@ -4,7 +4,7 @@ ext { buildToolsVersion: "29.0.2", minSdkVersion : 21, targetSdkVersion : 31, - versionCode : 419, + versionCode : 418, versionName : "6.5.0" ] manifestPlaceholders = [ 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/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; } + } 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/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/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/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/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index 2c4dd2482..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); @@ -1177,6 +1178,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/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(); 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..0ce17e7bf 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; @@ -353,9 +353,10 @@ 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;//主播名字 + private boolean isHinde = false; @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { @@ -554,9 +555,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) { @@ -657,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);//配置 @@ -1032,6 +1033,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 +1347,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 +1508,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // initStarChallengeStatus(); enterRoomLeave.setVisibility(View.GONE); topBanner1.setVisibility(View.GONE); + topBanner2.setVisibility(View.GONE); + + removeDetailView(); } public void clearChat() { @@ -1928,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("/")) { @@ -4231,7 +4241,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()); @@ -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); } } @@ -4387,12 +4399,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); @@ -4521,6 +4535,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis showUserDialog(userId3); } }); + } private Runnable countdownRunnable = new Runnable() { @@ -4531,22 +4546,28 @@ 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); countdownHandler.removeCallbacks(countdownRunnable); Bus.get().post(new LiveAudienceEvent() .setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT)); - showAnchorSayAndCallAnchor(); } } }; public void removeDetailView() { + if (detailsView != null) { mRoot.removeView(detailsView); detailsView = null; } + mPkTimeCount = 0; + showAnchorSayAndCallAnchor(); + if (mHandler != null) { + mHandler.removeMessages(WHAT_PK_TIME); + } + isShowGif = false; } /** @@ -4726,11 +4747,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 @@ -4744,6 +4768,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis Log.i("女神说", "BannerBean: " + bean); } topBanner1.setVisibility(View.VISIBLE); + topBanner2.setVisibility(View.GONE); } } @@ -4761,7 +4786,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()) @@ -4776,6 +4804,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mTopBannerList.set(1, bannerBean); } topBanner1.update(mTopBannerList); + topBanner2.update(mTopBannerList); } } @@ -4862,6 +4891,79 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } }) .start(); + topBanner2.setAutoPlay(true) + .setPages(mTopBannerList, new TopBannerCustomViewHolder(false)) + .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(); } @@ -4872,12 +4974,15 @@ 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); mTopBannerList.add(0, call); topBanner1.update(mTopBannerList); + topBanner2.update(mTopBannerList); } } 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..2a86d0c06 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,9 @@ 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 +350,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 +493,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) { @@ -690,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)); + } } @@ -1970,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() { @@ -1992,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/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/item_live_chat.xml b/live/src/main/res/layout/item_live_chat.xml index 0f04421ea..59278a785 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" @@ -218,6 +220,7 @@ android:layout_height="26dp" android:layout_marginStart="10dp" android:layout_marginEnd="11dp" + android:clickable="false" android:src="@mipmap/btn_attention" /> diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 3c5c7d43c..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" /> @@ -2063,14 +2064,84 @@ 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"> + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + - \ No newline at end of file + 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 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..aa188c6ac 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; @@ -196,7 +197,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene @Override protected void main() { ConversationIMListManager.get(this); - //在请求一下这个接口给我后台版本号 CommonHttpUtil.getConfig(mContext, new CommonCallback() { @Override @@ -828,7 +828,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 +869,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()+"是"); 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(); } } }