Merge branch 'master' into dev_share

This commit is contained in:
zlzw 2023-03-30 11:47:44 +08:00
commit ef8f87d100
155 changed files with 4555 additions and 338 deletions

View File

@ -8,6 +8,7 @@ import android.os.Looper;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import com.yunbao.common.BuildConfig;
import com.yunbao.common.bean.CrashSaveBean; import com.yunbao.common.bean.CrashSaveBean;
import com.yunbao.common.utils.FileUtil; import com.yunbao.common.utils.FileUtil;
import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.SpUtil;
@ -101,7 +102,9 @@ public class NeverCrashUtils {
Log.e(TAG, "未捕获的主线程异常行为", e); Log.e(TAG, "未捕获的主线程异常行为", e);
} }
e.printStackTrace(); e.printStackTrace();
//Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show(); if(BuildConfig.DEBUG) {
Toast.makeText(application, "发生闪退:"+e.getMessage(), Toast.LENGTH_SHORT).show();
}
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log"); FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()), throwableToString(e), "error.log");
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e); getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
// return; // return;

View File

@ -16,6 +16,7 @@ public class BannerBean {
private int type; private int type;
private String name; private String name;
private int activityId=0; private int activityId=0;
private int mIconRes;
private StarChallengeStatusModel model; private StarChallengeStatusModel model;
@ -100,6 +101,14 @@ public class BannerBean {
this.activityId = activityId; this.activityId = activityId;
} }
public int getIconRes() {
return mIconRes;
}
public void setIconRes(int mIconRes) {
this.mIconRes = mIconRes;
}
@Override @Override
public String toString() { public String toString() {
return "BannerBean{" + return "BannerBean{" +

View File

@ -28,4 +28,12 @@ public class HttpCallbackModel extends BaseModel {
public void setMsg(String msg) { public void setMsg(String msg) {
this.msg = msg; this.msg = msg;
} }
@Override
public String toString() {
return "HttpCallbackModel{" +
"code=" + code +
", msg='" + msg + '\'' +
'}';
}
} }

View File

@ -0,0 +1,162 @@
package com.yunbao.common.bean;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.annotations.SerializedName;
/**
* 联系方式
*/
public class LiveAnchorCallMeModel extends BaseModel {
@SerializedName("id")
private int id;
@SerializedName("isShow")
private int isShow;
@SerializedName("gift_id")
private int giftId;
@SerializedName("giftImage")
private String giftImage;
@SerializedName("content")
private String content;
@SerializedName("wechat")
private AppBean wechat;
@SerializedName("line")
private AppBean line;
@SerializedName("whatsApp")
private AppBean whatsApp;
public LiveAnchorCallMeModel() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getGiftImage() {
return giftImage;
}
public void setGiftImage(String giftImage) {
this.giftImage = giftImage;
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
public int getGiftId() {
return giftId;
}
public void setGiftId(int giftId) {
this.giftId = giftId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public AppBean getWechat() {
if (wechat == null) {
wechat = new AppBean();
}
return wechat;
}
public void setWechat(AppBean wechat) {
this.wechat = wechat;
}
public AppBean getLine() {
if (line == null) {
line = new AppBean();
}
return line;
}
public void setLine(AppBean line) {
this.line = line;
}
public AppBean getWhatsApp() {
if (whatsApp == null) {
whatsApp = new AppBean();
}
return whatsApp;
}
public void setWhatsApp(AppBean whatsApp) {
this.whatsApp = whatsApp;
}
@Override
public String toString() {
return "LiveAnchorCallMeModel{" +
"id=" + id +
", isShow=" + isShow +
", giftId=" + giftId +
", giftImage='" + giftImage + '\'' +
", content='" + content + '\'' +
", wechat=" + wechat +
", line=" + line +
", whatsApp=" + whatsApp +
'}';
}
public static class AppBean {
private String number;
private int isShow;
public AppBean() {
}
public AppBean(String number, int isShow) {
this.number = number;
this.isShow = isShow;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
@NonNull
@Override
public String toString() {
return "AppBean{" +
"number='" + number + '\'' +
", isShow=" + isShow +
'}';
}
public JSONObject toJSONObject() {
return (JSONObject) JSON.toJSON(this);
}
}
}

View File

@ -0,0 +1,80 @@
package com.yunbao.common.bean;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class LiveAnchorSayModel extends BaseModel{
@SerializedName("livePreview")
private LivePreview livePreview;
@SerializedName("style")
private List<String> style;
public LiveAnchorSayModel() {
}
public LivePreview getLivePreview() {
return livePreview;
}
public void setLivePreview(LivePreview livePreview) {
this.livePreview = livePreview;
}
public List<String> getStyle() {
return style;
}
public void setStyle(List<String> style) {
this.style = style;
}
public class LivePreview{
private int isShow;
private String content;
private String styleImage;
public LivePreview() {
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getStyleImage() {
return styleImage;
}
public void setStyleImage(String styleImage) {
this.styleImage = styleImage;
}
@Override
public String toString() {
return "LivePreview{" +
"isShow=" + isShow +
", content='" + content + '\'' +
", styleImage='" + styleImage + '\'' +
'}';
}
}
@Override
public String toString() {
return "LiveAnchorSayModel{" +
"livePreview=" + livePreview +
", style=" + style +
'}';
}
}

View File

@ -0,0 +1,155 @@
package com.yunbao.common.bean;
import androidx.annotation.NonNull;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.utils.StringUtil;
public class LiveUserMailBoxModel extends BaseModel {
@SerializedName("id")
private int id;
@SerializedName("uid")
private int uid;
@SerializedName("liveuid")
private int liveUid;
@SerializedName("is_read")
private int isRead;
@SerializedName("content")
private String content;
@SerializedName("create_time")
private String createTime;
@SerializedName("gift_id")
private int giftId;
@SerializedName("userName")
private String userName;
@SerializedName("anchorName")
private String anchorName;
@SerializedName("url")
private String url;
public LiveUserMailBoxModel() {
}
public LiveUserMailBoxModel(int id, int uid, int liveUid, String content, String createTime, int giftId, String userName, String anchorName) {
this.id = id;
this.uid = uid;
this.liveUid = liveUid;
this.content = content;
this.createTime = createTime;
this.giftId = giftId;
this.userName = userName;
this.anchorName = anchorName;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
public int getLiveUid() {
return liveUid;
}
public void setLiveUid(int liveUid) {
this.liveUid = liveUid;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public int getGiftId() {
return giftId;
}
public void setGiftId(int giftId) {
this.giftId = giftId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getAnchorName() {
return anchorName;
}
public void setAnchorName(String anchorName) {
this.anchorName = anchorName;
}
public int getIsRead() {
return isRead;
}
public void setIsRead(int isRead) {
this.isRead = isRead;
}
public String getUrl() {
if (StringUtil.isEmpty(url)) {
url = "http://www.baidu.com";
} else {
if (!url.startsWith("http")) {
url = CommonAppConfig.HOST + "/" + url;
}
if (url.contains("?")) {
url += "&";
} else {
url += "?";
}
url += "uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken();
}
return url;
}
public void setUrl(String url) {
this.url = url;
}
@NonNull
@Override
public String toString() {
return "LiveUserMailBoxModel{" +
"id=" + id +
", uid=" + uid +
", liveUid=" + liveUid +
", isRead=" + isRead +
", content='" + content + '\'' +
", createTime='" + createTime + '\'' +
", giftId=" + giftId +
", userName='" + userName + '\'' +
", anchorName='" + anchorName + '\'' +
", url='" + url + '\'' +
'}';
}
}

View File

@ -2,6 +2,7 @@ package com.yunbao.common.bean;
import android.text.TextUtils; import android.text.TextUtils;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
/** /**
@ -17,6 +18,17 @@ public class NewLevelModel extends BaseModel {
private String levemax; private String levemax;
@SerializedName("thumb") @SerializedName("thumb")
private String thumb; private String thumb;
@SerializedName("icon")
private String icon;
@SerializedName("colour")
private String colour;
@SerializedName("live_icon")
private String liveIcon = "https://downs.yaoulive.com/level1/img_1-9.png";
public static NewLevelModel objectFromData(String str) {
return new Gson().fromJson(str, NewLevelModel.class);
}
public String getId() { public String getId() {
return id; return id;
@ -67,4 +79,28 @@ public class NewLevelModel extends BaseModel {
this.thumb = thumb; this.thumb = thumb;
return this; return this;
} }
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getColour() {
return colour;
}
public void setColour(String colour) {
this.colour = colour;
}
public String getLiveIcon() {
return liveIcon;
}
public void setLiveIcon(String liveIcon) {
this.liveIcon = liveIcon;
}
} }

View File

@ -27,6 +27,7 @@ public abstract class AbsDialogPopupWindow extends BottomPopupView {
public void showDialog() { public void showDialog() {
XPopup.Builder builder = new XPopup.Builder(mContext); XPopup.Builder builder = new XPopup.Builder(mContext);
builder.isDestroyOnDismiss(true); builder.isDestroyOnDismiss(true);
builder.enableDrag(false);
buildDialog(builder); buildDialog(builder);
builder.asCustom(this).show(); builder.asCustom(this).show();
} }

View File

@ -44,7 +44,7 @@ public class API extends BaseApi {
public PDLiveApi pdLiveApi(Context context) { public PDLiveApi pdLiveApi(Context context) {
if (null == pdLiveApi) { if (null == pdLiveApi) {
//实例化gson //实例化gson
pdLiveApi=createPDLiveApi(true); pdLiveApi = createPDLiveApi(true, true);
} }
return pdLiveApi; return pdLiveApi;
} }
@ -52,10 +52,23 @@ public class API extends BaseApi {
/** /**
* 创建新的PDLiveApi兼容部分接口需要控制是否添加UID参数 * 创建新的PDLiveApi兼容部分接口需要控制是否添加UID参数
* 仅有需要不添加uid的接口使用默认请用pdLiveApi() * 仅有需要不添加uid的接口使用默认请用pdLiveApi()
*
* @param isNeedUid 是否需要用户uid参数 * @param isNeedUid 是否需要用户uid参数
* @return PDLiveApi * @return PDLiveApi
*/ */
public PDLiveApi createPDLiveApi(boolean isNeedUid){ public PDLiveApi createPDLiveApi(boolean isNeedUid) {
return createPDLiveApi(isNeedUid, true);
}
/**
* 创建新的PDLiveApi兼容部分接口需要控制是否添加UID参数
* 仅有需要不添加uid或token的接口使用默认请用pdLiveApi()
*
* @param isNeedUid 是否需要用户uid参数
* @param isNeedToken 是否需要用户Token
* @return PDLiveApi
*/
public PDLiveApi createPDLiveApi(boolean isNeedUid, boolean isNeedToken) {
Gson gson = new GsonBuilder() Gson gson = new GsonBuilder()
.registerTypeAdapter(Date.class, new DateTypeAdapter()) .registerTypeAdapter(Date.class, new DateTypeAdapter())
.create(); .create();
@ -64,20 +77,20 @@ public class API extends BaseApi {
OkHttpClient.Builder builder = new OkHttpClient() OkHttpClient.Builder builder = new OkHttpClient()
.newBuilder() .newBuilder()
.addInterceptor(initQuery(isNeedUid,CommonAppContext.sInstance.getApplicationContext())) .addInterceptor(initQuery(isNeedUid, isNeedToken, CommonAppContext.sInstance.getApplicationContext()))
.addInterceptor(loggingInterceptor); .addInterceptor(loggingInterceptor);
return create(builder.build(), return create(builder.build(),
GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class); GsonConverterFactory.create(gson), RxJava2CallAdapterFactory.create(), CommonAppConfig.HOST, PDLiveApi.class);
} }
//公共参数 //公共参数
public Interceptor initQuery(boolean isNeedUid,final Context context) { public Interceptor initQuery(boolean isNeedUid, boolean isNeedToken, final Context context) {
Interceptor addQueryParameterInterceptor = new Interceptor() { Interceptor addQueryParameterInterceptor = new Interceptor() {
@Override @Override
public Response intercept(Chain chain) throws IOException { public Response intercept(Chain chain) throws IOException {
Request request = chain.request(); Request request = chain.request();
//配置公共参数 //配置公共参数
request = new ParamsContext(request, context).getInRequest(isNeedUid); request = new ParamsContext(request, context).getInRequest(isNeedUid, isNeedToken);
return chain.proceed(request); return chain.proceed(request);
} }
}; };

View File

@ -217,6 +217,8 @@ public class CommonHttpUtil {
} }
if (obj.containsKey("clarity")) { if (obj.containsKey("clarity")) {
IMLoginManager.get(context).setClarity(obj.getString("clarity")); IMLoginManager.get(context).setClarity(obj.getString("clarity"));
} if (obj.containsKey("defaultBubbleUrl")) {
IMLoginManager.get(context).setDefaultBubbleUrl(obj.getString("defaultBubbleUrl"));
} }
} catch (Exception e) { } catch (Exception e) {
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage(); String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();

View File

@ -1,5 +1,6 @@
package com.yunbao.common.http; package com.yunbao.common.http;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.BaseModel;
@ -14,11 +15,14 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LinkMicUserBeanV2; import com.yunbao.common.bean.LinkMicUserBeanV2;
import com.yunbao.common.bean.ListInfoMessageModel; import com.yunbao.common.bean.ListInfoMessageModel;
import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveAiRobotBean;
import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.bean.LiveAnchorSayModel;
import com.yunbao.common.bean.LiveDataInfoModel; import com.yunbao.common.bean.LiveDataInfoModel;
import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveRoomActivityBanner;
import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveStetUpStatusModel;
import com.yunbao.common.bean.LiveTaskModel; import com.yunbao.common.bean.LiveTaskModel;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.bean.MsgSwitchDetailModel; import com.yunbao.common.bean.MsgSwitchDetailModel;
import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.bean.NewPeopleInfo;
import com.yunbao.common.bean.NobleRankHideUserListModel; import com.yunbao.common.bean.NobleRankHideUserListModel;
@ -575,4 +579,61 @@ public interface PDLiveApi {
Observable<ResponseModel<List<ListInfoMessageModel>>> getAnchorMsg( Observable<ResponseModel<List<ListInfoMessageModel>>> getAnchorMsg(
@Query("liveuid") String liveUid, @Query("page") int page, @Query("limit") int limit @Query("liveuid") String liveUid, @Query("page") int page, @Query("limit") int limit
); );
/**
* 获取女神说数据
*/
@GET("/api/public/?service=Live.getLivePreviewInfo")
Observable<ResponseModel<LiveAnchorSayModel>> getLivePreviewInfo(
@Query("liveuid") String liveUid
);
/**
* 设置女神说
*
* @param isShow 是否显示
* @param content 内容
* @param styleImage 女神说底图地址
*
*/
@GET("/api/public/?service=Live.setLivePreview")
Observable<ResponseModel<String>> setLivePreviewInfo(
@Query("liveuid") String liveUid,
@Query("isShow") int isShow,
@Query("content") String content,
@Query("styleImage")String styleImage
);
/**
* 设置主播联系方式
*/
@GET("/api/public/?service=Live.setAnchorContact")
Observable<ResponseModel<String>> setAnchorContact(
@Query("liveuid") String liveUid,
@Query("isShow") int show,
@Query("gift_id") int giftId,
@Query("content") String content,
@Query("wechat") JSONObject wechat,
@Query("line") JSONObject line,
@Query("whatsApp") JSONObject whatsApp
);
/**
* 获取主播联系方式
*/
@GET("/api/public/?service=Live.getContactInfo")
Observable<ResponseModel<LiveAnchorCallMeModel>> getContactInfo(
@Query("liveuid") String liveUid
);
/**
* 获取收件箱信息
*/
@GET("/api/public/?service=Live.getContactMsg")
Observable<ResponseModel<List<LiveUserMailBoxModel>>> getContactMsg();
/**
* 删除联系方式信件
*/
@GET("/api/public/?service=Live.delContactMsg")
Observable<ResponseModel<String>> delContactMsg(
@Query("msgId") int msgId
);
} }

View File

@ -20,7 +20,7 @@ public class GetRequestParams implements IRequestParam {
* @return * @return
*/ */
@Override @Override
public Request getRequest(boolean isNeedUid, Request request, Context context) { public Request getRequest(boolean isNeedUid,boolean isNeedToken, Request request, Context context) {
//添加公共参数 //添加公共参数
if (IMLoginManager.isLogin(context)) { if (IMLoginManager.isLogin(context)) {
IMLoginModel model = IMLoginManager.get(context).getUserInfo(); IMLoginModel model = IMLoginManager.get(context).getUserInfo();
@ -36,7 +36,9 @@ public class GetRequestParams implements IRequestParam {
if (isNeedUid) { if (isNeedUid) {
builder.addQueryParameter("uid", String.valueOf(model.getId())); builder.addQueryParameter("uid", String.valueOf(model.getId()));
} }
builder.addQueryParameter("token", model.getToken()); if(isNeedToken) {
builder.addQueryParameter("token", model.getToken());
}
} }
return request.newBuilder().url(builder.build()).build(); return request.newBuilder().url(builder.build()).build();

View File

@ -5,5 +5,5 @@ import android.content.Context;
import okhttp3.Request; import okhttp3.Request;
public interface IRequestParam { public interface IRequestParam {
Request getRequest(boolean isNeedUid,Request request, Context context); Request getRequest(boolean isNeedUid,boolean isNeedToken, Request request, Context context);
} }

View File

@ -14,7 +14,7 @@ public class ParamsContext {
this.request = request; this.request = request;
} }
public Request getInRequest(boolean isNeedUid) { public Request getInRequest(boolean isNeedUid,boolean isNeedToken) {
switch (request.method()) { switch (request.method()) {
case "GET": case "GET":
iRequestParam = new GetRequestParams(); iRequestParam = new GetRequestParams();
@ -23,6 +23,6 @@ public class ParamsContext {
iRequestParam = new PostRequestParams(); iRequestParam = new PostRequestParams();
break; break;
} }
return iRequestParam.getRequest(isNeedUid,request, context); return iRequestParam.getRequest(isNeedUid,isNeedToken,request, context);
} }
} }

View File

@ -12,7 +12,7 @@ import okhttp3.Request;
public class PostRequestParams implements IRequestParam { public class PostRequestParams implements IRequestParam {
@Override @Override
public Request getRequest(boolean isNeedUid, Request request, Context context) { public Request getRequest(boolean isNeedUid,boolean isNeedToken, Request request, Context context) {
if (request.body() instanceof FormBody) { if (request.body() instanceof FormBody) {
FormBody.Builder bodyBuilder = new FormBody.Builder(); FormBody.Builder bodyBuilder = new FormBody.Builder();
@ -32,7 +32,9 @@ public class PostRequestParams implements IRequestParam {
if (isNeedUid) { if (isNeedUid) {
bodyBuilder.addEncoded("uid", String.valueOf(model.getId())); bodyBuilder.addEncoded("uid", String.valueOf(model.getId()));
} }
bodyBuilder.addEncoded("token", model.getToken()); if(isNeedToken) {
bodyBuilder.addEncoded("token", model.getToken());
}
formBody = bodyBuilder.build(); formBody = bodyBuilder.build();
} }
} }

View File

@ -4,6 +4,7 @@ import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
@ -16,11 +17,14 @@ import com.yunbao.common.bean.LinkMicUserBean;
import com.yunbao.common.bean.LinkMicUserBeanV2; import com.yunbao.common.bean.LinkMicUserBeanV2;
import com.yunbao.common.bean.ListInfoMessageModel; import com.yunbao.common.bean.ListInfoMessageModel;
import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveAiRobotBean;
import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.bean.LiveAnchorSayModel;
import com.yunbao.common.bean.LiveDataInfoModel; import com.yunbao.common.bean.LiveDataInfoModel;
import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveInfoModel;
import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveRoomActivityBanner;
import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveStetUpStatusModel;
import com.yunbao.common.bean.LiveTaskModel; import com.yunbao.common.bean.LiveTaskModel;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.bean.NobleRankHideUserListModel; import com.yunbao.common.bean.NobleRankHideUserListModel;
import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.PkRankBean; import com.yunbao.common.bean.PkRankBean;
@ -45,6 +49,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import retrofit2.http.Query;
/** /**
@ -1145,6 +1150,143 @@ public class LiveNetManager {
}).isDisposed(); }).isDisposed();
} }
/**
* 获取女神说数据
*/
public void getLivePreviewInfo(String liveUid, HttpCallback<LiveAnchorSayModel> callback) {
API.get().pdLiveApi(mContext)
.getLivePreviewInfo(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
callback.onSuccess(listResponseModel.getData().getInfo());
}, throwable -> {
callback.onError(throwable.getMessage());
}).isDisposed();
}
/**
* 设置女神说
*
* @param isShow 是否显示
* @param content 内容
* @param styleImage 女神说底图地址
*/
public void setLivePreviewInfo(String liveUid,
int isShow,
String content,
String styleImage, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.setLivePreviewInfo(liveUid, isShow, content, styleImage)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}).isDisposed();
}
/**
* 设置主播联系方式
*
* @param liveUid 直播间id
* @param callMe 载体
* @param callback 回调
*/
public void setAnchorCallMe(String liveUid,
LiveAnchorCallMeModel callMe,
HttpCallback<String> callback) {
API.get().createPDLiveApi(false, false)
.setAnchorContact(liveUid,
callMe.getIsShow(),
callMe.getGiftId(),
callMe.getContent(),
callMe.getWechat().toJSONObject(),
callMe.getLine().toJSONObject(),
callMe.getWhatsApp().toJSONObject())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}).isDisposed();
}
/**
* 获取收件箱信息
*
* @param callback 回调
*/
public void getContactMsg(HttpCallback<List<LiveUserMailBoxModel>> callback) {
API.get().pdLiveApi(mContext)
.getContactMsg()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}).isDisposed();
}
/**
* 获取主播联系方式
*
* @param liveUid 直播间id
* @param callback 回调
*/
public void getContactInfo(String liveUid, HttpCallback<LiveAnchorCallMeModel> callback) {
API.get().pdLiveApi(mContext)
.getContactInfo(liveUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}).isDisposed();
}
/**
* 删除联系方式信件
*
* @param msgId 信息id
* @param callback 回调
*/
public void delContactInfo(int msgId, HttpCallback<String> callback) {
API.get().pdLiveApi(mContext)
.delContactMsg(msgId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}, throwable -> {
if (callback != null) {
callback.onError(throwable.getMessage());
}
}).isDisposed();
}
/** /**
* 直播间取消网络请求 * 直播间取消网络请求
*/ */

View File

@ -42,6 +42,19 @@ public class IMLoginManager extends BaseCacheManager {
private final String SELECT_CLARITY = "selectClarity"; private final String SELECT_CLARITY = "selectClarity";
private final String CLARITY = "clarity"; private final String CLARITY = "clarity";
private final String xiaJBG = "xiaJBG"; private final String xiaJBG = "xiaJBG";
private final String keyDefaultBubbleUrl = "defaultBubbleUrl";
private final String STATUS_ANCHOR_SAY = "anchorSay";
private final String STATUS_ANCHOR_CALL = "anchorCallMe";
public void setDefaultBubbleUrl(String defaultBubbleUrl) {
put(keyDefaultBubbleUrl, defaultBubbleUrl);
}
public String getKeyDefaultBubbleUrl() {
return getString(keyDefaultBubbleUrl);
}
public void setXiaJBG(boolean xjbg) { public void setXiaJBG(boolean xjbg) {
put(xiaJBG, xjbg); put(xiaJBG, xjbg);
@ -84,6 +97,34 @@ public class IMLoginManager extends BaseCacheManager {
} }
/**
* 获取女神说设置状态
*/
public int getAnchorSayStatus() {
return getInt(STATUS_ANCHOR_SAY, 0);
}
/**
* 获取联系主播方式设置状态
*/
public int getAnchorCallStatus() {
return getInt(STATUS_ANCHOR_CALL, 0);
}
/**
* 设置女神说设置状态
*/
public void setAnchorSayStatus(int status) {
put(STATUS_ANCHOR_SAY, status);
}
/**
* 设置联系主播方式设置状态
*/
public void setAnchorCallMeStatus(int status) {
put(STATUS_ANCHOR_CALL, status);
}
public boolean isHint() { public boolean isHint() {
return 1 == getInt(IS_HINT, 0); return 1 == getInt(IS_HINT, 0);
} }

View File

@ -16,6 +16,8 @@ import java.util.List;
public class NewLevelManager extends BaseCacheManager { public class NewLevelManager extends BaseCacheManager {
private final String KEY_USER_LEVEL = "keyUserLevel"; private final String KEY_USER_LEVEL = "keyUserLevel";
private final String KEY_ANCHOR_LEVEL = "keyAnchorLevel"; private final String KEY_ANCHOR_LEVEL = "keyAnchorLevel";
private final String KEY_LIVE_LEVEL = "keyLiveLevel";
private List<NewLevelModel> newLevelModels = new ArrayList<>(); private List<NewLevelModel> newLevelModels = new ArrayList<>();
private List<NewLevelModel> keyAnchorLevel = new ArrayList<>(); private List<NewLevelModel> keyAnchorLevel = new ArrayList<>();

View File

@ -24,7 +24,9 @@ public class LiveOpenCustomPopup extends CenterPopupView {
//房间类型 //房间类型
private LiveRoomTypeBean liveRoomTypeBean; private LiveRoomTypeBean liveRoomTypeBean;
private TextView textClarity, textLiveRoomType, textLiveClass, textLiveWishlist, textRobot; private TextView textClarity, textLiveRoomType, textLiveClass, textLiveWishlist, textRobot, textSay, textCall;
private int status_say, status_call;
public LiveOpenCustomPopup setClassBean(LiveClassBean classBean) { public LiveOpenCustomPopup setClassBean(LiveClassBean classBean) {
this.classBean = classBean; this.classBean = classBean;
@ -65,6 +67,8 @@ public class LiveOpenCustomPopup extends CenterPopupView {
textLiveClass = findViewById(R.id.text_live_class); textLiveClass = findViewById(R.id.text_live_class);
textLiveWishlist = findViewById(R.id.text_live_wishlist); textLiveWishlist = findViewById(R.id.text_live_wishlist);
textRobot = findViewById(R.id.text_robot); textRobot = findViewById(R.id.text_robot);
textSay = findViewById(R.id.text_say);
textCall = findViewById(R.id.text_call);
if (classBean != null) { if (classBean != null) {
textLiveClass.setText(classBean.getName()); textLiveClass.setText(classBean.getName());
} }
@ -114,6 +118,24 @@ public class LiveOpenCustomPopup extends CenterPopupView {
} }
} }
}); });
//设置女神说
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_say), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (callBack != null) {
callBack.openAnchorSay();
}
}
});
//设置联系方式
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.line_call), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (callBack != null) {
callBack.openCallMe();
}
}
});
} }
public void setSelectClarity(int selectClarity) { public void setSelectClarity(int selectClarity) {
@ -130,7 +152,27 @@ public class LiveOpenCustomPopup extends CenterPopupView {
} }
} }
public void setSayStatus(boolean isShow) {
textSay.setText(isShow ? R.string.do_set : R.string.not_set);
}
public void setCallMeStatus(boolean isShow) {
textCall.setText(isShow ? R.string.robot_yes : R.string.robot_no);
}
public LiveOpenCustomPopup setSayStatus(int status) {
this.status_say = status;
return this;
}
public LiveOpenCustomPopup setCallMeStatus(int status) {
this.status_call = status;
return this;
}
public void initDate() { public void initDate() {
textSay.setText(status_say == 1 ? R.string.do_set : R.string.not_set);
textCall.setText(status_call == 1 ? R.string.robot_yes : R.string.robot_no);
LiveNetManager.get(getContext()) LiveNetManager.get(getContext())
.getLiveStetUpStatus(String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getId()), .getLiveStetUpStatus(String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getId()),
new HttpCallback<LiveStetUpStatusModel>() { new HttpCallback<LiveStetUpStatusModel>() {
@ -142,7 +184,7 @@ public class LiveOpenCustomPopup extends CenterPopupView {
@Override @Override
public void onError(String error) { public void onError(String error) {
ToastUtil.show( R.string.net_error); ToastUtil.show(R.string.net_error);
} }
}); });
@ -174,5 +216,11 @@ public class LiveOpenCustomPopup extends CenterPopupView {
//打開心願單 //打開心願單
void openWishlist(); void openWishlist();
//设置女神说
void openAnchorSay();
//设置联系方式
void openCallMe();
} }
} }

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="11.67dp" />
<solid android:color="#E6000000" />
</shape>
</item>
</selector>

