直播间开通贵族结束

This commit is contained in:
18401019693 2022-09-19 17:07:59 +08:00
parent f531fd4d0e
commit 1935ac14f0
6 changed files with 120 additions and 19 deletions

View File

@ -52,7 +52,7 @@ public class NobleNoticeView extends FrameLayout {
private RelativeLayout rootLayout;
private long animationTime = 8000;
private TextView gotoRoomView, nobleNickname, userName, anchorNickname;
private String mSvgaName, uhead,anchorUid;
private String mSvgaName, uhead, anchorUid;
private RoleType roleType;
private HorizontalScrollView contextLayout;
private RelativeLayout scrollLayout;
@ -87,6 +87,14 @@ public class NobleNoticeView extends FrameLayout {
anchorNickname = rootView.findViewById(R.id.anchor_nickname);
contextLayout.setVisibility(GONE);
gotoRoomView.setVisibility(GONE);
gotoRoomView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (callBack != null) {
callBack.gotoLive();
}
}
});
}
public NobleNoticeView setRootView(String uHead, String userNameStr, String anchorNicknameStr, String anchorUid) {
@ -409,4 +417,15 @@ public class NobleNoticeView extends FrameLayout {
return this;
}
}
private NobleNoticeCallBack callBack;
public NobleNoticeView setCallBack(NobleNoticeCallBack callBack) {
this.callBack = callBack;
return this;
}
public interface NobleNoticeCallBack {
void gotoLive();
}
}

View File

@ -686,7 +686,7 @@ public class LiveAudienceActivity extends LiveActivity {
break;
case NOBLE:
Constants.isTitle = true;
String nobleUrl = CommonAppConfig.HOST + "/h5/Nobility.html?nickname=" + userInfo.getUserNicename()
String nobleUrl = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + userInfo.getUserNicename()
+ "&usernobId=" + userInfo.getNobleId()
+ "&token=" + userInfo.getToken()
+ "&anchorUid=" + mLiveBean.getUid()

View File

@ -1,9 +1,5 @@
package com.yunbao.live.activity;
import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
@ -30,6 +26,7 @@ import androidx.annotation.RequiresApi;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustEvent;
import com.alibaba.android.arouter.launcher.ARouter;
import com.opensource.svgaplayer.SVGACallback;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
@ -46,6 +43,10 @@ import com.yunbao.live.R;
import java.net.MalformedURLException;
import java.net.URL;
import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
public class ZhuangBanActivity extends AbsActivity {
private ProgressBar mProgressBar;
@ -69,8 +70,8 @@ public class ZhuangBanActivity extends AbsActivity {
LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
svga = (SVGAImageView) findViewById(R.id.svga);
title=findViewById(R.id.ft_title);
if (isFullWindow){
title = findViewById(R.id.ft_title);
if (isFullWindow) {
title.setVisibility(View.GONE);
}
mWebView = new WebView(mContext);
@ -157,6 +158,7 @@ public class ZhuangBanActivity extends AbsActivity {
new SVGAParser(mContext).parse(new URL(svg), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
svga.setVisibility(View.VISIBLE);
SVGADrawable drawable = new SVGADrawable(videoItem);
svga.setImageDrawable(drawable);
svga.setLoops(1);
@ -167,6 +169,28 @@ public class ZhuangBanActivity extends AbsActivity {
public void onError() {
}
});
svga.setCallback(new SVGACallback() {
@Override
public void onPause() {
}
@Override
public void onFinished() {
svga.clear();
svga.setVisibility(View.GONE);
}
@Override
public void onRepeat() {
}
@Override
public void onStep(int i, double v) {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}

View File

@ -2274,49 +2274,56 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
.setRoleType(NobleNoticeView.RoleType.BARON);
.setRoleType(NobleNoticeView.RoleType.BARON)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
case "2":
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
.setRoleType(NobleNoticeView.RoleType.VISCOUNT);
.setRoleType(NobleNoticeView.RoleType.VISCOUNT)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
case "3":
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
.setRoleType(NobleNoticeView.RoleType.MARQUIS);
.setRoleType(NobleNoticeView.RoleType.MARQUIS)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
case "4":
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
.setRoleType(NobleNoticeView.RoleType.DUKE);
.setRoleType(NobleNoticeView.RoleType.DUKE)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
case "5":
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
.setRoleType(NobleNoticeView.RoleType.KING);
.setRoleType(NobleNoticeView.RoleType.KING)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
case "6":
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
.setRoleType(NobleNoticeView.RoleType.EMPEROR);
.setRoleType(NobleNoticeView.RoleType.EMPEROR)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
case "7":
noble.setRootView(bean.getUhead(),
bean.getUname(),
bean.getAncherName(),
bean.getAnchorUid())
.setRoleType(NobleNoticeView.RoleType.BETTER_EMPEROR);
.setRoleType(NobleNoticeView.RoleType.BETTER_EMPEROR)
.setCallBack(() -> gotoLive(bean.getRoomnum()));
break;
}
}

View File

@ -7,7 +7,6 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import androidx.annotation.RequiresApi;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
@ -21,9 +20,12 @@ import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import androidx.annotation.RequiresApi;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.opensource.svgaplayer.SVGACallback;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
@ -184,6 +186,7 @@ public class RewardActivity extends AbsActivity {
new SVGAParser(mContext).parse(new URL(svg), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
svga.setVisibility(View.VISIBLE);
SVGADrawable drawable = new SVGADrawable(videoItem);
svga.setImageDrawable(drawable);
svga.setLoops(1);
@ -194,6 +197,28 @@ public class RewardActivity extends AbsActivity {
public void onError() {
}
});
svga.setCallback(new SVGACallback() {
@Override
public void onPause() {
}
@Override
public void onFinished() {
svga.clear();
svga.setVisibility(View.GONE);
}
@Override
public void onRepeat() {
}
@Override
public void onStep(int i, double v) {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
@ -215,7 +240,7 @@ public class RewardActivity extends AbsActivity {
@JavascriptInterface
public void gotoHomePage(String indexStr) {
Log.e("tgasss","indexStr3"+indexStr);
Log.e("tgasss", "indexStr3" + indexStr);
if (!"".equals(indexStr) && indexStr != null) {
int index = -1;

View File

@ -7,7 +7,6 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import androidx.annotation.RequiresApi;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
@ -21,8 +20,11 @@ import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import androidx.annotation.RequiresApi;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.opensource.svgaplayer.SVGACallback;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
@ -189,16 +191,40 @@ public class ZhuangBanActivity extends AbsActivity {
new SVGAParser(mContext).parse(new URL(svg), new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
svga.setVisibility(View.VISIBLE);
SVGADrawable drawable = new SVGADrawable(videoItem);
svga.setImageDrawable(drawable);
svga.setLoops(1);
svga.startAnimation();
}
@Override
public void onError() {
}
});
svga.setCallback(new SVGACallback() {
@Override
public void onPause() {
}
@Override
public void onFinished() {
svga.clear();
svga.setVisibility(View.GONE);
}
@Override
public void onRepeat() {
}
@Override
public void onStep(int i, double v) {
}
});
} catch (MalformedURLException e) {
e.printStackTrace();
}
@ -217,7 +243,7 @@ public class ZhuangBanActivity extends AbsActivity {
@JavascriptInterface
public void gotoHomePage(String indexStr) {
Log.e("tgasss","indexStr2"+indexStr);
Log.e("tgasss", "indexStr2" + indexStr);
if (!"".equals(indexStr) && indexStr != null) {
int index = -1;
if ("0".equals(indexStr)) {