Merge branch 'master' into 6.5.0

# Conflicts:
#	config.gradle
This commit is contained in:
18401019693 2023-04-14 17:50:27 +08:00
commit df4d7d99ce
30 changed files with 450 additions and 177 deletions

View File

@ -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<String>() {
@Override

View File

@ -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 {

View File

@ -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<File> commonCallback) {
public static void getFile(Context context,String fileName, String url, String forwhat, final CommonCallback<File> 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<File> mDownloadGifCallback) {
public void downloadGiftForId(Context context,LiveGiftBean bean, CommonCallback<File> mDownloadGifCallback) {
if (checkGiftIsDownload(bean.getId())) {
mDownloadGifCallback.callback(getGiftForId(bean.getId()));
return;
}
clickId.add(bean.getId()+"");
getFile(getDownloadSaveName(bean.getId()), bean.getSwf(), "0", new CommonCallback<File>() {
getFile(context,getDownloadSaveName(bean.getId()), bean.getSwf(), "0", new CommonCallback<File>() {
@Override
public void callback(File bean) {
if(bean!=null) {

View File

@ -461,7 +461,7 @@ public class JavascriptInterfaceUtils {
} else {
url1 = svg;
}
GiftCacheUtil.getFile(Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback<File>() {
GiftCacheUtil.getFile(mContext, Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback<File>() {
@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"));
}
}

View File

@ -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);
}
}

View File

@ -326,7 +326,10 @@ public class LiveNewWishListPopup extends BottomPopupView {
}
List<WishModel2> 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<String>() {
@Override

View File

@ -0,0 +1,26 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:layout_gravity="center"
android:background="@mipmap/bg_lwhqz">
<TextView
android:id="@+id/ErrorTips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/gift_way"
android:textColor="#FFFFFF"
android:textSize="13sp"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:ellipsize="end"/>
</LinearLayout>
</FrameLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1118,4 +1118,5 @@
<string name="traditional_chinese">繁體中文</string>
<string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
<string name="must_hint">最多只能设置10条</string>
</resources>

View File

@ -1118,4 +1118,5 @@
<string name="traditional_chinese">繁體中文</string>
<string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
<string name="must_hint">最多只能设置10条</string>
</resources>

View File

@ -1118,4 +1118,5 @@
<string name="traditional_chinese">繁體中文</string>
<string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
<string name="must_hint">最多只能设置10条</string>
</resources>

View File

@ -282,7 +282,7 @@
<string name="golden_beans">Beans</string>
<string name="diamond">DO</string>
<string name="coins">Coins</string>
<string name="must_hint">A maximum of 10 entries can be set</string>
<string name="gxzb">Personalized Dress Up</string>
<string name="live_camera">Flip</string>
<string name="live_camera_s">Mirroring</string>

View File

@ -4,7 +4,7 @@ ext {
buildToolsVersion: "29.0.2",
minSdkVersion : 21,
targetSdkVersion : 31,
versionCode : 419,
versionCode : 418,
versionName : "6.5.0"
]
manifestPlaceholders = [

View File

@ -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();
}
}
}
/**
* 跳转页面或者弹窗展示
*

View File

@ -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;
}
}

View File

@ -208,7 +208,7 @@ public class LiveGiftAdapter extends RecyclerView.Adapter<LiveGiftAdapter.Vh> {
mLoading.startAnimation(animation);
LiveGiftBean bean = mList.get((Integer) v.getTag());
GiftCacheUtil.getInstance().pause();
GiftCacheUtil.getInstance().downloadGiftForId(bean, new CommonCallback<File>() {
GiftCacheUtil.getInstance().downloadGiftForId(mContext,bean, new CommonCallback<File>() {
@Override
public void callback(File bean) {
if(bean==null){

View File

@ -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);
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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();

View File

@ -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--->", "还原916");
Log.i(TAG, "还原916");
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--->", "还原916");
Log.i(TAG, "onPrepared:还原916 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:还原169");
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();

View File

@ -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<LiveAnchorCallMeModel>() {
@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);
}
}

View File

@ -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);
}
}
}

View File

@ -20,6 +20,14 @@ import com.yunbao.live.R;
public class TopBannerCustomViewHolder implements BannerViewHolder<BannerBean> {
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<BannerBean> {
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

View File

@ -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" />
</LinearLayout>

View File

@ -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">
<RelativeLayout
android:id="@+id/mic_view2"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:visibility="invisible">
<View
android:layout_width="41dp"
android:layout_height="41dp"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_live_mic_av" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/mic_ico2"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:layout_marginBottom="11dp"
android:scaleType="centerCrop"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@mipmap/voice" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/mic_view1"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:visibility="invisible">
<View
android:layout_width="41dp"
android:layout_height="41dp"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_live_mic_av" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/mic_ico1"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:layout_marginBottom="11dp"
android:scaleType="centerCrop"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@mipmap/voice" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/mic_view"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_marginTop="10dp"
android:visibility="gone">
<View
@ -2100,73 +2171,6 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/mic_view1"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_marginTop="19dp"
android:visibility="gone">
<View
android:layout_width="41dp"
android:layout_height="41dp"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_live_mic_av" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/mic_ico1"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:layout_marginBottom="11dp"
android:scaleType="centerCrop"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@mipmap/voice" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/mic_view2"
android:layout_width="40dp"
android:layout_height="50dp"
android:layout_marginTop="19dp"
android:visibility="gone">
<View
android:layout_width="41dp"
android:layout_height="41dp"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_live_mic_av" />
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/mic_ico2"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="1dp"
android:layout_marginBottom="11dp"
android:scaleType="centerCrop"
android:src="@drawable/m_chu_xia"
app:riv_oval="true" />
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@mipmap/voice" />
</RelativeLayout>
</LinearLayout>
<com.yunbao.common.views.weight.FullServiceNotificationView
@ -2185,6 +2189,17 @@
android:gravity="bottom"
android:orientation="vertical">
<com.ms.banner.Banner
android:id="@+id/top_banner2"
android:layout_width="52dp"
android:layout_height="76dp"
android:layout_marginTop="20dp"
android:layout_marginRight="5dp"
app:delay_time="5000"
android:visibility="gone"
app:indicator_height="8dp"
app:indicator_width="8dp" />
<LinearLayout
android:id="@+id/lt_trickery"
android:layout_width="50dp"
@ -2387,4 +2402,4 @@
app:autoPlay="true" />
</RelativeLayout>
</RelativeLayout>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="52dp"
android:layout_height="66dp">
<ImageView
android:id="@+id/imageView7"
android:layout_width="52dp"
android:layout_height="56dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/bg_live_top_banner" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="12dp"
android:visibility="visible"
app:autoPlay="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:background="@drawable/bg_live_top_banner_text"
android:paddingStart="5dp"
android:paddingTop="2dp"
android:paddingEnd="5dp"
android:paddingBottom="2dp"
android:text="@string/live_ready_anchor_call_me"
android:textColor="@color/white"
android:textSize="8sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/svga" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -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<ConfigBean>() {
@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<File>() {
GiftCacheUtil.getFile(MainActivity.this,Constants.GIF_GIFT_PREFIX + list.get(j).getId(), list.get(j).getSwf(), "0", new CommonCallback<File>() {
@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<File>() {
GiftCacheUtil.getFile(MainActivity.this,Constants.GIF_CAR_PREFIX + id, url1, "0", new CommonCallback<File>() {
@Override
public void callback(File bean) {
// Log.e("111",bean.getPath()+"");

View File

@ -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();
}
}
}