View File

@ -335,7 +335,48 @@
android:textColor="#FF9A9A9A" android:textColor="#FF9A9A9A"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/live_tool_anchor_say"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/ic_live_fun_anchor_say" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_fun_anchor_say"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_call_me"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/ic_live_fun_anchor_letter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_fun_call_me"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</HorizontalScrollView> </HorizontalScrollView>

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="@color/white"
android:paddingTop="24dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/titleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:padding="9dp"
android:src="@mipmap/icon_back"
android:tint="@color/textColor" />
<ImageView
android:id="@+id/img_more"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="9dp"
android:src="@mipmap/btn_more_black"
android:tint="@color/textColor"
android:visibility="gone" />
<TextView
android:id="@+id/rView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:gravity="center"
android:textColor="@color/textColor"
android:textSize="13sp"
android:layout_marginRight="25dp"
android:text="充值未到账?"
android:visibility="gone"
android:textStyle="bold" />
</RelativeLayout>
</FrameLayout>

View File

@ -2,7 +2,7 @@
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="280dp" android:layout_width="280dp"
android:layout_height="340dp" android:layout_height="440dp"
android:orientation="vertical" android:orientation="vertical"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
app:cardElevation="16dp"> app:cardElevation="16dp">
@ -206,6 +206,80 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/line_say"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="29dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="29dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/live_fun_anchor_say"
android:textColor="#999999"
android:textSize="14sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/text_say"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/clarity"
android:textColor="#FFC621"
android:textSize="14sp" />
<ImageView
android:layout_width="5dp"
android:layout_height="10dp"
android:layout_marginStart="6dp"
android:src="@mipmap/icon_more_open" />
</LinearLayout>
<LinearLayout
android:id="@+id/line_call"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="29dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="29dp"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/live_fun_call_me"
android:textColor="#999999"
android:textSize="14sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/text_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/clarity"
android:textColor="#FFC621"
android:textSize="14sp" />
<ImageView
android:layout_width="5dp"
android:layout_height="10dp"
android:layout_marginStart="6dp"
android:src="@mipmap/icon_more_open" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">

View File

@ -83,7 +83,7 @@
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:drawablePadding="4dp" android:drawablePadding="4dp"
android:drawableEnd="@mipmap/icon_more" android:drawableEnd="@mipmap/icon_more_live_menu"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/click_to_view" android:text="@string/click_to_view"
android:textColor="#ff8c8c8c" android:textColor="#ff8c8c8c"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -735,7 +735,7 @@
<string name="live_close_exit">Exit</string> <string name="live_close_exit">Exit</string>
<string name="user">User</string> <string name="user">User</string>
<string name="automatic_chat">If you don\'t take the initiative,how can we have a story?\nTell the anchor say hi~</string> <string name="automatic_chat">If you don\'t take the initiative,how can we have a story?Tell the anchor say hi~</string>
<string name="add_follow">+ follow</string> <string name="add_follow">+ follow</string>
<string name="add_into_active">Enter activity</string> <string name="add_into_active">Enter activity</string>
@ -1089,4 +1089,5 @@ Limited ride And limited avatar frame</string>
<string name="live_medal_des4">Get a fan badge for giving gifts</string> <string name="live_medal_des4">Get a fan badge for giving gifts</string>
<string name="clear_unread_messages">Whether to clear unread messages</string> <string name="clear_unread_messages">Whether to clear unread messages</string>
<string name="support_login">The application collects location data to support login and registration functions.</string> <string name="support_login">The application collects location data to support login and registration functions.</string>
<string name="layout_live_anchor_say_ready_title">女神說</string>
</resources> </resources>

View File

@ -734,6 +734,8 @@
<string name="live_mic">語音連麥</string> <string name="live_mic">語音連麥</string>
<string name="live_wks">周星榜</string> <string name="live_wks">周星榜</string>
<string name="live_zslk">暫時離開</string> <string name="live_zslk">暫時離開</string>
<string name="live_fun_call_me">聯繫方式</string>
<string name="live_fun_anchor_say">女神說</string>
<string name="live_zslk1">恢復直播</string> <string name="live_zslk1">恢復直播</string>
<string name="live_set_wishlist_num">請輸入數字</string> <string name="live_set_wishlist_num">請輸入數字</string>
<string name="guard_tip_day">您是當前主播的周守護\n守護日期截止到</string> <string name="guard_tip_day">您是當前主播的周守護\n守護日期截止到</string>
@ -780,7 +782,7 @@
<string name="live_close_exit">直接退出</string> <string name="live_close_exit">直接退出</string>
<string name="user">用戶</string> <string name="user">用戶</string>
<string name="automatic_chat">你都不主動我們怎麼會有故事,\n跟主播Say Hi吧~</string> <string name="automatic_chat">你都不主動我們怎麼會有故事跟主播Say Hi吧~</string>
<string name="add_follow">+ 關注</string> <string name="add_follow">+ 關注</string>
<string name="add_into_active">進入活動</string> <string name="add_into_active">進入活動</string>
@ -1085,7 +1087,10 @@
<string name="sign_up_for">註冊PD LIVE</string> <string name="sign_up_for">註冊PD LIVE</string>
<string name="register_and_log_in">註冊並登錄</string> <string name="register_and_log_in">註冊並登錄</string>
<string name="enjoy_a_lot">開通貴族,尊享超多特權!</string> <string name="enjoy_a_lot">開通貴族,尊享超多特權!</string>
<string name="say_something3">說點什麽吧...</string>
<string name="come_hint">%s 来了</string>
<string name="layout_live_anchor_say_ready_title">女神說</string>
</resources> </resources>

View File

@ -4,7 +4,7 @@ ext {
buildToolsVersion: "29.0.2", buildToolsVersion: "29.0.2",
minSdkVersion : 21, minSdkVersion : 21,
targetSdkVersion : 31, targetSdkVersion : 31,
versionCode : 413, versionCode : 414,
versionName : "6.4.9" versionName : "6.4.9"
] ]
manifestPlaceholders = [ manifestPlaceholders = [

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -68,6 +68,7 @@ import com.yunbao.live.dialog.LiveNewGuardListDialogFragment;
import com.yunbao.live.dialog.LiveRedPackListDialogFragment; import com.yunbao.live.dialog.LiveRedPackListDialogFragment;
import com.yunbao.live.dialog.LiveRedPackSendDialogFragment; import com.yunbao.live.dialog.LiveRedPackSendDialogFragment;
import com.yunbao.live.dialog.LiveShareDialogFragment; import com.yunbao.live.dialog.LiveShareDialogFragment;
import com.yunbao.live.dialog.LiveUserAnchorMailBoxPopDialog;
import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveUserDialogFragment;
import com.yunbao.live.dialog.LiveUserMoreDialogFragment; import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
@ -108,7 +109,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
public String anyway; public String anyway;
public ViewGroup mContainer; public ViewGroup mContainer;
protected ViewGroup mPageContainer; protected ViewGroup mPageContainer;
protected LiveRoomViewHolder mLiveRoomViewHolder; public LiveRoomViewHolder mLiveRoomViewHolder;
protected AbsLiveViewHolder mLiveBottomViewHolder; protected AbsLiveViewHolder mLiveBottomViewHolder;
protected LiveAddImpressViewHolder mLiveAddImpressViewHolder; protected LiveAddImpressViewHolder mLiveAddImpressViewHolder;
protected LiveContributeViewHolder mLiveContributeViewHolder; protected LiveContributeViewHolder mLiveContributeViewHolder;
@ -895,8 +896,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
* 打开私信列表窗口 * 打开私信列表窗口
*/ */
public void openChatListWindow() { public void openChatListWindow() {
Intent intent = new Intent(mContext, PDLIiveChatActivity.class); // Intent intent = new Intent(mContext, PDLIiveChatActivity.class);
mContext.startActivity(intent); // mContext.startActivity(intent);
new LiveUserAnchorMailBoxPopDialog(mContext).showDialog();
} }
@ -1288,7 +1290,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
@Override @Override
public void onError(String error) { public void onError(String error) {
Log.e("LiveUserMoreDialog", error); Log.e("LiveUserMoreDialog", error);
ToastUtil.show( R.string.net_error); ToastUtil.show(R.string.net_error);
} }
}); });
} else { } else {

View File

@ -483,6 +483,8 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
} }
mLiveRoomViewHolder.initHourRankList(); mLiveRoomViewHolder.initHourRankList();
mLiveRoomViewHolder.startAnchorLight(); mLiveRoomViewHolder.startAnchorLight();
//初始化女神说
mLiveRoomViewHolder.initAnchorSay();
} }
if (mLiveAnchorViewHolder == null) { if (mLiveAnchorViewHolder == null) {
mLiveAnchorViewHolder = new LiveAnchorViewHolder(mContext, mContainer); mLiveAnchorViewHolder = new LiveAnchorViewHolder(mContext, mContainer);

View File

@ -1277,6 +1277,9 @@ public class LiveAudienceActivity extends LiveActivity {
manager.endDRGif(); manager.endDRGif();
} }
break; break;
case LIVE_HIDE_MSG_RED:
showMsgRed(-1);
break;
} }
@ -1412,6 +1415,21 @@ public class LiveAudienceActivity extends LiveActivity {
}); });
} }
@SuppressLint("SetTextI18n")
public void showMsgRed(int num) {
if (manager == null) {
return;
}
if (num == -1) {
manager.mLiveAudienceViewHolder.mRedPoint.setVisibility(View.GONE);
return;
} else if (num > 0) {
manager.mLiveAudienceViewHolder.mRedPoint.setText(num + "");
}
manager.mLiveAudienceViewHolder.mRedPoint.setVisibility(View.VISIBLE);
}
public void closeRoom() { public void closeRoom() {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override

View File

@ -262,6 +262,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveReadyViewHolder = new LiveNewReadyRyViewHolder(mContext, mContainer, mLiveSDK); mLiveReadyViewHolder = new LiveNewReadyRyViewHolder(mContext, mContainer, mLiveSDK);
mLiveReadyViewHolder.setManager(manager); mLiveReadyViewHolder.setManager(manager);
mLiveReadyViewHolder.addToParent(); mLiveReadyViewHolder.addToParent();
mLiveReadyViewHolder.setLiveUid(mLiveUid);
mLiveReadyViewHolder.subscribeActivityLifeCycle(); mLiveReadyViewHolder.subscribeActivityLifeCycle();
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer); mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer); mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
@ -779,7 +780,8 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRoomViewHolder.initHourRankList(); mLiveRoomViewHolder.initHourRankList();
} }
mLiveRoomViewHolder.startAnchorLight(); mLiveRoomViewHolder.startAnchorLight();
//初始化女神说
mLiveRoomViewHolder.initAnchorSay();
} }
if (mLiveAnchorViewHolder == null) { if (mLiveAnchorViewHolder == null) {
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer); mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);

View File

@ -0,0 +1,303 @@
package com.yunbao.live.adapter;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.dialog.GiftPopDialog;
import com.yunbao.live.dialog.LiveAnchorEditCallMeEditAppDialog;
import java.util.ArrayList;
import java.util.List;
public class LiveAnchorEditCallMeAdapter extends RecyclerView.Adapter<LiveAnchorEditCallMeAdapter.BaseViewHolder> {
public static final int TYPE_GIFT = 0;
public static final int TYPE_LETTER = 1;
public static final int TYPE_APP_WECHAT = 2;
public static final int TYPE_APP_LINE = 3;
public static final int TYPE_APP_WHATSAPP = 4;
private Context mContext;
private OnItemClickListener<TmpData> onItemClickListener;
private List<TmpData> list = new ArrayList<>();
public LiveAnchorEditCallMeAdapter(Context mContext) {
this.mContext = mContext;
}
public void setList(List<TmpData> list) {
this.list = list;
notifyDataSetChanged();
}
public void setOnItemClickListener(OnItemClickListener<TmpData> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
@Override
public int getItemViewType(int position) {
return list.get(position).getType();
}
@NonNull
@Override
public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
BaseViewHolder holder;
switch (viewType) {
case TYPE_GIFT:
holder = new GiftViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_anchor_call_me_gift, parent, false));
break;
case TYPE_LETTER:
holder = new LetterViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_anchor_call_me_letter, parent, false));
break;
default:
holder = new AppViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_anchor_call_me_app, parent, false));
}
return holder;
}
@Override
public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
holder.setData(list.get(position), position);
}
@Override
public int getItemCount() {
return list.size();
}
public static class TmpData {
private String value;
private int status;
private int type;
public TmpData() {
}
public TmpData(String value, int status, int type) {
this.value = value;
this.status = status;
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
public class BaseViewHolder extends RecyclerView.ViewHolder {
public BaseViewHolder(@NonNull View itemView) {
super(itemView);
}
public void setData(TmpData data, int position) {
}
}
public class GiftViewHolder extends BaseViewHolder {
private View select;
private ImageView giftIcon;
public GiftViewHolder(@NonNull View itemView) {
super(itemView);
select = itemView.findViewById(R.id.select);
giftIcon = itemView.findViewById(R.id.gift_icon);
select.setOnClickListener(v -> {
initGiftData();
});
}
@Override
public void setData(TmpData data, int position) {
super.setData(data, position);
if (!StringUtil.isEmpty(data.getValue())) {
ImgLoader.display(mContext, data.getValue(), giftIcon);
}
}
private void initGiftData() {
new GiftPopDialog(mContext, new GiftPopDialog.ActionListener() {
@Override
public void onSelectGift(PrankGiftBean bean) {
if (bean != null) {
ImgLoader.display(mContext, bean.getIcon(), giftIcon);
if (onItemClickListener != null) {
onItemClickListener.onItemClick(new TmpData(bean.getGiftId() + "", 1, TYPE_GIFT), getAbsoluteAdapterPosition());
}
}
}
@Override
public void onDismiss() {
}
})
.setShowNumber(false)
.setTitle(WordUtil.getString(R.string.live_anchor_edit_call_me_select_gift))
.showDialog()
;
}
}
public class LetterViewHolder extends BaseViewHolder {
TextView letter;
View edit;
public LetterViewHolder(@NonNull View itemView) {
super(itemView);
letter = itemView.findViewById(R.id.letterText);
edit = itemView.findViewById(R.id.edit);
edit.setOnClickListener(v -> {
new LiveAnchorEditCallMeEditAppDialog(mContext, TYPE_LETTER).setDefValue(list.get(1).getValue()).setOnValueListener(new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
if (StringUtil.isEmpty(bean)) {
letter.setText(WordUtil.getString(R.string.live_anchor_edit_call_me_not_filled));
letter.setTextColor(Color.parseColor("#80FFFFFF"));
} else {
letter.setText(bean);
letter.setTextColor(Color.WHITE);
}
if (onItemClickListener != null) {
onItemClickListener.onItemClick(new TmpData(letter.getText().toString(), 1, TYPE_LETTER), getAbsoluteAdapterPosition());
}
}
}).showDialog();
});
}
@Override
public void setData(TmpData data, int position) {
super.setData(data, position);
letter.setText(data.getValue());
}
}
public class AppViewHolder extends BaseViewHolder {
TextView contact;
View edit;
ImageView status;
ImageView icon;
public AppViewHolder(@NonNull View itemView) {
super(itemView);
contact = itemView.findViewById(R.id.contact);
edit = itemView.findViewById(R.id.app_edit);
status = itemView.findViewById(R.id.app_switch);
icon = itemView.findViewById(R.id.gift_icon);
}
@Override
public void setData(TmpData data, int position) {
super.setData(data, position);
if (StringUtil.isEmpty(data.getValue())) {
contact.setTag(null);
contact.setText(WordUtil.getString(R.string.live_anchor_edit_call_me_not_filled));
contact.setTextColor(Color.parseColor("#80FFFFFF"));
} else {
contact.setTag(data.getValue());
contact.setText(data.getValue());
contact.setTextColor(Color.WHITE);
}
if (data.getStatus() == 0) {
status.setImageResource(R.mipmap.special_icon_off);
} else if (data.getStatus() == 1) {
status.setImageResource(R.mipmap.special_icon_on);
}
status.setTag(data.getStatus());
status.setOnClickListener(v -> {
if (StringUtil.isEmpty((String) contact.getTag())) {
ToastUtil.show(WordUtil.getString(R.string.live_anchor_edit_call_me_not_filled_toash));
return;
}
int tag = (int) v.getTag();
if (tag == 0) {
status.setImageResource(R.mipmap.special_icon_on);
status.setTag(1);
} else {
status.setImageResource(R.mipmap.special_icon_off);
status.setTag(0);
}
if (onItemClickListener != null) {
onItemClickListener.onItemClick(new TmpData((String) contact.getTag(), (Integer) status.getTag(), data.getType()), position);
}
});
edit.setOnClickListener(v -> {
new LiveAnchorEditCallMeEditAppDialog(mContext, data.getType()).setDefValue((String) contact.getTag()).setOnValueListener(new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
if (StringUtil.isEmpty(bean)) {
contact.setTag(null);
contact.setText(WordUtil.getString(R.string.live_anchor_edit_call_me_not_filled));
contact.setTextColor(Color.parseColor("#80FFFFFF"));
} else {
contact.setTag(bean);
contact.setText(bean);
contact.setTextColor(Color.WHITE);
}
if (onItemClickListener != null) {
onItemClickListener.onItemClick(new TmpData((String) contact.getTag(), (Integer) status.getTag(), data.getType()), position);
}
}
}).showDialog();
});
switch (data.getType()) {
case TYPE_APP_WECHAT:
icon.setImageResource(R.mipmap.icon_wechat_x);
break;
case TYPE_APP_LINE:
icon.setImageResource(R.mipmap.icon_line_x);
break;
case TYPE_APP_WHATSAPP:
icon.setImageResource(R.mipmap.icon_whatsapp_x);
break;
}
}
}
}

View File

@ -0,0 +1,88 @@
package com.yunbao.live.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.live.R;
import java.util.ArrayList;
import java.util.List;
public class LiveAnchorSayItemsAdapter extends RecyclerView.Adapter<LiveAnchorSayItemsAdapter.ItemsViewHolder> {
private Context mContext;
private List<String> list;
private int click = -1;
private OnItemClickListener<String> onItemClickListener;
public LiveAnchorSayItemsAdapter(Context mContext) {
this.mContext = mContext;
list = new ArrayList<>();
}
public void setList(List<String> list) {
this.list = list;
notifyDataSetChanged();
}
public void setOnItemClickListener(OnItemClickListener<String> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
@NonNull
@Override
public ItemsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ItemsViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_anchor_say, parent, false));
}
@Override
public void onBindViewHolder(@NonNull ItemsViewHolder holder, int position) {
holder.setData(list.get(position), position);
}
@Override
public int getItemCount() {
return list.size();
}
public class ItemsViewHolder extends RecyclerView.ViewHolder {
private TextView textView;
private ImageView icon;
public ItemsViewHolder(@NonNull View itemView) {
super(itemView);
textView = itemView.findViewById(R.id.anchor_say_text);
icon = itemView.findViewById(R.id.anchor_say_icon);
itemView.setOnClickListener(v -> click());
textView.setOnClickListener(v -> click());
icon.setOnClickListener(v -> click());
}
private void click() {
click = getAbsoluteAdapterPosition();
if (onItemClickListener != null) {
onItemClickListener.onItemClick(list.get(click), click);
}
notifyDataSetChanged();
}
public void setData(String text, int position) {
textView.setText("已输入的\n内容已输\n入的内容\n入的内容");
ImgLoader.display(mContext, text, icon);
if (position == click) {
itemView.setBackgroundResource(R.drawable.bg_anchor_say_select);
} else {
itemView.setBackgroundResource(R.drawable.bg_anchor_say);
}
}
}
}

View File

@ -14,11 +14,13 @@ import android.text.SpannableStringBuilder;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
@ -37,6 +39,7 @@ import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.views.weight.ClipPathCircleImage;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveChatBean;
@ -176,12 +179,16 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
RoundedImageView avatar; RoundedImageView avatar;
View v_chat_active_close; View v_chat_active_close;
RecyclerView rv_chat_active; RecyclerView rv_chat_active;
ImageView img_zg_img; ImageView img_zg_img, btnAttention;
FrameLayout attentionLayout;
ClipPathCircleImage clipImage2;
public Vh(View itemView) { public Vh(View itemView) {
super(itemView); super(itemView);
mBg = (LinearLayout) itemView.findViewById(R.id.bg); mBg = (LinearLayout) itemView.findViewById(R.id.bg);
mTextView = (TextView) itemView.findViewById(R.id.text_txt); mTextView = (TextView) itemView.findViewById(R.id.text_txt);
attentionLayout = (FrameLayout) itemView.findViewById(R.id.attention_layout);
clipImage2 = (ClipPathCircleImage) itemView.findViewById(R.id.clip_image2);
itemView.setOnClickListener(mOnClickListener); itemView.setOnClickListener(mOnClickListener);
view_follow = (LinearLayout) itemView.findViewById(R.id.view_follow); view_follow = (LinearLayout) itemView.findViewById(R.id.view_follow);
@ -196,19 +203,21 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
view_zg = (LinearLayout) itemView.findViewById(R.id.view_zg); view_zg = (LinearLayout) itemView.findViewById(R.id.view_zg);
tv_zg_anchorname = (TextView) itemView.findViewById(R.id.tv_zg_anchorname); tv_zg_anchorname = (TextView) itemView.findViewById(R.id.tv_zg_anchorname);
img_zg_img = (ImageView) itemView.findViewById(R.id.img_zg_img); img_zg_img = (ImageView) itemView.findViewById(R.id.img_zg_img);
btnAttention = (ImageView) itemView.findViewById(R.id.btn_attention);
} }
void setData(final LiveChatBean bean, int position) { void setData(final LiveChatBean bean, int position) {
itemView.setTag(bean); itemView.setTag(bean);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.setMargins(0, 0, DpUtil.dp2px(95), 12); params.setMargins(0, 0, DpUtil.dp2px(110), 0);
params.gravity = Gravity.CENTER_VERTICAL;
mBg.setLayoutParams(params); mBg.setLayoutParams(params);
if (bean.getType() == 6) {//大作战活动 if (bean.getType() == 6) {//大作战活动
view_action_game.setVisibility(View.VISIBLE); view_action_game.setVisibility(View.VISIBLE);
bean.setHeart(position); bean.setHeart(position);
params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.setMargins(0, 0, 80, 12); params.setMargins(0, 0, 80, 12);
mBg.setLayoutParams(params); mBg.setLayoutParams(params);
@ -238,9 +247,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
} else if (bean.getType() == -3 || bean.getType() == -4 || bean.getType() == -5) {//整蛊 } else if (bean.getType() == -3 || bean.getType() == -4 || bean.getType() == -5) {//整蛊
if (bean.getBubble() != null && !bean.getBubble().equals("")) { if (bean.getBubble() != null && !bean.getBubble().equals("")) {
//加载.9图聊天气泡 //加载.9图聊天气泡
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
} else { } else {
mBg.setBackgroundResource(R.drawable.bg_live_chat_item); // mBg.setBackgroundResource(R.drawable.bg_live_chat_item);
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
} }
SpannableStringBuilder builder = new SpannableStringBuilder(); SpannableStringBuilder builder = new SpannableStringBuilder();
if (bean.getType() == -3) { if (bean.getType() == -3) {
@ -278,9 +288,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
} else if (bean.getType() == -6) { } else if (bean.getType() == -6) {
if (bean.getBubble() != null && !bean.getBubble().equals("")) { if (bean.getBubble() != null && !bean.getBubble().equals("")) {
//加载.9图聊天气泡 //加载.9图聊天气泡
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
} else { } else {
mBg.setBackgroundResource(R.drawable.bg_live_chat_item); // mBg.setBackgroundResource(R.drawable.bg_live_chat_item);
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
} }
String str1 = "火力四射,魅力無限!感謝"; String str1 = "火力四射,魅力無限!感謝";
String str2 = "為本直播間加成熱度"; String str2 = "為本直播間加成熱度";
@ -297,9 +308,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
} else if (bean.getType() == -7) { } else if (bean.getType() == -7) {
if (bean.getBubble() != null && !bean.getBubble().equals("")) { if (bean.getBubble() != null && !bean.getBubble().equals("")) {
//加载.9图聊天气泡 //加载.9图聊天气泡
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
} else { } else {
mBg.setBackgroundResource(R.drawable.bg_live_chat_item); // mBg.setBackgroundResource(R.drawable.bg_live_chat_item);
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
} }
String str1 = "甜蜜不停,愛意不斷!恭喜"; String str1 = "甜蜜不停,愛意不斷!恭喜";
String str2 = "在甜蜜約會中搶購到了"; String str2 = "在甜蜜約會中搶購到了";
@ -326,73 +338,88 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
} }
if (isContains) { if (isContains) {
mTextView.setTextColor(0xffffffff); mTextView.setTextColor(0xffffffff);
mBg.setBackground(null); new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
mTextView.setText(bean.getContent()); mTextView.setText(bean.getContent());
} }
} else if (bean.getType() == LiveChatBean.SYSTEM2) { } else if (bean.getType() == LiveChatBean.SYSTEM2) {
mTextView.setTextColor(0xffffffff); mTextView.setTextColor(0xffffffff);
mBg.setBackground(null); mBg.setBackground(null);
mTextView.setText(bean.getContent()); mTextView.setText(bean.getContent());
} else if (bean.getType() == -1) {//自动消息关注 }
boolean isContains = false; // else if (bean.getType() == -1) {//自动消息关注
for (LiveChatBean model : mList) { // boolean isContains = false;
if (bean.getType() == -1) { // for (LiveChatBean model : mList) {
isContains = true; // if (bean.getType() == -1) {
} // isContains = true;
} // }
if (isContains) { // }
mBg.setBackground(null); // if (isContains) {
mTextView.setVisibility(View.GONE); // mBg.setBackground(null);
view_follow.setVisibility(View.VISIBLE); // mTextView.setVisibility(View.GONE);
ImgLoader.display(mContext, bean.getId(), avatar); // view_follow.setVisibility(View.VISIBLE);
bean.setHeart(position); // ImgLoader.display(mContext, bean.getId(), avatar);
} // bean.setHeart(position);
// }
} else if (bean.getType() == -2) {//自动消息点击发言 //
// }
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item); else if (bean.getType() == -2) {//自动消息点击发言
mTextView.setText(R.string.automatic_chat); LinearLayout.LayoutParams params3 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params3.setMargins(0, 8, DpUtil.dp2px(110), 8);
params3.gravity = Gravity.CENTER_VERTICAL;
mBg.setLayoutParams(params3);
mBg.setBackground(null);
mTextView.setVisibility(View.GONE);
bean.setHeart(position); bean.setHeart(position);
ImgLoader.display(mContext, bean.getId(), clipImage2);
attentionLayout.setVisibility(View.VISIBLE);
btnAttention.setVisibility(bean.isAttention() ? View.GONE : View.VISIBLE);
// btnAttention.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// LiveRoomViewHolder.follow();
// btnAttention.setVisibility(View.GONE);
// }
// });
} else if (bean.getType() == MSG_HOUR_RANK_CHANGE) { } else if (bean.getType() == MSG_HOUR_RANK_CHANGE) {
mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item); mBg.setBackgroundResource(R.drawable.bg_chat_automatic_item);
mTextView.setText(bean.getContent()); mTextView.setText(bean.getContent());
bean.setHeart(position); bean.setHeart(position);
} else if (bean.getType() == RECOMMEND_CARD_NOTIFY) { } else if (bean.getType() == RECOMMEND_CARD_NOTIFY) {
//加载.9图聊天气泡 //加载.9图聊天气泡
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
new LiveTextRender().recommendCardNotify(mContext, mTextView, bean); new LiveTextRender().recommendCardNotify(mContext, mTextView, bean);
} else if (bean.getType() == AI_AUTOMATIC_SPEECH) { } else if (bean.getType() == AI_AUTOMATIC_SPEECH) {
//加载.9图聊天气泡 //加载.9图聊天气泡
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getAiAutomaticSpeechModel().getSystemBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getAiAutomaticSpeechModel().getSystemBubble(), 1);
new LiveTextRender().aiAutomaticSpeech(mContext, mTextView, bean.getAiAutomaticSpeechModel()); new LiveTextRender().aiAutomaticSpeech(mContext, mTextView, bean.getAiAutomaticSpeechModel());
} else if (bean.getType() == STAR_CHALLENGE_UPGRADE_NOTIFY) { } else if (bean.getType() == STAR_CHALLENGE_UPGRADE_NOTIFY) {
//加载.9图聊天气泡 //加载.9图聊天气泡
if (!TextUtils.isEmpty(bean.getMsgModel().getSystemBubble())) { if (!TextUtils.isEmpty(bean.getMsgModel().getSystemBubble())) {
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystemBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystemBubble(), 1);
new LiveTextRender().starChallengeUpgradeNotify(mContext, mTextView, bean.getMsgModel()); new LiveTextRender().starChallengeUpgradeNotify(mContext, mTextView, bean.getMsgModel());
} }
} else if (bean.getType() == LUCKY_ANGEL) { } else if (bean.getType() == LUCKY_ANGEL) {
if (!TextUtils.isEmpty(bean.getMsgModel().getSystem_bubble())) { if (!TextUtils.isEmpty(bean.getMsgModel().getSystem_bubble())) {
bean.setId(bean.getMsgModel().getUserId()); bean.setId(bean.getMsgModel().getUserId());
itemView.setTag(bean); itemView.setTag(bean);
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystem_bubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystem_bubble(), 1);
new LiveTextRender().luckyAngel(mContext, mTextView, bean.getMsgModel()); new LiveTextRender().luckyAngel(mContext, mTextView, bean.getMsgModel());
} }
}else if(bean.getType() == LUCKY_100_CHECK){ } else if (bean.getType() == LUCKY_100_CHECK) {
if (!TextUtils.isEmpty(bean.getMsgModel().getSystem_bubble())) { if (!TextUtils.isEmpty(bean.getMsgModel().getSystem_bubble())) {
bean.setId(bean.getMsgModel().getUserId()); bean.setId(bean.getMsgModel().getUserId());
itemView.setTag(bean); itemView.setTag(bean);
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystem_bubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystem_bubble(), 1);
new LiveTextRender().lucky100(mContext, mTextView, bean.getMsgModel()); new LiveTextRender().lucky100(mContext, mTextView, bean.getMsgModel());
} }
} } else {
else {
if (bean.getBubble() != null && !bean.getBubble().equals("")) { if (bean.getBubble() != null && !bean.getBubble().equals("")) {
//加载.9图聊天气泡 //加载.9图聊天气泡
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
} else { } else {
mBg.setBackgroundResource(R.drawable.bg_live_chat_item); // mBg.setBackgroundResource(R.drawable.bg_live_chat_item);
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
} }
if (bean.getType() == LiveChatBean.ENTER_ROOM || bean.getType() == LiveChatBean.LIGHT) { if (bean.getType() == LiveChatBean.ENTER_ROOM || bean.getType() == LiveChatBean.LIGHT) {
mTextView.setTextColor(0xffc8c8c8); mTextView.setTextColor(0xffc8c8c8);
@ -402,7 +429,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
new LiveTextRender().render(mContext, mTextView, bean); new LiveTextRender().render(mContext, mTextView, bean);
} }
Animation animation = AnimationUtils.loadAnimation(itemView.getContext(),R.anim.live_chat_msg_in); Animation animation = AnimationUtils.loadAnimation(itemView.getContext(), R.anim.live_chat_msg_in);
itemView.startAnimation(animation); itemView.startAnimation(animation);
} }
} }

View File

@ -89,7 +89,7 @@ public class LiveUserAdapter extends RecyclerView.Adapter<LiveUserAdapter.Vh> {
@Override @Override
public int getItemCount() { public int getItemCount() {
return Math.min(mList.size(), 5); return Math.min(mList.size(), 3);
} }
class Vh extends RecyclerView.ViewHolder { class Vh extends RecyclerView.ViewHolder {

View File

@ -0,0 +1,136 @@
package com.yunbao.live.adapter;
import android.app.Dialog;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
import java.util.ArrayList;
import java.util.List;
public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserAnchorMailBoxAdapter.MailBoxViewHolder> {
private Context mContext;
private List<LiveUserMailBoxModel> list;
OnItemClickListener<LiveUserMailBoxModel> onItemClickListener;
public LiveUserAnchorMailBoxAdapter(Context mContext) {
this.mContext = mContext;
list = new ArrayList<>();
}
public void setList(List<LiveUserMailBoxModel> list) {
this.list = list;
notifyDataSetChanged();
}
public List<LiveUserMailBoxModel> getList() {
return list;
}
public void setOnItemClickListener(OnItemClickListener<LiveUserMailBoxModel> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
@NonNull
@Override
public MailBoxViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new MailBoxViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_live_user_mailbox, parent, false));
}
@Override
public void onBindViewHolder(@NonNull MailBoxViewHolder holder, int position) {
holder.setData(list.get(position), position);
}
@Override
public int getItemCount() {
return list.size();
}
public class MailBoxViewHolder extends RecyclerView.ViewHolder {
TextView topText;
TextView userName;
TextView tipText;
View del;
public MailBoxViewHolder(@NonNull View itemView) {
super(itemView);
topText = itemView.findViewById(R.id.top_text);
userName = itemView.findViewById(R.id.user_name);
tipText = itemView.findViewById(R.id.tip);
del = itemView.findViewById(R.id.del);
}
void setData(LiveUserMailBoxModel box, int position) {
userName.setText(box.getUserName());
topText.setText(String.format(WordUtil.getString(R.string.live_user_mailbox_top_text), box.getAnchorName()));
tipText.setText(String.format(WordUtil.getString(R.string.live_user_mailbox_tip_text), box.getAnchorName()));
del.setOnClickListener(v -> {
new DialogUitl.Builder(mContext)
.setTitle(WordUtil.getString(R.string.live_user_letter_dialog_title))
.setContent(WordUtil.getString(R.string.live_user_letter_dialog_content))
.setConfrimString(WordUtil.getString(R.string.live_user_letter_dialog_yes))
.setCancelString(WordUtil.getString(R.string.live_user_letter_dialog_no))
.setView(R.layout.dialog_live_random_pk)
.setCancelable(true)
.setClickCallback((dialog, content) -> LiveNetManager.get(mContext).delContactInfo(box.getId(), new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
Log.i("刪除信件", "onSuccess:刪除成功 ");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
list.removeIf(it -> it.getId() == box.getId());
}
System.err.println("-----> list size = " + list.size());
notifyDataSetChanged();
if (onItemClickListener != null) {
onItemClickListener.onItemClick(box, position);
}
}
@Override
public void onError(String error) {
Log.i("刪除信件", "onError: " + error);
}
}))
.build().show();
});
itemView.setOnClickListener(new OnClick(box));
userName.setOnClickListener(new OnClick(box));
topText.setOnClickListener(new OnClick(box));
tipText.setOnClickListener(new OnClick(box));
}
private class OnClick implements View.OnClickListener {
LiveUserMailBoxModel box;
public OnClick(LiveUserMailBoxModel box) {
this.box = box;
}
@Override
public void onClick(View v) {
new LiveUserAnchorMailBoxWebInfoPopDialog(mContext, box.getAnchorName(), box.getUrl()).showDialog();
}
}
}
}

View File

@ -83,6 +83,17 @@ public class LiveChatBean {
//@ID //@ID
@SerializedName("atUserID") @SerializedName("atUserID")
private String atUserID = ""; private String atUserID = "";
//用户是否关注主播
private boolean isAttention = false;
public boolean isAttention() {
return isAttention;
}
public LiveChatBean setAttention(boolean attention) {
isAttention = attention;
return this;
}
public String getAtUserName() { public String getAtUserName() {
return atUserName; return atUserName;

View File

@ -17,8 +17,10 @@ import android.widget.TextView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
@ -34,15 +36,14 @@ import com.yunbao.live.http.LiveHttpUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
public class GiftPopDialog extends PopupWindow implements ActionListener, View.OnClickListener { public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListener, View.OnClickListener {
private View mParent;
private Context mContext; private Context mContext;
private View mContentView;
private LiveGiftPagerAdapter mLiveGiftPagerAdapter; private LiveGiftPagerAdapter mLiveGiftPagerAdapter;
private GiftPopDialog.ActionListener mActionListener; private GiftPopDialog.ActionListener mActionListener;
private View mLoading; private View mLoading;
@ -60,16 +61,27 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
private int prangNum; private int prangNum;
private InputMethodManager imm; private InputMethodManager imm;
private List<PrankGiftBean> giftBeans; private List<PrankGiftBean> giftBeans;
private boolean showNumber = true;
private View numberView;
private String title;
private TextView mTitle;
private void initView(View mRootView) {
mLoading = mRootView.findViewById(R.id.loading); public GiftPopDialog(@NonNull Context context) {
items = (RecyclerView) mRootView.findViewById(R.id.items); super(context);
mViewPager = (ViewPager) mRootView.findViewById(R.id.viewPager); }
mRadioGroup = (RadioGroup) mRootView.findViewById(R.id.radio_group);
mBtnSend = mRootView.findViewById(R.id.btn_send); private void initView() {
mBtnContext = mRootView.findViewById(R.id.btn_context); mLoading = findViewById(R.id.loading);
mBtn = mRootView.findViewById(R.id.gift_btn); items = (RecyclerView) findViewById(R.id.items);
mBack = mRootView.findViewById(R.id.gift_back); mViewPager = (ViewPager) findViewById(R.id.viewPager);
mRadioGroup = (RadioGroup) findViewById(R.id.radio_group);
mBtnSend = findViewById(R.id.btn_send);
mBtnContext = findViewById(R.id.btn_context);
mBtn = findViewById(R.id.gift_btn);
mBack = findViewById(R.id.gift_back);
mTitle = findViewById(R.id.title);
numberView = findViewById(R.id.btn_send_group);
final LinearLayoutManager manager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false); final LinearLayoutManager manager = new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false);
items.setLayoutManager(manager); items.setLayoutManager(manager);
mViewPager.setOffscreenPageLimit(5); mViewPager.setOffscreenPageLimit(5);
@ -112,52 +124,41 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
} }
}); });
if (!showNumber) {
numberView.setVisibility(View.GONE);
prangNum = 1;
prangContext = "null";
}
if (!StringUtil.isEmpty(title)) {
mTitle.setText(title);
}
} }
public GiftPopDialog(Context mContext, View parent, GiftPopDialog.ActionListener actionListener) { public GiftPopDialog(Context mContext, GiftPopDialog.ActionListener actionListener) {
super(mContext);
this.mContext = mContext; this.mContext = mContext;
mParent = parent;
mActionListener = actionListener; mActionListener = actionListener;
mContentView = LayoutInflater.from(mContext).inflate(R.layout.dialog_live_select_gift_wrap, null); // setAnimationStyle(R.style.leftToRightAnim);
ViewParent viewParent = mContentView.getParent();
if (viewParent != null) { }
((ViewGroup) viewParent).removeView(mContentView);
} @Override
setContentView(mContentView); protected void onCreate() {
setWidth(ViewGroup.LayoutParams.MATCH_PARENT); super.onCreate();
setHeight(ViewGroup.LayoutParams.MATCH_PARENT); initView();
setBackgroundDrawable(new ColorDrawable());
setOutsideTouchable(true);
setFocusable(true);
setAnimationStyle(R.style.leftToRightAnim);
setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss() {
if (mActionListener != null) {
if (bean == null || StringUtil.isEmpty(prangContext) || prangNum == 0) {
mActionListener.onDismiss();
return;
}
PrankGiftBean giftBean = new PrankGiftBean();
giftBean.setGiftId(bean.getId() + "");
giftBean.setNum(prangNum);
giftBean.setIcon(bean.getIcon());
giftBean.setTitle(prangContext);
giftBean.setName(bean.getName());
mActionListener.onSelectGift(giftBean);
System.out.println("gift.bean = " + bean);
}
ViewParent viewParent = mContentView.getParent();
if (viewParent != null) {
((ViewGroup) viewParent).removeView(mContentView);
}
mContentView = null;
}
});
initView(mContentView);
initDate(); initDate();
} }
public GiftPopDialog setShowNumber(boolean showNumber) {
this.showNumber = showNumber;
return this;
}
public GiftPopDialog setTitle(String title) {
this.title = title;
return this;
}
private void initDate() { private void initDate() {
LiveHttpUtil.getNewGiftList(new HttpCallback() { LiveHttpUtil.getNewGiftList(new HttpCallback() {
@Override @Override
@ -214,10 +215,6 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
} }
} }
public void show() {
showAtLocation(mParent, Gravity.CENTER, 0, 0);
}
@Override @Override
public void onItemChecked(LiveGiftBean bean) { public void onItemChecked(LiveGiftBean bean) {
@ -233,11 +230,11 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
try { try {
prangNum = Integer.parseInt(content); prangNum = Integer.parseInt(content);
if (prangNum <= 0 ) { if (prangNum <= 0) {
ToastUtil.show("數量不能為0或負數"); ToastUtil.show("數量不能為0或負數");
return; return;
} }
if(prangNum>999){ if (prangNum > 999) {
ToastUtil.show("數量不能大於999"); ToastUtil.show("數量不能大於999");
return; return;
} }
@ -298,6 +295,14 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
} }
} }
dismiss(); dismiss();
PrankGiftBean giftBean = new PrankGiftBean();
giftBean.setGiftId(bean.getId() + "");
giftBean.setNum(prangNum);
giftBean.setIcon(bean.getIcon());
giftBean.setTitle(prangContext);
giftBean.setName(bean.getName());
mActionListener.onSelectGift(giftBean);
} else if (id == R.id.gift_back) { } else if (id == R.id.gift_back) {
dismiss(); dismiss();
} }
@ -307,6 +312,16 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
this.giftBeans = giftBeans; this.giftBeans = giftBeans;
} }
@Override
public void buildDialog(XPopup.Builder builder) {
builder.enableDrag(false);
}
@Override
public int bindLayoutId() {
return R.layout.dialog_live_select_gift_wrap;
}
public interface ActionListener { public interface ActionListener {
void onSelectGift(PrankGiftBean bean); void onSelectGift(PrankGiftBean bean);

View File

@ -0,0 +1,164 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.adapter.LiveAnchorEditCallMeAdapter;
import java.util.ArrayList;
import java.util.List;
public class LiveAnchorEditCallMeDialog extends AbsDialogPopupWindow {
String mLiveUid = "";
RecyclerView list;
LiveAnchorCallMeModel callMeModel;
LiveAnchorEditCallMeAdapter adapter;
ImageView status;
OnItemClickListener<LiveAnchorCallMeModel> onItemClickListener;
public LiveAnchorEditCallMeDialog(@NonNull Context context) {
super(context);
}
@Override
public void buildDialog(XPopup.Builder builder) {
builder.enableDrag(false);
builder.autoFocusEditText(false);
}
public LiveAnchorEditCallMeDialog setOnItemClickListener(OnItemClickListener<LiveAnchorCallMeModel> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
return this;
}
@Override
public int bindLayoutId() {
return R.layout.dialog_anchor_call_me;
}
@Override
protected void onCreate() {
super.onCreate();
initView();
initData();
}
private void initData() {
LiveNetManager.get(getContext())
.getContactInfo(mLiveUid, new HttpCallback<LiveAnchorCallMeModel>() {
@Override
public void onSuccess(LiveAnchorCallMeModel data) {
setData(data);
}
@Override
public void onError(String error) {
setData(new LiveAnchorCallMeModel());
}
void setData(LiveAnchorCallMeModel data) {
callMeModel = data;
List<LiveAnchorEditCallMeAdapter.TmpData> list = new ArrayList<>();
list.add(new LiveAnchorEditCallMeAdapter.TmpData(data.getGiftImage(), 1, LiveAnchorEditCallMeAdapter.TYPE_GIFT));
list.add(new LiveAnchorEditCallMeAdapter.TmpData(data.getContent(), 1, LiveAnchorEditCallMeAdapter.TYPE_LETTER));
list.add(new LiveAnchorEditCallMeAdapter.TmpData(data.getWechat().getNumber(), data.getWechat().getIsShow(), LiveAnchorEditCallMeAdapter.TYPE_APP_WECHAT));
list.add(new LiveAnchorEditCallMeAdapter.TmpData(data.getLine().getNumber(), data.getLine().getIsShow(), LiveAnchorEditCallMeAdapter.TYPE_APP_LINE));
list.add(new LiveAnchorEditCallMeAdapter.TmpData(data.getWhatsApp().getNumber(), data.getWhatsApp().getIsShow(), LiveAnchorEditCallMeAdapter.TYPE_APP_WHATSAPP));
adapter.setList(list);
if (callMeModel.getIsShow() == 1) {
status.setImageResource(R.mipmap.special_icon_on);
status.setTag(1);
}
}
});
}
private void initView() {
list = findViewById(R.id.anchor_call_list);
status = findViewById(R.id.say_switch);
findViewById(R.id.btn_close).setOnClickListener(v -> dismiss());
adapter = new LiveAnchorEditCallMeAdapter(getContext());
adapter.setOnItemClickListener(new OnItemClickListener<LiveAnchorEditCallMeAdapter.TmpData>() {
@Override
public void onItemClick(LiveAnchorEditCallMeAdapter.TmpData bean, int position) {
if (callMeModel == null) {
callMeModel = new LiveAnchorCallMeModel();
}
if (position == 0) {
callMeModel.setGiftId(Integer.parseInt(bean.getValue()));
} else if (position == 1) {
callMeModel.setContent(bean.getValue());
} else if (bean.getType() == LiveAnchorEditCallMeAdapter.TYPE_APP_WECHAT) {
callMeModel.setWechat(new LiveAnchorCallMeModel.AppBean(bean.getValue(), bean.getStatus()));
} else if (bean.getType() == LiveAnchorEditCallMeAdapter.TYPE_APP_LINE) {
callMeModel.setLine(new LiveAnchorCallMeModel.AppBean(bean.getValue(), bean.getStatus()));
} else if (bean.getType() == LiveAnchorEditCallMeAdapter.TYPE_APP_WHATSAPP) {
callMeModel.setWhatsApp(new LiveAnchorCallMeModel.AppBean(bean.getValue(), bean.getStatus()));
}
}
});
status.setTag(0);
status.setOnClickListener(v -> {
if(callMeModel.getGiftId()==0){
ToastUtil.show(R.string.live_anchor_edit_call_me_not_gift_toash);
return;
}
int tag = (int) v.getTag();
if (tag == 0) {
status.setImageResource(R.mipmap.special_icon_on);
status.setTag(1);
} else {
status.setImageResource(R.mipmap.special_icon_off);
status.setTag(0);
}
callMeModel.setIsShow((Integer) status.getTag());
});
list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
list.setAdapter(adapter);
}
@Override
protected void onDismiss() {
super.onDismiss();
if (callMeModel == null) {
return;
}
LiveNetManager.get(getContext())
.setAnchorCallMe(mLiveUid, callMeModel, new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
ToastUtil.show(WordUtil.isZh() ? "成功" : "success");
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
IMLoginManager.get(getContext()).setAnchorCallMeStatus(callMeModel.getIsShow());
if (onItemClickListener != null) {
onItemClickListener.onItemClick(callMeModel, 0);
}
}
public LiveAnchorEditCallMeDialog setLiveUid(String liveUid) {
this.mLiveUid = liveUid;
return this;
}
}

View File

@ -0,0 +1,115 @@
package com.yunbao.live.dialog;
import static com.yunbao.live.adapter.LiveAnchorEditCallMeAdapter.TYPE_APP_LINE;
import static com.yunbao.live.adapter.LiveAnchorEditCallMeAdapter.TYPE_APP_WECHAT;
import static com.yunbao.live.adapter.LiveAnchorEditCallMeAdapter.TYPE_APP_WHATSAPP;
import static com.yunbao.live.adapter.LiveAnchorEditCallMeAdapter.TYPE_LETTER;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.live.R;
public class LiveAnchorEditCallMeEditAppDialog extends AbsDialogPopupWindow {
OnItemClickListener<String> clickListener;
private int type;
private String defValue;
private TextView titleView;
private TextView title;
private EditText edit;
public LiveAnchorEditCallMeEditAppDialog(@NonNull Context context) {
super(context);
this.type = TYPE_LETTER;
}
public LiveAnchorEditCallMeEditAppDialog(@NonNull Context context, int type) {
super(context);
this.type = type;
}
@Override
public void buildDialog(XPopup.Builder builder) {
builder.autoFocusEditText(false);
builder.moveUpToKeyboard(false);
builder.enableDrag(false);
}
@Override
public int bindLayoutId() {
return R.layout.dialog_anchor_call_edit_app;
}
public LiveAnchorEditCallMeEditAppDialog setDefValue(String defValue) {
this.defValue = defValue;
return this;
}
public LiveAnchorEditCallMeEditAppDialog setOnValueListener(OnItemClickListener<String> clickListener) {
this.clickListener = clickListener;
return this;
}
@Override
protected void onDismiss() {
super.onDismiss();
((InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
@Override
protected void onCreate() {
super.onCreate();
initView();
initData();
switch (type) {
case TYPE_LETTER:
titleView.setText("填寫信內容");
edit.setHint("我能想到最浪漫的事,就是和你一起慢慢變老,一路上收藏點點滴滴的歡笑,留到以後坐著搖椅慢慢聊。");
title.setText("信內容");
break;
case TYPE_APP_WECHAT:
titleView.setText("填寫聯系方式");
edit.setHint("请输入");
title.setText("Wechat账号");
break;
case TYPE_APP_LINE:
titleView.setText("填寫聯系方式");
edit.setHint("请输入");
title.setText("Line账号");
break;
case TYPE_APP_WHATSAPP:
titleView.setText("填寫聯系方式");
edit.setHint("请输入");
title.setText("WhatsApp账号");
break;
}
}
private void initData() {
if (!StringUtil.isEmpty(defValue)) {
edit.setText(defValue);
}
}
void initView() {
titleView = findViewById(R.id.titleView);
title = findViewById(R.id.title);
edit = findViewById(R.id.edit);
findViewById(R.id.btn_back).setOnClickListener(v -> dismiss());
findViewById(R.id.submit).setOnClickListener(v -> {
clickListener.onItemClick(edit.getText().toString(), type);
dismiss();
});
}
}

View File

@ -0,0 +1,207 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.LiveAnchorSayModel;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.adapter.LiveAnchorSayItemsAdapter;
import java.util.ArrayList;
import java.util.List;
public class LiveAnchorSayPopDialog extends AbsDialogPopupWindow {
RecyclerView list;
View anchorDemo;
LiveAnchorSayItemsAdapter adapter;
ImageView saySwitch;
ImageView close;
ImageView sayBg;
TextView sayText;
EditText sayEdit;
String mLiveUid;
String url;
LiveAnchorSayModel sayModel;
OnItemClickListener<LiveAnchorSayModel> onItemClickListener;
public LiveAnchorSayPopDialog(@NonNull Context context) {
super(context);
}
public LiveAnchorSayPopDialog setLiveUid(String mLiveUid) {
this.mLiveUid = mLiveUid;
return this;
}
public LiveAnchorSayPopDialog setOnItemClickListener(OnItemClickListener<LiveAnchorSayModel> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
return this;
}
@Override
public void buildDialog(XPopup.Builder builder) {
builder.autoFocusEditText(false);
builder.enableDrag(false);
builder.borderRadius(50);
}
@Override
protected void onDismiss() {
super.onDismiss();
setSayData(url, sayEdit.getText().toString());
}
@Override
public int bindLayoutId() {
return R.layout.dialog_anchor_say;
}
@Override
protected void onCreate() {
super.onCreate();
adapter = new LiveAnchorSayItemsAdapter(getContext());
anchorDemo = findViewById(R.id.anchor_say);
sayText = anchorDemo.findViewById(R.id.anchor_say_text);
list = findViewById(R.id.anchor_say_list);
saySwitch = findViewById(R.id.say_switch);
sayEdit = findViewById(R.id.anchor_say_edit);
close = findViewById(R.id.close);
sayBg = anchorDemo.findViewById(R.id.anchor_say_icon);
list.setLayoutManager(new GridLayoutManager(getContext(), 3));
list.setAdapter(adapter);
adapter.setOnItemClickListener(new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
anchorDemo.setVisibility(VISIBLE);
ImgLoader.display(getContext(), bean, sayBg);
url = bean;
}
});
initData();
saySwitch.setOnClickListener(v -> {
if (saySwitch.getTag() == null) {
saySwitch.setTag("");
saySwitch.setImageResource(R.mipmap.special_icon_on);
sayModel.getLivePreview().setIsShow(1);
} else {
saySwitch.setTag(null);
saySwitch.setImageResource(R.mipmap.special_icon_off);
sayModel.getLivePreview().setIsShow(0);
}
});
sayEdit.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
sayModel.getLivePreview().setContent(s.toString());
StringBuilder sb = new StringBuilder();
int len=6;
int n = (s.length() + 3) / len;
for (int i = 0; i < n; i++) {
if (i < (n - 1)) {
sb.append(s.toString().substring(i * len, (i + 1) * len)).append("\n");
} else {
sb.append(s.toString().substring(i * len));
}
}
if (sb.length() == 0) {
sb.append("默认字符\n默认字符\n默认字符");
}
sayText.setText(sb.toString());
}
@Override
public void afterTextChanged(Editable s) {
}
});
close.setOnClickListener(v -> {
dismiss();
});
}
private void setSayData(String url, String edit) {
LiveNetManager.get(getContext())
.setLivePreviewInfo(
mLiveUid,
sayModel.getLivePreview().getIsShow(),
edit,
url,
new HttpCallback<String>() {
@Override
public void onSuccess(String data) {
Log.i("女神说", "onSuccess: " + data);
ToastUtil.show(WordUtil.isZh() ? "成功" : "success");
}
@Override
public void onError(String error) {
Log.e("女神说", "onError: " + error);
}
}
);
if (onItemClickListener != null) {
onItemClickListener.onItemClick(sayModel, 0);
}
IMLoginManager.get(getContext()).setAnchorSayStatus(sayModel.getLivePreview().getIsShow());
}
private void initData() {
LiveNetManager.get(getContext())
.getLivePreviewInfo(mLiveUid, new HttpCallback<LiveAnchorSayModel>() {
@Override
public void onSuccess(LiveAnchorSayModel data) {
sayModel = data;
List<String> urls = new ArrayList<>(data.getStyle());
adapter.setList(urls);
LiveAnchorSayModel.LivePreview preview = data.getLivePreview();
if (preview != null) {
sayText.setText(preview.getContent());
sayEdit.setText(preview.getContent());
url = preview.getStyleImage();
ImgLoader.display(getContext(), preview.getStyleImage(), sayBg);
if (preview.getIsShow() == 1) {
saySwitch.setTag("");
saySwitch.setImageResource(R.mipmap.special_icon_on);
}
anchorDemo.setVisibility(VISIBLE);
}
}
@Override
public void onError(String error) {
}
});
}
}

View File

@ -4,6 +4,7 @@ import static com.yunbao.common.CommonAppConfig.isGetNewWrap;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN; import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import static com.yunbao.live.views.LiveRoomViewHolder.bean1; import static com.yunbao.live.views.LiveRoomViewHolder.bean1;
import android.content.DialogInterface;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
@ -25,7 +26,11 @@ import android.widget.RadioButton;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
@ -124,6 +129,9 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
private TextView mVipGoldDesc; private TextView mVipGoldDesc;
private TextView mGiftPackage; private TextView mGiftPackage;
private boolean isPk; private boolean isPk;
private int isContactGift = 0;
DialogInterface.OnDismissListener onDismissListener;
DialogInterface.OnShowListener onShowListener;
@Override @Override
@ -155,6 +163,22 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
mLiveGuardInfo = liveGuardInfo; mLiveGuardInfo = liveGuardInfo;
} }
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
if (onDismissListener != null) {
onDismissListener.onDismiss(dialog);
}
}
@Override
public void onStart() {
super.onStart();
if (onShowListener != null) {
onShowListener.onShow(getDialog());
}
}
public void setPkStatus(boolean pk) { public void setPkStatus(boolean pk) {
isPk = pk; isPk = pk;
} }
@ -208,7 +232,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
@Override @Override
public void onPageSelected(int position) { public void onPageSelected(int position) {
if (mRadioGroup != null && mRadioGroup.getChildAt(position)!=null) { if (mRadioGroup != null && mRadioGroup.getChildAt(position) != null) {
((RadioButton) mRadioGroup.getChildAt(position)).setChecked(true); ((RadioButton) mRadioGroup.getChildAt(position)).setChecked(true);
} }
} }
@ -278,6 +302,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
mStream = bundle.getString(Constants.LIVE_STREAM); mStream = bundle.getString(Constants.LIVE_STREAM);
mWishGiftId = bundle.getString(Constants.LIVE_WISH_GIFTID); mWishGiftId = bundle.getString(Constants.LIVE_WISH_GIFTID);
by = bundle.getString("by"); by = bundle.getString("by");
isContactGift = bundle.getBoolean("isContactGift", false) ? 1 : 0;
} }
loadGiftListData(); loadGiftListData();
loadUserVip(); loadUserVip();
@ -665,9 +690,9 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
} }
SendGiftCallback callback = new SendGiftCallback(mLiveGiftBean); SendGiftCallback callback = new SendGiftCallback(mLiveGiftBean);
if (by != null) { if (by != null) {
LiveHttpUtil.sendGift("1", mLiveUid, mStream, mLiveGiftBean.getId(), mCount, callback); LiveHttpUtil.sendGift("1", mLiveUid, mStream, mLiveGiftBean.getId(), mCount, isContactGift, callback);
} else { } else {
LiveHttpUtil.sendGift("0", mLiveUid, mStream, mLiveGiftBean.getId(), mCount, callback); LiveHttpUtil.sendGift("0", mLiveUid, mStream, mLiveGiftBean.getId(), mCount, isContactGift, callback);
} }
} }
} }
@ -722,6 +747,14 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
mLiveGiftPagerAdapter.refreshId(status.getId()); mLiveGiftPagerAdapter.refreshId(status.getId());
} }
public void setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
this.onDismissListener = onDismissListener;
}
public void setOnShowListener(DialogInterface.OnShowListener onShowListener) {
this.onShowListener = onShowListener;
}
private class SendGiftCallback extends HttpCallback { private class SendGiftCallback extends HttpCallback {
private LiveGiftBean mGiftBean; private LiveGiftBean mGiftBean;

View File

@ -25,7 +25,9 @@ import android.widget.TextView;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.LiveAnchorSayModel;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.LiveAnchorMessageCustomPopup; import com.yunbao.common.views.LiveAnchorMessageCustomPopup;
@ -116,6 +118,8 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
findViewById(R.id.anchor_task).setOnClickListener(this); findViewById(R.id.anchor_task).setOnClickListener(this);
findViewById(R.id.live_tool_robot).setOnClickListener(this); findViewById(R.id.live_tool_robot).setOnClickListener(this);
findViewById(R.id.live_tool_call_me).setOnClickListener(this);
findViewById(R.id.live_tool_anchor_say).setOnClickListener(this);
if (leave == 0) { if (leave == 0) {
((ImageView) mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave); ((ImageView) mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave);
@ -190,6 +194,11 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
taskDialog.updateLiveTimer(mAnchorLiveTime); taskDialog.updateLiveTimer(mAnchorLiveTime);
taskDialog.showDialog(); taskDialog.showDialog();
} else if (id == R.id.live_tool_call_me) {
new LiveAnchorEditCallMeDialog(mContext).setLiveUid(liveUid).showDialog();
} else if (id == R.id.live_tool_anchor_say) {
new LiveAnchorSayPopDialog(mContext).setLiveUid(liveUid).setOnItemClickListener((bean, position)
-> mLiveRoomHandler.postDelayed(()-> ((LiveRyAnchorActivity)(mContext)).mLiveRoomViewHolder.initAnchorSayData(),1000)).showDialog();
} }
} }

View File

@ -141,7 +141,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
ToastUtil.show("可添加禮物數量達到上限"); ToastUtil.show("可添加禮物數量達到上限");
return; return;
} }
GiftPopDialog dialog = new GiftPopDialog(mContext, mRootView, new GiftPopDialog.ActionListener() { GiftPopDialog dialog = new GiftPopDialog(mContext, new GiftPopDialog.ActionListener() {
@Override @Override
public void onSelectGift(PrankGiftBean bean) { public void onSelectGift(PrankGiftBean bean) {
@ -156,7 +156,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
}); });
dialog.setList(giftBeans); dialog.setList(giftBeans);
dialog.show(); dialog.showDialog();
} else { } else {
setPrankConfig(); setPrankConfig();
} }

View File

@ -0,0 +1,106 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.Bus;
import com.yunbao.live.R;
import com.yunbao.live.adapter.LiveUserAnchorMailBoxAdapter;
import com.yunbao.live.event.LiveAudienceEvent;
import java.util.ArrayList;
import java.util.List;
/**
* 用户获取主播联系方式信箱弹框
*/
public class LiveUserAnchorMailBoxPopDialog extends AbsDialogPopupWindow {
private RecyclerView list;
private LiveUserAnchorMailBoxAdapter adapter;
private View empty;
public LiveUserAnchorMailBoxPopDialog(@NonNull Context context) {
super(context);
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_live_user_mailbox;
}
@Override
protected void onCreate() {
super.onCreate();
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
list = findViewById(R.id.mailbox);
empty = findViewById(R.id.ic_empty);
list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
list.setAdapter(adapter);
adapter.setOnItemClickListener((bean, position) -> {
if (adapter.getItemCount() == 0) {
empty.setVisibility(VISIBLE);
list.setVisibility(GONE);
}
});
initData();
}
String TAG = "信箱";
void initData() {
LiveNetManager.get(getContext())
.getContactMsg(new HttpCallback<List<LiveUserMailBoxModel>>() {
@Override
public void onSuccess(List<LiveUserMailBoxModel> data) {
Log.i(TAG, "onSuccess: " + data.size());
for (LiveUserMailBoxModel datum : data) {
Log.i(TAG, "for data : " + datum);
}
setData(data);
}
@Override
public void onError(String error) {
Log.e(TAG, "onError: " + error);
setData(new ArrayList<>());
}
void setData(List<LiveUserMailBoxModel> data) {
if (data.isEmpty()) {
empty.setVisibility(VISIBLE);
list.setVisibility(GONE);
return;
}
adapter.setList(data);
}
});
}
@Override
protected void onDismiss() {
super.onDismiss();
for (LiveUserMailBoxModel model : adapter.getList()) {
if(model.getIsRead()==0){
return;
}
}
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_HIDE_MSG_RED));
}
}

View File

@ -0,0 +1,81 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.os.Build;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
public class LiveUserAnchorMailBoxWebInfoPopDialog extends AbsDialogPopupWindow {
WebView mWebView;
TextView textView;
String anchorName;
String url;
public LiveUserAnchorMailBoxWebInfoPopDialog(@NonNull Context context) {
super(context);
}
public LiveUserAnchorMailBoxWebInfoPopDialog(@NonNull Context context, String anchorName, String url) {
super(context);
this.anchorName = anchorName;
this.url = url;
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_live_user_mailbox_web;
}
@Override
protected void onCreate() {
super.onCreate();
mWebView=findViewById(R.id.webView);
textView=findViewById(R.id.title);
textView.setText(String.format(WordUtil.getString(R.string.live_user_mailbox_web_title),anchorName));
mWebView.addJavascriptInterface(JavascriptInterfaceUtils.getInstance().setmContext(CommonAppContext.getTopActivity(),mWebView),"androidObject");
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
String appCachePath = getContext().getCacheDir().getAbsolutePath();
mWebView.getSettings().setAppCachePath(appCachePath);
mWebView.getSettings().setAllowFileAccess(true);
mWebView.getSettings().setAppCacheEnabled(true);
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
L.e("H5-------->" + url);
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
// view.loadUrl("javascript:window.androidObject.setHeight(document.body.clientHeight,document.body.clientWidth)");
}
});
mWebView.loadUrl(url);
}
}

View File

@ -299,7 +299,8 @@ public class LiveAudienceEvent extends BaseModel {
UPDATA_ROBOT(53, "更新机器人消息"), UPDATA_ROBOT(53, "更新机器人消息"),
LIVE_VIDEO(54, "画质选择"), LIVE_VIDEO(54, "画质选择"),
LUCKY_100_CHECK(55, "幸运百分百"), LUCKY_100_CHECK(55, "幸运百分百"),
LIVE_END(56, "主播下播"); LIVE_END(56, "主播下播"),
LIVE_HIDE_MSG_RED(57,"隐藏红点");
private int type; private int type;
private String name; private String name;

View File

@ -606,12 +606,22 @@ public class LiveHttpUtil {
* 观众给主播送礼物 * 观众给主播送礼物
*/ */
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, HttpCallback callback) { public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, HttpCallback callback) {
sendGift(by, liveUid, stream, giftId, giftCount, 0, callback);
}
/**
* 观众给主播送礼物
* @param isContactGift 是否为联系方式礼物
*/
public static void sendGift(String by, String liveUid, String stream, int giftId, String giftCount, int isContactGift, HttpCallback callback) {
HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT) HttpClient.getInstance().get("Live.sendGift", LiveHttpConsts.SEND_GIFT)
.params("liveuid", liveUid) .params("liveuid", liveUid)
.params("stream", stream) .params("stream", stream)
.params("giftid", giftId) .params("giftid", giftId)
.params("isContactGift", isContactGift)
.params("giftcount", giftCount) .params("giftcount", giftCount)
.params("isprank", by) .params("isprank", by)
.params("appVersion", CommonAppConfig.getInstance().getVersion())
.execute(callback); .execute(callback);
} }

View File

@ -303,7 +303,7 @@ public class LiveEnterRoomAnimPresenter {
enter_room_gif_small.setVisibility(View.GONE); enter_room_gif_small.setVisibility(View.GONE);
tv_enterroom_user.setText(playText); tv_enterroom_user.setText(playText);
tv_enterroom_user.setTextColor(Color.parseColor(colocNow)); tv_enterroom_user.setTextColor(Color.parseColor(colocNow));
LoadDian9TuUtil.loadDian9Tu(mContext, tv_enterroom_user, urlNow, 0); new LoadDian9TuUtil().loadDian9Tu(mContext, tv_enterroom_user, urlNow, 0);
playStart(rt_enterroom_svga); playStart(rt_enterroom_svga);
if (enter_room_svg_small != null) { if (enter_room_svg_small != null) {
@ -339,7 +339,7 @@ public class LiveEnterRoomAnimPresenter {
SVGARect rect = svgaVideoEntity.getVideoSize(); SVGARect rect = svgaVideoEntity.getVideoSize();
mSVGImageView.setVideoItem(svgaVideoEntity); mSVGImageView.setVideoItem(svgaVideoEntity);
mSVGImageView.setLoops(1); mSVGImageView.setLoops(1);
SVGAViewUtils.playEndClear(mSVGImageView,true,new SVGACallback() { SVGAViewUtils.playEndClear(mSVGImageView, true, new SVGACallback() {
@Override @Override
public void onPause() { public void onPause() {
@ -509,7 +509,7 @@ public class LiveEnterRoomAnimPresenter {
enter_room_gif_small.setVisibility(View.VISIBLE); enter_room_gif_small.setVisibility(View.VISIBLE);
tv_enterroom_user.setText(playText); tv_enterroom_user.setText(playText);
tv_enterroom_user.setTextColor(Color.parseColor(colocNow)); tv_enterroom_user.setTextColor(Color.parseColor(colocNow));
LoadDian9TuUtil.loadDian9Tu(mContext, tv_enterroom_user, urlNow, 0); new LoadDian9TuUtil().loadDian9Tu(mContext, tv_enterroom_user, urlNow, 0);
playStart(rt_enterroom_svga); playStart(rt_enterroom_svga);
mGifDrawable.setLoopCount(3); mGifDrawable.setLoopCount(3);
view = enter_room_gif_small; view = enter_room_gif_small;

View File

@ -158,10 +158,11 @@ public class LiveTextRender {
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF86C")), giftIndexOf, giftIndexOf + giftSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFF86C")), giftIndexOf, giftIndexOf + giftSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
mTextView.setText(builder); mTextView.setText(builder);
} }
/** /**
* 幸运100%活动 * 幸运100%活动
*/ */
public void lucky100(Context mContext, TextView mTextView, MsgModel msgModel){ public void lucky100(Context mContext, TextView mTextView, MsgModel msgModel) {
String msg = mContext.getString(R.string.lucky_100); String msg = mContext.getString(R.string.lucky_100);
msg = String.format(msg, msgModel.getUserName(), msgModel.getGiftName()); msg = String.format(msg, msgModel.getUserName(), msgModel.getGiftName());
int unameIndexOf = msg.indexOf(msgModel.getUserName()); int unameIndexOf = msg.indexOf(msgModel.getUserName());
@ -199,7 +200,7 @@ public class LiveTextRender {
int index = mContext.indexOf(userName); int index = mContext.indexOf(userName);
int end = index + userName.length(); int end = index + userName.length();
int endIndex = startIndex + userName.length(); int endIndex = startIndex + userName.length();
spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#fffe9b")), spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#FBEABF")),
startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
mContext = mContext.substring(end + 1, mContext.length()); mContext = mContext.substring(end + 1, mContext.length());
startIndex = startIndex + end + 1; startIndex = startIndex + end + 1;
@ -215,7 +216,7 @@ public class LiveTextRender {
int end = index + name.length(); int end = index + name.length();
startIndex = index + startIndex; startIndex = index + startIndex;
int endIndex = startIndex + name.length(); int endIndex = startIndex + name.length();
spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#fffe9b")), spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#FBEABF")),
startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
mContext = mContext.substring(end, mContext.length()); mContext = mContext.substring(end, mContext.length());
startIndex = endIndex; startIndex = endIndex;
@ -248,7 +249,7 @@ public class LiveTextRender {
if (levelDrawable != null) { if (levelDrawable != null) {
builder.append(" "); builder.append(" ");
levelDrawable.setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(14)); levelDrawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(17));
builder.setSpan(new VerticalImageSpan(levelDrawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(levelDrawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index = builder.length(); index = builder.length();
} }
@ -416,7 +417,6 @@ public class LiveTextRender {
}); });
} }
private ImgLoader.DrawableCallback mCallback;
/** /**
* 等级设置 * 等级设置
@ -424,10 +424,9 @@ public class LiveTextRender {
* @return * @return
*/ */
public void getLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) { public void getLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) {
mCallback = callback; if (mContext instanceof Activity) {
if(mContext instanceof Activity){ if (((Activity) mContext).isDestroyed()) {
if(((Activity)mContext).isDestroyed()){ mContext = CommonAppContext.getTopActivity();
mContext=CommonAppContext.getTopActivity();
} }
} }
List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels(); List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
@ -484,18 +483,76 @@ public class LiveTextRender {
}); });
} }
public void getLiveLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) {
if (mContext instanceof Activity) {
if (((Activity) mContext).isDestroyed()) {
mContext = CommonAppContext.getTopActivity();
}
}
List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
String imgUrl = "https://downs.yaoulive.com/level1/img_1-9.png";
for (NewLevelModel newLevelModel : models) {
if (newLevelModel.getLeveMin() <= userLevel && userLevel <= newLevelModel.getLeveMax()) {
imgUrl = newLevelModel.getLiveIcon();
}
}
Glide.with(mContext).asBitmap().load(imgUrl).into(new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
Observable.create(new ObservableOnSubscribe<Bitmap>() {
@Override
public void subscribe(ObservableEmitter<Bitmap> emitter) throws Exception {
emitter.onNext(AddTimeLiveWatermark(resource, String.valueOf(userLevel)));//
}
}).subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Bitmap>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Bitmap bitmap) {
BitmapDrawable drawable = new BitmapDrawable(bitmap);
if (callback != null) {
callback.onLoadSuccess(drawable);
}
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
});
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
if (callback != null) {
callback.onLoadFailed();
}
}
});
}
private void renderTMP(Context context, final TextView textView, final LiveChatBean bean) { private void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
if (textView != null) { if (textView != null) {
getLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() { getLiveLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() {
@Override @Override
public void onLoadSuccess(Drawable drawable) { public void onLoadSuccess(Drawable drawable) {
SpannableStringBuilder builder = createPrefix(drawable, bean); SpannableStringBuilder builder = createPrefix(drawable, bean);
int color = Color.parseColor("#68F1F4"); int color = Color.parseColor("#68F1F4");
if (bean.isAnchor()) { if (bean.isAnchor()) {
color = 0xffffdd00; color =Color.parseColor("#FBEABF");
} else { } else {
color = Color.parseColor("#68F1F4"); color = Color.parseColor("#68F1F4");
} }
@ -535,6 +592,43 @@ public class LiveTextRender {
} }
/**
* bitmap添加文字
*
* @param mBitmap
* @return
*/
private Bitmap AddTimeLiveWatermark(Bitmap mBitmap, String level) {
//获取原始图片与水印图片的宽与高
int mBitmapWidth = mBitmap.getWidth();
int mBitmapHeight = mBitmap.getHeight();
Bitmap mNewBitmap = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.ARGB_8888);
Canvas mCanvas = new Canvas(mNewBitmap);
//向位图中开始画入MBitmap原始图片
mCanvas.drawBitmap(mBitmap, 0, 0, null);
//添加文字
Paint mPaint = new Paint();
Typeface font = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD);
mPaint.setColor(Color.WHITE);
if (level.length() == 3) {
mPaint.setTextSize(27);
mPaint.setTypeface(font);
mCanvas.drawText(level, 3, 38, mPaint);
} else if (level.length() == 2) {
mPaint.setTextSize(30 );
mPaint.setTypeface(font);
mCanvas.drawText(level, 10, 38, mPaint);
}else if (level.length() == 1) {
mPaint.setTextSize(37 );
mPaint.setTypeface(font);
mCanvas.drawText(level, 16, 38, mPaint);
}
mCanvas.save();
mCanvas.restore();
return mNewBitmap;
}
/** /**
* bitmap添加文字 * bitmap添加文字
* *

View File

@ -2,30 +2,36 @@ package com.yunbao.live.utils;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.NinePatch; import android.graphics.NinePatch;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable; import android.graphics.drawable.NinePatchDrawable;
import android.os.Build; import android.os.Build;
import android.text.TextUtils;
import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import android.view.View;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition; import com.bumptech.glide.request.transition.Transition;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class LoadDian9TuUtil { public class LoadDian9TuUtil {
private static final List<Bitmap> BITMAP_CACHE=new ArrayList<>();//.9图Bitmap缓存 private static final List<Bitmap> BITMAP_CACHE = new ArrayList<>();//.9图Bitmap缓存
public static void loadDian9Tu(Context context, View imageView, String imgUrl, int position) { public void loadDian9Tu(Context context, View imageView, String imgUrl, int position) {
if (context == null) { if (context == null) {
return; return;
} }
@ -43,8 +49,8 @@ public class LoadDian9TuUtil {
@Override @Override
public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) { public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) {
try { try {
FileInputStream is=new FileInputStream(resource); FileInputStream is = new FileInputStream(resource);
Bitmap bitmap=BitmapFactory.decodeStream(is); Bitmap bitmap = BitmapFactory.decodeStream(is);
BITMAP_CACHE.add(bitmap); BITMAP_CACHE.add(bitmap);
setNinePathImage(context, imageView, bitmap, position); setNinePathImage(context, imageView, bitmap, position);
is.close(); is.close();
@ -60,7 +66,44 @@ public class LoadDian9TuUtil {
}); });
} }
public static void setNinePathImage(Context context, View imageView, Bitmap bitmap, int position) { public void loadDian9TuAssets(Context context, View imageView, int position) {
if (TextUtils.isEmpty(IMLoginManager.get(context).getKeyDefaultBubbleUrl())) {
Bitmap bitmap = getImageFromAssetsFile(context, "chat_message_bg.png");
BITMAP_CACHE.add(bitmap);
setNinePathImage(context, imageView, bitmap, position);
} else {
String url = IMLoginManager.get(context).getKeyDefaultBubbleUrl();
loadDian9Tu(context, imageView,url, 1);
}
}
public void loadDian9TuAssets2(Context context, View imageView, String fileName, int position) {
Bitmap bitmap = getImageFromAssetsFile(context, fileName);
BITMAP_CACHE.add(bitmap);
setNinePathImage(context, imageView, bitmap, position);
}
/**
* 从Assets中读取图片
*
* @param fileName
* @return
*/
private Bitmap getImageFromAssetsFile(Context context, String fileName) {
Bitmap image = null;
AssetManager am = context.getResources().getAssets();
try {
InputStream is = am.open(fileName);
image = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return image;
}
public void setNinePathImage(Context context, View imageView, Bitmap bitmap, int position) {
if (bitmap == null) if (bitmap == null)
return; return;
byte[] chunk = bitmap.getNinePatchChunk(); byte[] chunk = bitmap.getNinePatchChunk();
@ -71,11 +114,11 @@ public class LoadDian9TuUtil {
} }
/** /**
* @see LiveActivity#onDestroy() 结束时释放掉.9图缓存 * @see LiveActivity# 结束时释放掉.9图缓存
*/ */
public static void clearBitmap(){ public static void clearBitmap() {
for (Bitmap bitmap : BITMAP_CACHE) { for (Bitmap bitmap : BITMAP_CACHE) {
if(bitmap!=null) { if (bitmap != null) {
bitmap.recycle(); bitmap.recycle();
} }
} }

View File

@ -17,7 +17,7 @@ import org.greenrobot.eventbus.EventBus;
public abstract class AbsLiveViewHolder extends AbsViewHolder implements View.OnClickListener { public abstract class AbsLiveViewHolder extends AbsViewHolder implements View.OnClickListener {
private TextView mRedPoint; public TextView mRedPoint;
public AbsLiveViewHolder(Context context, ViewGroup parentView) { public AbsLiveViewHolder(Context context, ViewGroup parentView) {
super(context, parentView); super(context, parentView);

View File

@ -12,7 +12,11 @@ public class Banner4CustomViewHolder implements BannerViewHolder<BannerBean> {
@Override @Override
public View createView(Context context, int position, BannerBean data) { public View createView(Context context, int position, BannerBean data) {
ImageView icon=new ImageView(context); ImageView icon=new ImageView(context);
ImgLoader.display(context,data.getImageUrl(),icon); if(data.getIconRes()!=0){
ImgLoader.display(context,data.getIconRes(),icon);
}else {
ImgLoader.display(context, data.getImageUrl(), icon);
}
return icon; return icon;
} }
} }

View File

@ -289,7 +289,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
} }
}); });
//底部礼物弹窗 // //底部礼物弹窗
ImgLoader.displayGif(mContext, R.mipmap.live_lw, giftImage); ImgLoader.displayGif(mContext, R.mipmap.live_lw, giftImage);
ViewClicksAntiShake.clicksAntiShake(giftImage, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(giftImage, new ViewClicksAntiShake.ViewClicksCallBack() {
@ -302,10 +302,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
Locale locale = mContext.getResources().getConfiguration().locale; Locale locale = mContext.getResources().getConfiguration().locale;
String language = locale.getLanguage(); String language = locale.getLanguage();
ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_new_people_cn : R.mipmap.live_icon_newpeople_en, liveNewPeople); // ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_new_people_cn : R.mipmap.live_icon_newpeople_en, liveNewPeople);
ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_role : R.mipmap.live_icon_role_en, mRole); // ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_role : R.mipmap.live_icon_role_en, mRole);
ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_play : R.mipmap.live_icon_play_en, mPlay); // ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_play : R.mipmap.live_icon_play_en, mPlay);
ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_cheat : R.mipmap.live_icon_cheat_en, mCheat); // ImgLoader.display(mContext, TextUtils.equals(language, "zh") ? R.mipmap.live_icon_cheat : R.mipmap.live_icon_cheat_en, mCheat);
voiceButton.setOnTouchListener((v, event) -> { voiceButton.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) { if (event.getAction() == MotionEvent.ACTION_DOWN) {
@ -448,15 +448,11 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
if (!liveUid.equals(mLiveUid)) { if (!liveUid.equals(mLiveUid)) {
return; return;
} }
if (isattention == 0) { LiveChatBean lvBean = new LiveChatBean();
LiveChatBean lvBean = new LiveChatBean(); lvBean.setType(-2);
lvBean.setType(-1); lvBean.setId(url);
lvBean.setId(url); lvBean.setAttention(isattention != 0);
LiveRoomViewHolder.insertChat(lvBean, 1); LiveRoomViewHolder.insertChat(lvBean, 1);
}
LiveChatBean lvBean2 = new LiveChatBean();
lvBean2.setType(-2);
LiveRoomViewHolder.insertChat(lvBean2, 1);
Log.i("chatMgs", liveUid + "|" + mLiveUid); Log.i("chatMgs", liveUid + "|" + mLiveUid);
} }
}, 10000);//3秒后执行Runnable中的run方法 }, 10000);//3秒后执行Runnable中的run方法

View File

@ -27,6 +27,8 @@ import com.lxj.xpopup.interfaces.XPopupCallback;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.bean.LiveAnchorSayModel;
import com.yunbao.common.bean.LiveClassBean; import com.yunbao.common.bean.LiveClassBean;
import com.yunbao.common.bean.LiveRoomTypeBean; import com.yunbao.common.bean.LiveRoomTypeBean;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
@ -35,6 +37,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.ImageResultCallback; import com.yunbao.common.interfaces.ImageResultCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
@ -53,6 +56,8 @@ import com.yunbao.faceunity.FaceManager;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.dialog.LiveAnchorEditCallMeDialog;
import com.yunbao.live.dialog.LiveAnchorSayPopDialog;
import com.yunbao.live.dialog.LiveFaceUnityDialogFragment; import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
import com.yunbao.live.dialog.LiveNewRoomClassDialogFragment; import com.yunbao.live.dialog.LiveNewRoomClassDialogFragment;
import com.yunbao.live.dialog.LiveNewRoomTypeDialogFragment; import com.yunbao.live.dialog.LiveNewRoomTypeDialogFragment;
@ -96,6 +101,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
private int selectClarity = 1; private int selectClarity = 1;
private LiveOpenCustomPopup liveOpenCustomPopup; private LiveOpenCustomPopup liveOpenCustomPopup;
private boolean selector = true; private boolean selector = true;
private String mLiveUid;
public LiveNewReadyRyViewHolder(Context context, ViewGroup parentView, int liveSdk) { public LiveNewReadyRyViewHolder(Context context, ViewGroup parentView, int liveSdk) {
super(context, parentView, liveSdk); super(context, parentView, liveSdk);
@ -195,6 +201,8 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
findViewById(R.id.btn_wishlist).setOnClickListener(this); findViewById(R.id.btn_wishlist).setOnClickListener(this);
findViewById(R.id.btn_horizontally).setOnClickListener(this); findViewById(R.id.btn_horizontally).setOnClickListener(this);
findViewById(R.id.anchor_agreement_layout).setOnClickListener(this); findViewById(R.id.anchor_agreement_layout).setOnClickListener(this);
findViewById(R.id.btn_live_anchor_say).setOnClickListener(this);
findViewById(R.id.btn_live_anchor_call_me).setOnClickListener(this);
if (manager != null) { if (manager != null) {
manager.setFaceStatusChanged(new FaceManager.FaceStatusChanged() { manager.setFaceStatusChanged(new FaceManager.FaceStatusChanged() {
@ -389,6 +397,8 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
} }
// startLive(); // startLive();
liveOpenCustomPopup = new LiveOpenCustomPopup(mContext, IMLoginManager.get(mContext).getSelectClarity(), classBean, liveRoomTypeBean) liveOpenCustomPopup = new LiveOpenCustomPopup(mContext, IMLoginManager.get(mContext).getSelectClarity(), classBean, liveRoomTypeBean)
.setSayStatus(IMLoginManager.get(mContext).getAnchorSayStatus())
.setCallMeStatus(IMLoginManager.get(mContext).getAnchorCallStatus())
.setCallBack(new LiveOpenCustomPopup.LiveOpenCallBack() { .setCallBack(new LiveOpenCustomPopup.LiveOpenCallBack() {
@Override @Override
@ -537,6 +547,16 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
//点击心愿单 //点击心愿单
openWishListWindow(); openWishListWindow();
} }
@Override
public void openAnchorSay() {
openAnchorSayDialog();
}
@Override
public void openCallMe() {
openAnchorCallMeDialog();
}
}); });
new XPopup.Builder(mContext) new XPopup.Builder(mContext)
.asCustom(liveOpenCustomPopup) .asCustom(liveOpenCustomPopup)
@ -565,6 +585,10 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
.append("&token=") .append("&token=")
.append(model.getToken()); .append(model.getToken());
RouteUtil.forwardLiveZhuangBanActivity(url.toString(), false); RouteUtil.forwardLiveZhuangBanActivity(url.toString(), false);
} else if (i == R.id.btn_live_anchor_say) {
openAnchorSayDialog();
} else if (i == R.id.btn_live_anchor_call_me) {
openAnchorCallMeDialog();
} }
} }
@ -596,6 +620,28 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
} }
} }
public void openAnchorSayDialog() {
new LiveAnchorSayPopDialog(mContext).setLiveUid(mLiveUid).setOnItemClickListener(new OnItemClickListener<LiveAnchorSayModel>() {
@Override
public void onItemClick(LiveAnchorSayModel bean, int position) {
if (liveOpenCustomPopup != null) {
liveOpenCustomPopup.setSayStatus(bean.getLivePreview().getIsShow() == 1);
}
}
}).showDialog();
}
public void openAnchorCallMeDialog() {
new LiveAnchorEditCallMeDialog(mContext).setLiveUid(mLiveUid).setOnItemClickListener(new OnItemClickListener<LiveAnchorCallMeModel>() {
@Override
public void onItemClick(LiveAnchorCallMeModel bean, int position) {
if (liveOpenCustomPopup != null) {
liveOpenCustomPopup.setCallMeStatus(bean.getIsShow() == 1);
}
}
}).showDialog();
}
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void updateStart(LiveAudienceEvent event) { public void updateStart(LiveAudienceEvent event) {
if (event.getType() == WISH_LIST_UPDATE) { if (event.getType() == WISH_LIST_UPDATE) {
@ -893,4 +939,8 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
public void onDestroy() { public void onDestroy() {
LiveHttpUtil.cancel(LiveHttpConsts.CREATE_ROOM); LiveHttpUtil.cancel(LiveHttpConsts.CREATE_ROOM);
} }
public void setLiveUid(String mLiveUid) {
this.mLiveUid = mLiveUid;
}
} }

View File

@ -7,6 +7,7 @@ import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.graphics.Outline; import android.graphics.Outline;
import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import android.os.Handler; import android.os.Handler;
@ -23,7 +24,9 @@ import android.view.ViewOutlineProvider;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.animation.AlphaAnimation; import android.view.animation.AlphaAnimation;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.view.animation.TranslateAnimation;
import android.widget.Button; import android.widget.Button;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
@ -68,10 +71,13 @@ import com.yunbao.common.bean.HourRank;
import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LevelBean; import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LinkMicUserBean;
import com.yunbao.common.bean.LiveAnchorCallMeModel;
import com.yunbao.common.bean.LiveAnchorSayModel;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveRoomActivityBanner;
import com.yunbao.common.bean.LiveUserGiftBean; import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.LiveUserMailBoxModel;
import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.NewPeopleTaskModel; import com.yunbao.common.bean.NewPeopleTaskModel;
import com.yunbao.common.bean.PkRankBean; import com.yunbao.common.bean.PkRankBean;
@ -106,6 +112,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.utils.formatBigNum;
import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.AbsViewHolder;
import com.yunbao.common.views.weight.ClipPathCircleImage;
import com.yunbao.common.views.weight.FullServiceNotificationView; import com.yunbao.common.views.weight.FullServiceNotificationView;
import com.yunbao.common.views.weight.NobleNoticeView; import com.yunbao.common.views.weight.NobleNoticeView;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -136,6 +143,7 @@ import com.yunbao.live.custom.TopGradual;
import com.yunbao.live.dialog.LiveFaceUnityDialogFragment; import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
import com.yunbao.live.dialog.LiveFansMedalDialogFragment; import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
import com.yunbao.live.dialog.LiveGameDialogFragment; import com.yunbao.live.dialog.LiveGameDialogFragment;
import com.yunbao.live.dialog.LiveGiftDialogFragment;
import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveUserDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
@ -148,6 +156,8 @@ import com.yunbao.live.presenter.LiveEnterRoomAnimPresenter;
import com.yunbao.live.presenter.LiveGiftAnimPresenter; import com.yunbao.live.presenter.LiveGiftAnimPresenter;
import com.yunbao.live.presenter.LiveLightAnimPresenter; import com.yunbao.live.presenter.LiveLightAnimPresenter;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.live.utils.LoadDian9TuUtil;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
@ -219,7 +229,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public TextView room_hot; public TextView room_hot;
public String touid, gotoroom; public String touid, gotoroom;
public static TextView fans; public static TextView fans;
public LinearLayout fans_btn, wishListLayout; public LinearLayout fans_btn, wishListLayout, wishListLayout2, liveWksLayout;
public static View d_pk_view; public static View d_pk_view;
public static int isAttention = 0;//是否关注 0=没关注, public static int isAttention = 0;//是否关注 0=没关注,
public static String mNameText; public static String mNameText;
@ -295,12 +305,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private List<BannerBean> mBannerList2 = new ArrayList<>(); private List<BannerBean> mBannerList2 = new ArrayList<>();
private List<BannerBean> mBannerList3 = new ArrayList<>(); private List<BannerBean> mBannerList3 = new ArrayList<>();
private List<BannerBean> mBannerList4 = new ArrayList<>(); private List<BannerBean> mBannerList4 = new ArrayList<>();
private LinearLayout btn_event2, btn_event3, btn_event4; private List<BannerBean> mTopBannerList = new ArrayList<>();
private LinearLayout btn_event2, btn_event3, btn_event4, enterRoomLeave2;
private ImageView imgEvent; private ImageView imgEvent;
private View btnEvent; private View btnEvent;
private LinearLayout lt_trickery; private LinearLayout lt_trickery;
private TextView tv_trickery_time; private TextView tv_trickery_time;
private FrameLayout enterRoomLeave, enterRoomBg;
private RecyclerView fastMsgRecyclerView; private RecyclerView fastMsgRecyclerView;
private LiveRoomFastMessageRecyclerViewAdapter fastMessageRecyclerViewAdapter; private LiveRoomFastMessageRecyclerViewAdapter fastMessageRecyclerViewAdapter;
@ -309,7 +320,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private List<WishlistItemModel> wishlist = new ArrayList<>(); private List<WishlistItemModel> wishlist = new ArrayList<>();
private TextView mHourRank, mHotText; private TextView mHourRank, mHotText;
private LinearLayout msg; //默认悬浮窗布局 private LinearLayout msg; //默认悬浮窗布局
private LinearLayout mAnchorLayout; private LinearLayout mAnchorLayout, hourRankLayout, liveRankPk2;
private ImageView mGoodNumberIcon; private ImageView mGoodNumberIcon;
private View msg2; //悬浮窗来私信的布局 private View msg2; //悬浮窗来私信的布局
private ConstraintLayout msgLayout; //悬浮窗 private ConstraintLayout msgLayout; //悬浮窗
@ -318,7 +329,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private FullServiceNotificationView fullScreen;//全副喇叭 private FullServiceNotificationView fullScreen;//全副喇叭
private NobleNoticeView noble;//全副喇叭 private NobleNoticeView noble;//全副喇叭
private FaceManager manager; private FaceManager manager;
private LinearLayout pkRankLayout; private FrameLayout pkRankLayout;
private ViewFlipper pkRankVf; private ViewFlipper pkRankVf;
private ImageView mPkRankIcon; private ImageView mPkRankIcon;
private TextView mPkRankText; private TextView mPkRankText;
@ -334,6 +345,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//全服通知 //全服通知
private ImageView customFullServiceNotify; private ImageView customFullServiceNotify;
//----主播说组件---//
private View mAnchorSay;
private ImageView mAnchorSayImage;
private TextView mAnchorSayText;
private ImageView mAnchorSayHide;
//----!主播说组件---//
private Banner topBanner1;//心愿单&联系方式
public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) { public LiveRoomViewHolder(boolean isRys, int forActivity, Context context, ViewGroup parentView, GifImageView gifImageView, SVGAImageView svgaImageView, ViewGroup liveGiftPrizePoolContainer, WindowManager windowManager) {
super(context, parentView); super(context, parentView);
@ -676,6 +694,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override @Override
public void init() { public void init() {
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
mAnchorSay = findViewById(R.id.anchor_say_layout);
mAnchorSayImage = (ImageView) findViewById(R.id.anchor_say_icon);
mAnchorSayText = (TextView) findViewById(R.id.anchor_say_text);
mAnchorSayHide = (ImageView) findViewById(R.id.anchor_say_hide);
mAnchorSayHide.setOnClickListener(v -> hideAnchorSay());
btnEvent = findViewById(R.id.btn_event); btnEvent = findViewById(R.id.btn_event);
fullScreen = (FullServiceNotificationView) findViewById(R.id.full_screen); fullScreen = (FullServiceNotificationView) findViewById(R.id.full_screen);
noble = (NobleNoticeView) findViewById(R.id.noble); noble = (NobleNoticeView) findViewById(R.id.noble);
@ -683,6 +708,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
imgEvent = (ImageView) findViewById(R.id.img_event); imgEvent = (ImageView) findViewById(R.id.img_event);
btn_event2 = (LinearLayout) findViewById(R.id.btn_event2); btn_event2 = (LinearLayout) findViewById(R.id.btn_event2);
btn_event4 = (LinearLayout) findViewById(R.id.btn_event4); btn_event4 = (LinearLayout) findViewById(R.id.btn_event4);
enterRoomLeave = (FrameLayout) findViewById(R.id.enter_room_leave);
enterRoomBg = (FrameLayout) findViewById(R.id.enter_room_bg);
enterRoomLeave2 = (LinearLayout) findViewById(R.id.enter_room_leave2);
mBanner1 = (Banner) findViewById(R.id.banner1); mBanner1 = (Banner) findViewById(R.id.banner1);
time = (TextView) findViewById(R.id.time); time = (TextView) findViewById(R.id.time);
mBanner2 = (Banner) findViewById(R.id.banner2); mBanner2 = (Banner) findViewById(R.id.banner2);
@ -815,13 +843,18 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
fans = (TextView) findViewById(R.id.fans); fans = (TextView) findViewById(R.id.fans);
fans_btn = (LinearLayout) findViewById(R.id.fans_btn); fans_btn = (LinearLayout) findViewById(R.id.fans_btn);
wishListLayout = (LinearLayout) findViewById(R.id.wish_list_layout); wishListLayout = (LinearLayout) findViewById(R.id.wish_list_layout);
wishListLayout2 = (LinearLayout) findViewById(R.id.wish_list_layout2);
liveWksLayout = (LinearLayout) findViewById(R.id.live_wks_layout2);
mAnchorLayout = (LinearLayout) findViewById(R.id.group_1); mAnchorLayout = (LinearLayout) findViewById(R.id.group_1);
hourRankLayout = (LinearLayout) findViewById(R.id.hour_rank_layout2);
liveRankPk2 = (LinearLayout) findViewById(R.id.live_rank_pk2);
mGoodNumberIcon = (ImageView) findViewById(R.id.good_nub_ico); mGoodNumberIcon = (ImageView) findViewById(R.id.good_nub_ico);
pkRankLayout = (LinearLayout) findViewById(R.id.live_rank_pk); pkRankLayout = (FrameLayout) findViewById(R.id.live_rank_pk);
pkRankVf = (ViewFlipper) findViewById(R.id.rank_pk_vf); pkRankVf = (ViewFlipper) findViewById(R.id.rank_pk_vf);
mPkRankTopIcon = (ImageView) findViewById(R.id.icon_pk_top); mPkRankTopIcon = (ImageView) findViewById(R.id.icon_pk_top);
mRedVal = (TextView) findViewById(R.id.pk_rank_red_val); mRedVal = (TextView) findViewById(R.id.pk_rank_red_val);
mBlueVal = (TextView) findViewById(R.id.pk_rank_blue_val); mBlueVal = (TextView) findViewById(R.id.pk_rank_blue_val);
topBanner1 = (Banner) findViewById(R.id.top_banner1);
if (LivePushTxViewHolder.mTRTCCloud != null || LivePushRyViewHolder.rtcRoom != null) { if (LivePushTxViewHolder.mTRTCCloud != null || LivePushRyViewHolder.rtcRoom != null) {
fans_btn.setVisibility(View.GONE); fans_btn.setVisibility(View.GONE);
@ -940,6 +973,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
LiveRoomViewHolder.follow(); LiveRoomViewHolder.follow();
mLiveChatAdapter.removetItem(bean); mLiveChatAdapter.removetItem(bean);
} else if (bean.getType() == -2) { } else if (bean.getType() == -2) {
if (!bean.isAttention()) {
LiveRoomViewHolder.follow();
}
mLiveChatAdapter.removetItem(bean); mLiveChatAdapter.removetItem(bean);
((LiveActivity) mContext).sendChatMessage("Hi~", null, null); ((LiveActivity) mContext).sendChatMessage("Hi~", null, null);
} else if (bean.getType() == -5) { } else if (bean.getType() == -5) {
@ -1126,6 +1162,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10); outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
} }
}); });
topBanner1.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 = (RecyclerView) findViewById(R.id.room_fast_msg);
fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
@ -1167,7 +1209,53 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
customFullServiceNotify = (ImageView) findViewById(R.id.custom_full_service_notify); customFullServiceNotify = (ImageView) findViewById(R.id.custom_full_service_notify);
reloadIM(); reloadIM();
initStarChallengeStatus(); // initStarChallengeStatus();
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1);
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1);
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1);
}
/**
* 隐藏女神说
*/
private void hideAnchorSay() {
boolean hide = mAnchorSay.getTag() == null || (boolean) mAnchorSay.getTag();
Animation animation;
if (hide) {
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_say_text_out);
} else {
animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_say_text_in);
}
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
if (!hide) {
mAnchorSay.setX((float) mAnchorSayImage.getTag());
mAnchorSayImage.setVisibility(View.VISIBLE);
mAnchorSayText.setVisibility(View.VISIBLE);
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show);
}
}
@Override
public void onAnimationEnd(Animation animation) {
if (hide) {
mAnchorSayImage.setTag(mAnchorSay.getX());
mAnchorSay.setX(-DpUtil.dp2px(45));
mAnchorSayImage.setVisibility(View.INVISIBLE);
mAnchorSayText.setVisibility(View.INVISIBLE);
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide);
}
mAnchorSay.setTag(!hide);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
mAnchorSay.startAnimation(animation);
} }
/** /**
@ -1228,7 +1316,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mBannerList3.clear(); mBannerList3.clear();
mBannerList4.clear(); mBannerList4.clear();
updataCleanMic(); updataCleanMic();
initStarChallengeStatus(); // initStarChallengeStatus();
enterRoomLeave.setVisibility(View.GONE);
} }
public void clearChat() { public void clearChat() {
@ -1630,9 +1719,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
if (flipper.getChildCount() > 0) { if (flipper.getChildCount() > 0) {
flipper.removeAllViews(); flipper.removeAllViews();
} }
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16)); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(13), DpUtil.dp2px(13));
params.leftMargin = DpUtil.dp2px(6);
params.rightMargin = DpUtil.dp2px(2);
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5); textParams.leftMargin = DpUtil.dp2px(2);
View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
ImageView hotPic = hotView.findViewById(R.id.wish_pic); ImageView hotPic = hotView.findViewById(R.id.wish_pic);
@ -1645,8 +1736,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mHotText.setGravity(Gravity.CENTER); mHotText.setGravity(Gravity.CENTER);
mHourRank.setGravity(Gravity.CENTER); mHourRank.setGravity(Gravity.CENTER);
setHourRankData(Long.parseLong(model.getRank())); setHourRankData(Long.parseLong(model.getRank()));
hotPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hot : R.drawable.live_tags_hot_en); hotPic.setImageResource(R.drawable.icon_time_new);
hourPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hour_list : R.drawable.live_tags_hour_list_en); hourPic.setImageResource(R.drawable.icon_heat_new);
hotPic.setLayoutParams(params); hotPic.setLayoutParams(params);
hourPic.setLayoutParams(params); hourPic.setLayoutParams(params);
flipper.addView(hotView); flipper.addView(hotView);
@ -1669,6 +1760,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
liveHDDialogFragment.setArguments(bundle); liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}); });
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, hourRankLayout, "rectangle_new.png", 1);
} }
/** /**
@ -1700,7 +1792,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mHourRank.setGravity(Gravity.CENTER); mHourRank.setGravity(Gravity.CENTER);
setHourRankData(info.get(0).getRank()); setHourRankData(info.get(0).getRank());
hotPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hot : R.drawable.live_tags_hot_en); hotPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hot : R.drawable.live_tags_hot_en);
hourPic.setImageResource(WordUtil.isZh() ? R.drawable.live_tags_hour_list : R.drawable.live_tags_hour_list_en); hourPic.setImageResource(R.drawable.icon_heat_new);
hotPic.setLayoutParams(params); hotPic.setLayoutParams(params);
hourPic.setLayoutParams(params); hourPic.setLayoutParams(params);
flipper.addView(hotView); flipper.addView(hotView);
@ -3420,7 +3512,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 展示新人任务 Banner * 展示新人任务 Banner
*/ */
private void showBanner3(LiveGiftBean bean1) { private void showBanner3(LiveGiftBean bean1) {
btn_event3.setVisibility(View.VISIBLE); btn_event3.setVisibility(View.GONE);
if (mBannerList3 == null || mBannerList3.size() == 0 || mBanner3 == null || bean1 == null) { if (mBannerList3 == null || mBannerList3.size() == 0 || mBanner3 == null || bean1 == null) {
return; return;
} }
@ -3449,6 +3541,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
.start(); .start();
} }
/**
* 新版UI隐藏活动轮播入口
*/
private void showBanner4() { private void showBanner4() {
btn_event4.setVisibility(View.VISIBLE); btn_event4.setVisibility(View.VISIBLE);
if (mBannerList4 == null || mBannerList4.size() == 0 || mBanner4 == null) { if (mBannerList4 == null || mBannerList4.size() == 0 || mBanner4 == null) {
@ -4188,4 +4283,264 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
} }
/**
* 横竖屏聊天框的高度
*
* @param landscape
*/
public void changeMessageLandscape(int landscape) {
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
mChatRecyclerView.getLayoutParams();
RelativeLayout.LayoutParams enterRoomParams = (RelativeLayout.LayoutParams) enterRoomLeave.getLayoutParams();
if (landscape == 2) {
params1.height = DpUtil.dp2px(200);
enterRoomParams.bottomMargin = -DpUtil.dp2px(65);
} else {
params1.height = DpUtil.dp2px(310);
enterRoomParams.bottomMargin = -DpUtil.dp2px(70);
}
mChatRecyclerView.setLayoutParams(params1);
enterRoomLeave.setLayoutParams(enterRoomParams);
}
public void showHighGrade(LiveUserGiftBean model) {
ImageView imageView = (ImageView) findViewById(R.id.image_view);
ClipPathCircleImage imageAvatar = (ClipPathCircleImage) findViewById(R.id.image_avatar);
TextView userName = (TextView) findViewById(R.id.user_name);
userName.setText(String.format(mContext.getString(R.string.come_hint), model.getUserNiceName()));
ImgLoader.display(mContext, model.getAvatar(), imageAvatar);
int level = model.getLevel();
if (level < 50) {
enterRoomLeave.setBackgroundResource(R.drawable.background_30);
enterRoomLeave2.setBackgroundResource(R.drawable.bg_30_leave);
} else if (level > 49 && level < 60) {
enterRoomLeave.setBackgroundResource(R.drawable.background_50);
enterRoomLeave2.setBackgroundResource(R.drawable.bg_50_leave);
} else if (level > 59 && level < 80) {
enterRoomLeave.setBackgroundResource(R.drawable.background_60);
enterRoomLeave2.setBackgroundResource(R.drawable.bg_60_leave);
} else if (level > 79 && level < 90) {
enterRoomLeave.setBackgroundResource(R.drawable.background_80);
enterRoomLeave2.setBackgroundResource(R.drawable.bg_80_leave);
} else if (level > 99) {
enterRoomLeave.setBackgroundResource(R.drawable.background_100);
enterRoomLeave2.setBackgroundResource(R.drawable.bg_100_leave);
}
new LiveTextRender().getLiveLevelImage(mContext, model.getLevel(), new ImgLoader.DrawableCallback() {
@Override
public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, imageView);
}
@Override
public void onLoadFailed() {
}
});
enterRoomLeave.post(() -> {
enterRoomLeave.setVisibility(View.VISIBLE);
TranslateAnimation animationTranslate = new TranslateAnimation(enterRoomLeave.getMeasuredWidth(), 0, 0, 0);
AnimationSet animationSet1 = new AnimationSet(true);
animationSet1.addAnimation(animationTranslate);
animationSet1.setFillAfter(true);
animationSet1.setDuration(500);
animationSet1.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
enterRoomLeave.startAnimation(animationSet1);
});
}
/**
* 隐藏高等级入场提示
*/
public void hideHighGrade() {
if (enterRoomLeave.getVisibility() == View.GONE) return;
TranslateAnimation animationTranslate = new TranslateAnimation(0, -(enterRoomLeave.getMeasuredWidth() + DpUtil.dp2px(6)), 0, 0);
AnimationSet animationSet1 = new AnimationSet(true);
animationSet1.addAnimation(animationTranslate);
animationSet1.setFillAfter(true);
animationSet1.setDuration(100);
animationSet1.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
enterRoomLeave.setVisibility(View.GONE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
enterRoomLeave.startAnimation(animationSet1);
}
LiveAnchorSayModel sayModel;
public void initAnchorSayData() {
LiveNetManager.get(mContext)
.getLivePreviewInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<LiveAnchorSayModel>() {
@Override
public void onSuccess(LiveAnchorSayModel data) {
Log.i("女神说", "onSuccess: " + data);
sayModel = data;
LiveAnchorSayModel.LivePreview preview = data.getLivePreview();
if (preview != null) {
mAnchorSayText.setText(getText(data.getLivePreview().getContent()));
ImgLoader.display(mContext, preview.getStyleImage(), mAnchorSayImage);
if (preview.getIsShow() == 1) {
mAnchorSay.setVisibility(View.VISIBLE);
}
}
}
@Override
public void onError(String error) {
}
public String getText(String content) {
int t = 6;
float len = (float) content.length() / t;
StringBuilder sb = new StringBuilder();
sb.append("\n");
for (int i = 0; i < len; i++) {
if (len - i < 1) {
sb.append(content.substring(i * t));
} else {
sb.append(content.substring(i * t, i * t + t)).append("\n");
}
}
return sb.toString();
}
});
}
public void initAnchorSay() {
if (mAnchorSay.getTag() != null) {
mAnchorSay.setX((float) mAnchorSayImage.getTag());
mAnchorSayImage.setTag(null);
mAnchorSayImage.setVisibility(View.VISIBLE);
mAnchorSayText.setVisibility(View.VISIBLE);
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show);
}
mAnchorSay.setTag(null);
initAnchorSayData();
}
public void hideAnchorSayAndCallAnchor(){
mAnchorSay.setX((float) mAnchorSayImage.getTag());
mAnchorSayImage.setTag(null);
mAnchorSayImage.setVisibility(View.VISIBLE);
mAnchorSayText.setVisibility(View.VISIBLE);
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show);
topBanner1.setVisibility(View.GONE);
}
public void showAnchorSayAndCallAnchor(){
mAnchorSayImage.setTag(mAnchorSay.getX());
mAnchorSay.setX(-DpUtil.dp2px(45));
mAnchorSayImage.setVisibility(View.INVISIBLE);
mAnchorSayText.setVisibility(View.INVISIBLE);
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide);
topBanner1.setVisibility(View.VISIBLE);
}
public void initTopBanner() {
checkNewLetter();
mTopBannerList = new ArrayList<>();
topBanner1.setVisibility(View.GONE);
topBanner1.setAutoPlay(true)
.setPages(mTopBannerList, new TopBannerCustomViewHolder())
.setDelayTime(3000)
.setBannerStyle(BannerConfig.NOT_INDICATOR)
.setOnBannerClickListener(new OnBannerClickListener() {
@Override
public void onBannerClick(List datas, int position) {
if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) {
Dialog loading = DialogUitl.loadingDialog(mContext);
loading.show();
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, mTopBannerList.get(position).getActivityId() + "");
bundle.putBoolean("isContactGift", true);
fragment.setArguments(bundle);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
}
}
})
.start();
LiveNetManager.get(mContext)
.getContactInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<LiveAnchorCallMeModel>() {
@Override
public void onSuccess(LiveAnchorCallMeModel data) {
System.out.println(">>>>> 获取联系方式:" + data);
if (data.getIsShow() == 1) {
topBanner1.setVisibility(View.VISIBLE);
BannerBean call = new BannerBean();
call.setActivityId(data.getGiftId());
call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR);
mTopBannerList.add(0, call);
topBanner1.update(mTopBannerList);
}
}
@Override
public void onError(String error) {
System.out.println("!>>>>> 获取联系方式:" + error);
}
});
}
private void checkNewLetter() {
LiveNetManager.get(mContext).getContactMsg(new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
@Override
public void onSuccess(List<LiveUserMailBoxModel> data) {
for (LiveUserMailBoxModel model : data) {
if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).showMsgRed(0);
return;
}
}
}
@Override
public void onError(String error) {
}
});
}
} }

View File

@ -203,6 +203,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
ininView(); ininView();
} }
/** /**
* 初始化布局 * 初始化布局
*/ */
@ -249,6 +250,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void run() { public void run() {
loading.setVisibility(View.GONE); loading.setVisibility(View.GONE);
enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
} }
}; };
@ -303,6 +305,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveLinkMicPresenter.setLiveSdk(mLiveSDK); mLiveLinkMicPresenter.setLiveSdk(mLiveSDK);
mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK); mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK);
} }
if (mLiveRyLinkMicPkPresenter == null) { if (mLiveRyLinkMicPkPresenter == null) {
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
} }
@ -323,6 +326,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLivePlayViewHolder.removeDetailView(); mLivePlayViewHolder.removeDetailView();
mLivePlayViewHolder.setCover(mLiveBean.getAvatar()); mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape()); mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape());
//mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF); //mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF);
mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() { mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() {
@Override @Override
@ -333,7 +337,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
}); });
mLiveRoomViewHolder.resetView(); mLiveRoomViewHolder.resetView();
enterRoomModel.clear();
enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable);
mLiveRoomViewHolder.setAvatar(data.getAvatar()); mLiveRoomViewHolder.setAvatar(data.getAvatar());
mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor()); mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
mLiveRoomViewHolder.setName(data.getUserNiceName()); mLiveRoomViewHolder.setName(data.getUserNiceName());
@ -408,13 +413,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setAnchorGoodNumber(data.getLiveInfo().getGoodnum()); mLiveRoomViewHolder.setAnchorGoodNumber(data.getLiveInfo().getGoodnum());
List<BannerBean> bannerBeans = new ArrayList<>(); List<BannerBean> bannerBeans = new ArrayList<>();
//心愿单 //心愿单
if (data.getWishList().getWishList().size() > 0) { // if (data.getWishList().getWishList().size() > 0) {
BannerBean bannerModel = new BannerBean(); // BannerBean bannerModel = new BannerBean();
bannerModel.setShow_type("2"); // bannerModel.setShow_type("2");
bannerModel.setLink(CommonAppConfig.HOST + "/index.php"); // bannerModel.setLink(CommonAppConfig.HOST + "/index.php");
bannerModel.setImageUrl(data.getWishList().getImg()); // bannerModel.setImageUrl(data.getWishList().getImg());
bannerBeans.add(bannerModel); // bannerBeans.add(bannerModel);
} // }
//活动列表 //活动列表
if (data.getLiveRoomActivityModels().size() > 0) { if (data.getLiveRoomActivityModels().size() > 0) {
@ -466,10 +471,15 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
//数据设置 //数据设置
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), Integer.parseInt(data.getEnterRoomInfo().getUserlistTime()) * 4000); mLiveRoomViewHolder.setLiveInfo(mLiveBean.getUid(), mLiveBean.getStream(), Integer.parseInt(data.getEnterRoomInfo().getUserlistTime()) * 4000);
mLiveRoomViewHolder.setFastMessage(greetings); // mLiveRoomViewHolder.setFastMessage(greetings);
mLiveRoomViewHolder.setVotes(data.getEnterRoomInfo().getVotestotal()); mLiveRoomViewHolder.setVotes(data.getEnterRoomInfo().getVotestotal());
//真爱排行 数量 //真爱排行 数量
mLiveRoomViewHolder.setMedaRankNum(data.getEnterRoomInfo().getMedalRankNum()); mLiveRoomViewHolder.setMedaRankNum(data.getEnterRoomInfo().getMedalRankNum());
//初始化女神说
mLiveRoomViewHolder.initAnchorSay();
//初始化顶部banner
mLiveRoomViewHolder.initTopBanner();
isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention()); isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention());
if (isattention == 0) { if (isattention == 0) {
if (countDownTimer != null) { if (countDownTimer != null) {
@ -1003,15 +1013,54 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
} }
//高等级用户进入房间排序列表
private List<LiveUserGiftBean> enterRoomModel = new ArrayList<>();
private Handler enterRoomLeaveHandler = new Handler();
private Runnable enterRoomLeaveRunnable = new Runnable() {
@Override
public void run() {
if (enterRoomModel.size() > 0) {
if (mLiveRoomViewHolder != null) {
LiveUserGiftBean model = enterRoomModel.get(0);
mLiveRoomViewHolder.showHighGrade(model);
enterRoomModel.remove(0);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mLiveRoomViewHolder.hideHighGrade();
enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
}
}, 3000);
}
} else {
enterRoomLeaveHandler.postDelayed(enterRoomLeaveRunnable, 200);
}
}
};
@Override @Override
public void onEnterRoom(LiveEnterRoomBean bean) { public void onEnterRoom(LiveEnterRoomBean bean) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
if (!bean.getUserBean().getCar().getWords().equals("")) { if (!bean.getUserBean().getCar().getWords().equals("")) {
bean.getLiveChatBean().setContent(bean.getUserBean().getCar().getWords()); bean.getLiveChatBean().setContent(bean.getUserBean().getCar().getWords());
} }
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
mLiveRoomViewHolder.onEnterRoom(bean); mLiveRoomViewHolder.onEnterRoom(bean);
LiveChatBean liveChatBean = bean.getLiveChatBean();
LiveUserGiftBean liveUserGiftBean = bean.getUserBean();
int level = liveUserGiftBean.getLevel();
if (level >= 10) {
//高等级飘屏
liveUserGiftBean.setUserNiceName(liveChatBean.getUserNiceName());
enterRoomModel.add(liveUserGiftBean);
} else {
mLiveRoomViewHolder.insertChat(liveChatBean, 1);
}
} }
//
} }
@Override @Override
@ -1323,6 +1372,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void setPkStatus(boolean isPk) { public void setPkStatus(boolean isPk) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.hotAddVisibility(isPk); mLiveRoomViewHolder.hotAddVisibility(isPk);
if (isPk) {
mLiveRoomViewHolder.hideAnchorSayAndCallAnchor();
} else {
mLiveRoomViewHolder.showAnchorSayAndCallAnchor();
}
} }
} }

View File

@ -0,0 +1,56 @@
package com.yunbao.live.views;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import com.ms.banner.holder.BannerViewHolder;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.bean.BannerBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.SVGAViewUtils;
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;
@Override
public View createView(Context context, int position, BannerBean data) {
View view = null;
if (data.getType() == TYPE_IMAGE) {
ImageView icon = new ImageView(context);
if (data.getIconRes() != 0) {
ImgLoader.display(context, data.getIconRes(), icon);
} else {
ImgLoader.display(context, data.getImageUrl(), icon);
}
view = icon;
} else {
view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_call_me, null);
SVGAImageView svga = view.findViewById(R.id.svga);
new SVGAParser(context).decodeFromAssets("ic_live_anchor_call_me.svga", new SVGAParser.ParseCompletion() {
@Override
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga.setImageDrawable(drawable);
svga.setTag("svga");
SVGAViewUtils.playEndClear(svga, false);
svga.setClearsAfterStop(false);
}
@Override
public void onError() {
Log.e("errqs", "errl");
}
}, null);
}
return view;
}
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromXDelta="-100%"
android:toXDelta="0" />
<alpha
android:duration="300"
android:fromAlpha="0"
android:toAlpha="1" />
</set>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromXDelta="0"
android:toXDelta="-100%" />
<alpha
android:duration="300"
android:fromAlpha="1"
android:toAlpha="0.2" />
</set>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="12dp" />
<solid android:color="#36FF7C33" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="12dp" />
<solid android:color="#107733FF" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="12dp" />
<solid android:color="#13A533FF" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="12dp" />
<solid android:color="#16FFA133" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="12dp" />
<solid android:color="#15F98C4F" />
</shape>
</item>
</selector>

View File

@ -3,7 +3,7 @@
<item> <item>
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="50dp" /> <corners android:radius="50dp" />
<solid android:color="#ff5075" /> <solid android:color="#FF5533" />
</shape> </shape>
</item> </item>
</selector </selector

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="52dp" />
<solid android:color="#30000000" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"/>
<gradient
android:startColor="#27FF3F33"
android:endColor="#45FB8560"
android:angle="0"/>
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"/>
<gradient
android:startColor="#1033DDFF"
android:endColor="#00548CFF"
android:angle="0"/>
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"/>
<gradient
android:startColor="#10D117FF"
android:endColor="#297654FF"
android:angle="0"/>
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"/>
<gradient
android:startColor="#16FFAD33"
android:endColor="#16FF8754"
android:angle="0"/>
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="12dp"/>
<gradient
android:startColor="#36EA882E"
android:endColor="#26FF7D54"
android:angle="0"/>
</shape>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="166dp" android:height="162dp">
<shape android:shape="rectangle">
<solid android:color="#337792D0" />
<corners android:radius="8dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="166dp" android:height="162dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffc621" />
<solid android:color="#337792D0" />
<corners android:radius="8dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="60dp" android:height="22dp">
<shape android:shape="rectangle">
<solid android:color="#ffffffff" />
<corners android:topLeftRadius="11dp" android:topRightRadius="11dp" android:bottomLeftRadius="11dp" android:bottomRightRadius="11dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="96dp" android:height="22dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffffff" />
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffe5eeff" android:endColor="#ffe5fbff" android:angle="270" />
<corners android:topLeftRadius="22dp" android:topRightRadius="22dp" android:bottomLeftRadius="22dp" android:bottomRightRadius="22dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="112dp" android:height="42dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffffff" />
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffe5eeff" android:endColor="#ffe5fbff" android:angle="135" />
<corners android:topLeftRadius="22dp" android:topRightRadius="22dp" android:bottomLeftRadius="22dp" android:bottomRightRadius="22dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:bottomLeftRadius="15dp"
android:topLeftRadius="15dp" />
<stroke
android:width="1dp"
android:color="#ED6B41" />
</shape>

View File

@ -2,9 +2,8 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"> <item android:state_checked="true">
<shape> <shape>
<stroke android:color="@color/yellow5" android:width="0.5dp"/> <stroke android:color="#FFBE41" android:width="0.5dp"/>
<solid android:color="#4d000000"/> <solid android:color="#4d000000"/>
<corners android:radius="10dp"/>
</shape> </shape>
</item> </item>
<item android:state_checked="false"> <item android:state_checked="false">

View File

@ -3,5 +3,5 @@
<stroke <stroke
android:width="0.3dp" android:width="0.3dp"
android:color="#1F245C" /> android:color="#10ffffff" />
</shape> </shape>

View File

@ -3,7 +3,7 @@
<item android:state_enabled="true"> <item android:state_enabled="true">
<shape> <shape>
<corners android:bottomRightRadius="15dp" android:topRightRadius="15dp"/> <corners android:bottomRightRadius="15dp" android:topRightRadius="15dp"/>
<solid android:color="@color/yellow5"/> <solid android:color="#ED6B41"/>
</shape> </shape>
</item> </item>
<item android:state_enabled="false"> <item android:state_enabled="false">

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="189dp" android:height="42dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffc621" android:endColor="#ffffae05" android:angle="135" />
<corners android:radius="21dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="52dp" android:height="52dp">
<shape android:shape="rectangle">
<solid android:color="#4d000000" />
<corners android:topLeftRadius="6dp" android:topRightRadius="6dp" android:bottomLeftRadius="6dp" android:bottomRightRadius="6dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="48dp" android:height="18dp">
<shape android:shape="rectangle">
<stroke android:width="0dp" android:color="#4dffffff" />
<solid android:color="#000000" />
<gradient android:angle="180" android:centerColor="#0548cfff" android:endColor="#4d7733ff" android:startColor="#4d33ddff" android:type="linear" android:useLevel="true" />
<corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" />
<stroke
android:width="1dp"
android:color="#4dFFFFFF" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<solid android:color="#40000000" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,78 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent">
<include
android:id="@+id/include"
layout="@layout/live_anchor_call_me_edit_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:background="#FAFAFA"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:text="信內容"
android:textColor="#333333"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/edit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="#FAFAFA"
android:ellipsize="none"
android:gravity="top"
android:ems="10"
android:hint="我能想到最浪漫的事,就是和你一起慢慢變老,一路上收藏點點滴滴的歡笑,留到以後坐著搖椅慢慢聊。"
android:textColor="#999999"
android:textColorHint="#999999"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/submit"
android:layout_width="0dp"
android:layout_height="42dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_live_ready_btn2"
android:text="保存"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout3" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,105 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@drawable/background_e6000"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="@string/live_anchor_edit_call_me_title"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<ImageView
android:id="@+id/btn_close"
android:layout_width="19dp"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/live_close" />
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="#1affffff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/anchor_call_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider"
tools:listitem="@layout/item_anchor_call_me_app"
/>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/black2"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:gravity="center|start"
android:text="@string/live_anchor_edit_call_me_switch"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<ImageView
android:id="@+id/say_switch"
android:layout_width="40dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/special_icon_off" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,149 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="@+id/anchor_say"
layout="@layout/sim_live_room_anchor_say"
android:layout_width="77dp"
android:layout_height="88dp"
android:layout_marginStart="16dp"
android:visibility="invisible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout2"
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_marginTop="20dp"
android:background="@drawable/background_e6000"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/anchor_say">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:text="@string/live_anchor_say_title"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<ImageView
android:id="@+id/close"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/live_close" />
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="#1affffff"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
<EditText
android:id="@+id/anchor_say_edit"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:autofillHints=""
android:background="@drawable/bg_item_random_pk_type_1"
android:ems="10"
android:hint="@string/live_anchor_say_edit_hint"
android:inputType="textPersonName"
android:maxLength="16"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColorHint="#80FFFFFF"
android:textColor="#FFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider" />
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="@string/live_anchor_say_select_style"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/anchor_say_edit" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/anchor_say_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text2"
tools:layoutManager="GridLayoutManager"
tools:listitem="@layout/item_anchor_say"
tools:spanCount="3" />
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/black2"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/constraintLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_weight="1"
android:gravity="center|start"
android:text="@string/live_anchor_say_switch"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<ImageView
android:id="@+id/say_switch"
android:layout_width="40dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
app:srcCompat="@mipmap/special_icon_off" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -20,9 +20,10 @@
android:background="@drawable/bg_live_gift_download_all" android:background="@drawable/bg_live_gift_download_all"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="invisible"> android:visibility="gone">
<ImageView <ImageView
android:visibility="gone"
android:layout_width="19dp" android:layout_width="19dp"
android:layout_height="19dp" android:layout_height="19dp"
android:layout_marginEnd="7dp" android:layout_marginEnd="7dp"
@ -32,7 +33,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:text="一鍵下載所有禮物動畫" android:text="设置为联系方式礼物"
android:textSize="10sp" android:textSize="10sp"
android:visibility="visible" /> android:visibility="visible" />
@ -88,7 +89,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_live_gift"> android:background="@mipmap/img_lu_bg">
<LinearLayout <LinearLayout
android:id="@+id/gift_tab_layout" android:id="@+id/gift_tab_layout"
@ -155,24 +156,23 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="66dp" android:layout_height="66dp"
android:layout_weight="0"> android:layout_weight="0">
<RadioGroup <RadioGroup
android:id="@+id/radio_group" android:id="@+id/radio_group"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="6dp" android:layout_height="6dp"
android:layout_gravity="end" android:layout_gravity="center_horizontal"
android:layout_marginTop="3.5dp" android:layout_marginTop="3.5dp"
android:layout_marginEnd="20dp"
android:gravity="end" android:gravity="end"
android:orientation="horizontal" /> android:orientation="horizontal" />
<RadioGroup <RadioGroup
android:id="@+id/radio_group_wrap" android:id="@+id/radio_group_wrap"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginEnd="20dp"
android:layout_height="6dp" android:layout_height="6dp"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginTop="3.5dp" android:layout_marginTop="3.5dp"
android:gravity="end" android:gravity="center_horizontal"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="visible" /> android:visibility="visible" />
@ -206,12 +206,13 @@
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:layout_toLeftOf="@id/btn_send" android:layout_toLeftOf="@id/btn_send"
android:background="@drawable/bg_live_gift_choose" android:background="@drawable/bg_live_gift_choose2"
android:gravity="center" android:gravity="center"
android:paddingRight="13dp" android:paddingRight="13dp"
android:text="1" android:text="1"
android:textColor="@color/global" android:textColor="@color/white"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold"
android:visibility="invisible" /> android:visibility="invisible" />
<ImageView <ImageView
@ -232,9 +233,9 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:gravity="bottom" android:gravity="bottom"
android:layout_marginStart="20dp"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_live_tota" android:background="@mipmap/img_pop_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="171dp"> android:layout_height="171dp">

View File

@ -40,6 +40,7 @@
</TextView> </TextView>
<TextView <TextView
android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"

Some files were not shown because too many files have changed in this diff Show More