diff --git a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java index 87fccce94..5e7fecaa1 100644 --- a/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java +++ b/app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java @@ -8,6 +8,7 @@ import android.os.Looper; import android.util.Log; import android.widget.Toast; +import com.yunbao.common.BuildConfig; import com.yunbao.common.bean.CrashSaveBean; import com.yunbao.common.utils.FileUtil; import com.yunbao.common.utils.SpUtil; @@ -101,7 +102,9 @@ public class NeverCrashUtils { Log.e(TAG, "未捕获的主线程异常行为", e); } 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"); getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e); // return; diff --git a/common/src/main/java/com/yunbao/common/bean/BannerBean.java b/common/src/main/java/com/yunbao/common/bean/BannerBean.java index 37767407e..75a8fc7ea 100644 --- a/common/src/main/java/com/yunbao/common/bean/BannerBean.java +++ b/common/src/main/java/com/yunbao/common/bean/BannerBean.java @@ -16,6 +16,7 @@ public class BannerBean { private int type; private String name; private int activityId=0; + private int mIconRes; private StarChallengeStatusModel model; @@ -100,6 +101,14 @@ public class BannerBean { this.activityId = activityId; } + public int getIconRes() { + return mIconRes; + } + + public void setIconRes(int mIconRes) { + this.mIconRes = mIconRes; + } + @Override public String toString() { return "BannerBean{" + diff --git a/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java b/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java index da77d56e5..a519e9385 100644 --- a/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java +++ b/common/src/main/java/com/yunbao/common/bean/HttpCallbackModel.java @@ -28,4 +28,12 @@ public class HttpCallbackModel extends BaseModel { public void setMsg(String msg) { this.msg = msg; } + + @Override + public String toString() { + return "HttpCallbackModel{" + + "code=" + code + + ", msg='" + msg + '\'' + + '}'; + } } diff --git a/common/src/main/java/com/yunbao/common/bean/LiveAnchorCallMeModel.java b/common/src/main/java/com/yunbao/common/bean/LiveAnchorCallMeModel.java new file mode 100644 index 000000000..1cedccb49 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/LiveAnchorCallMeModel.java @@ -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); + } + } + +} diff --git a/common/src/main/java/com/yunbao/common/bean/LiveAnchorSayModel.java b/common/src/main/java/com/yunbao/common/bean/LiveAnchorSayModel.java new file mode 100644 index 000000000..ba686fa63 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/LiveAnchorSayModel.java @@ -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 style; + + public LiveAnchorSayModel() { + } + + public LivePreview getLivePreview() { + return livePreview; + } + + public void setLivePreview(LivePreview livePreview) { + this.livePreview = livePreview; + } + + public List getStyle() { + return style; + } + + public void setStyle(List 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 + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/LiveUserMailBoxModel.java b/common/src/main/java/com/yunbao/common/bean/LiveUserMailBoxModel.java new file mode 100644 index 000000000..b68478a05 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/LiveUserMailBoxModel.java @@ -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 + '\'' + + '}'; + } +} diff --git a/common/src/main/java/com/yunbao/common/dialog/AbsDialogPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/AbsDialogPopupWindow.java index 150ca86e7..94503aa4b 100644 --- a/common/src/main/java/com/yunbao/common/dialog/AbsDialogPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/AbsDialogPopupWindow.java @@ -27,6 +27,7 @@ public abstract class AbsDialogPopupWindow extends BottomPopupView { public void showDialog() { XPopup.Builder builder = new XPopup.Builder(mContext); builder.isDestroyOnDismiss(true); + builder.enableDrag(false); buildDialog(builder); builder.asCustom(this).show(); } diff --git a/common/src/main/java/com/yunbao/common/http/API.java b/common/src/main/java/com/yunbao/common/http/API.java index 02c5c12ba..89c03afcb 100644 --- a/common/src/main/java/com/yunbao/common/http/API.java +++ b/common/src/main/java/com/yunbao/common/http/API.java @@ -44,7 +44,7 @@ public class API extends BaseApi { public PDLiveApi pdLiveApi(Context context) { if (null == pdLiveApi) { //实例化gson - pdLiveApi=createPDLiveApi(true); + pdLiveApi = createPDLiveApi(true, true); } return pdLiveApi; } @@ -52,10 +52,23 @@ public class API extends BaseApi { /** * 创建新的PDLiveApi,兼容部分接口需要控制是否添加UID参数 * 仅有需要不添加uid的接口使用,默认请用pdLiveApi() + * * @param isNeedUid 是否需要用户uid参数 * @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() .registerTypeAdapter(Date.class, new DateTypeAdapter()) .create(); @@ -64,20 +77,20 @@ public class API extends BaseApi { OkHttpClient.Builder builder = new OkHttpClient() .newBuilder() - .addInterceptor(initQuery(isNeedUid,CommonAppContext.sInstance.getApplicationContext())) + .addInterceptor(initQuery(isNeedUid, isNeedToken, CommonAppContext.sInstance.getApplicationContext())) .addInterceptor(loggingInterceptor); return create(builder.build(), 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() { @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); //配置公共参数 - request = new ParamsContext(request, context).getInRequest(isNeedUid); + request = new ParamsContext(request, context).getInRequest(isNeedUid, isNeedToken); return chain.proceed(request); } }; diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 5d269d74e..92857c5f6 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -1,5 +1,6 @@ package com.yunbao.common.http; +import com.alibaba.fastjson.JSONObject; import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.AnchorRecommendModel; 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.ListInfoMessageModel; 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.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveTaskModel; +import com.yunbao.common.bean.LiveUserMailBoxModel; import com.yunbao.common.bean.MsgSwitchDetailModel; import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.bean.NobleRankHideUserListModel; @@ -575,4 +579,61 @@ public interface PDLiveApi { Observable>> getAnchorMsg( @Query("liveuid") String liveUid, @Query("page") int page, @Query("limit") int limit ); + /** + * 获取女神说数据 + */ + @GET("/api/public/?service=Live.getLivePreviewInfo") + Observable> getLivePreviewInfo( + @Query("liveuid") String liveUid + ); + + /** + * 设置女神说 + * + * @param isShow 是否显示 + * @param content 内容 + * @param styleImage 女神说底图地址 + * + */ + @GET("/api/public/?service=Live.setLivePreview") + Observable> setLivePreviewInfo( + @Query("liveuid") String liveUid, + @Query("isShow") int isShow, + @Query("content") String content, + @Query("styleImage")String styleImage + ); + + /** + * 设置主播联系方式 + */ + @GET("/api/public/?service=Live.setAnchorContact") + Observable> 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> getContactInfo( + @Query("liveuid") String liveUid + ); + /** + * 获取收件箱信息 + */ + @GET("/api/public/?service=Live.getContactMsg") + Observable>> getContactMsg(); + /** + * 删除联系方式信件 + */ + @GET("/api/public/?service=Live.delContactMsg") + Observable> delContactMsg( + @Query("msgId") int msgId + ); } diff --git a/common/src/main/java/com/yunbao/common/http/base/GetRequestParams.java b/common/src/main/java/com/yunbao/common/http/base/GetRequestParams.java index 002936359..aa12e2997 100644 --- a/common/src/main/java/com/yunbao/common/http/base/GetRequestParams.java +++ b/common/src/main/java/com/yunbao/common/http/base/GetRequestParams.java @@ -20,7 +20,7 @@ public class GetRequestParams implements IRequestParam { * @return */ @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)) { IMLoginModel model = IMLoginManager.get(context).getUserInfo(); @@ -36,7 +36,9 @@ public class GetRequestParams implements IRequestParam { if (isNeedUid) { 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(); diff --git a/common/src/main/java/com/yunbao/common/http/base/IRequestParam.java b/common/src/main/java/com/yunbao/common/http/base/IRequestParam.java index bf3a7b311..b87402252 100644 --- a/common/src/main/java/com/yunbao/common/http/base/IRequestParam.java +++ b/common/src/main/java/com/yunbao/common/http/base/IRequestParam.java @@ -5,5 +5,5 @@ import android.content.Context; import okhttp3.Request; public interface IRequestParam { - Request getRequest(boolean isNeedUid,Request request, Context context); + Request getRequest(boolean isNeedUid,boolean isNeedToken, Request request, Context context); } diff --git a/common/src/main/java/com/yunbao/common/http/base/ParamsContext.java b/common/src/main/java/com/yunbao/common/http/base/ParamsContext.java index 8eedbed38..ddd159a76 100644 --- a/common/src/main/java/com/yunbao/common/http/base/ParamsContext.java +++ b/common/src/main/java/com/yunbao/common/http/base/ParamsContext.java @@ -14,7 +14,7 @@ public class ParamsContext { this.request = request; } - public Request getInRequest(boolean isNeedUid) { + public Request getInRequest(boolean isNeedUid,boolean isNeedToken) { switch (request.method()) { case "GET": iRequestParam = new GetRequestParams(); @@ -23,6 +23,6 @@ public class ParamsContext { iRequestParam = new PostRequestParams(); break; } - return iRequestParam.getRequest(isNeedUid,request, context); + return iRequestParam.getRequest(isNeedUid,isNeedToken,request, context); } } diff --git a/common/src/main/java/com/yunbao/common/http/base/PostRequestParams.java b/common/src/main/java/com/yunbao/common/http/base/PostRequestParams.java index 7c1cf332c..4e49b9120 100644 --- a/common/src/main/java/com/yunbao/common/http/base/PostRequestParams.java +++ b/common/src/main/java/com/yunbao/common/http/base/PostRequestParams.java @@ -12,7 +12,7 @@ import okhttp3.Request; public class PostRequestParams implements IRequestParam { @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) { FormBody.Builder bodyBuilder = new FormBody.Builder(); @@ -32,7 +32,9 @@ public class PostRequestParams implements IRequestParam { if (isNeedUid) { bodyBuilder.addEncoded("uid", String.valueOf(model.getId())); } - bodyBuilder.addEncoded("token", model.getToken()); + if(isNeedToken) { + bodyBuilder.addEncoded("token", model.getToken()); + } formBody = bodyBuilder.build(); } } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 89ac477d5..522470167 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -4,6 +4,7 @@ import android.content.Context; import android.text.TextUtils; import android.util.Log; +import com.alibaba.fastjson.JSONObject; import com.yunbao.common.Constants; import com.yunbao.common.R; 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.ListInfoMessageModel; 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.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.LiveTaskModel; +import com.yunbao.common.bean.LiveUserMailBoxModel; import com.yunbao.common.bean.NobleRankHideUserListModel; import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.PkRankBean; @@ -45,6 +49,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; +import retrofit2.http.Query; /** @@ -1145,6 +1150,143 @@ public class LiveNetManager { }).isDisposed(); } + /** + * 获取女神说数据 + */ + public void getLivePreviewInfo(String liveUid, HttpCallback 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 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 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> 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 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 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(); + } + /** * 直播间取消网络请求 */ diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 71781ef36..305b8108f 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -43,6 +43,8 @@ public class IMLoginManager extends BaseCacheManager { private final String CLARITY = "clarity"; 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); @@ -52,6 +54,8 @@ public class IMLoginManager extends BaseCacheManager { return getString(keyDefaultBubbleUrl); } + + public void setXiaJBG(boolean xjbg) { put(xiaJBG, xjbg); } @@ -93,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() { return 1 == getInt(IS_HINT, 0); } diff --git a/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java index b3f6cd9d6..02ea18b27 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveOpenCustomPopup.java @@ -24,7 +24,9 @@ public class LiveOpenCustomPopup extends CenterPopupView { //房间类型 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) { this.classBean = classBean; @@ -65,6 +67,8 @@ public class LiveOpenCustomPopup extends CenterPopupView { textLiveClass = findViewById(R.id.text_live_class); textLiveWishlist = findViewById(R.id.text_live_wishlist); textRobot = findViewById(R.id.text_robot); + textSay = findViewById(R.id.text_say); + textCall = findViewById(R.id.text_call); if (classBean != null) { 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) { @@ -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() { + 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()) .getLiveStetUpStatus(String.valueOf(IMLoginManager.get(getContext()).getUserInfo().getId()), new HttpCallback() { @@ -142,7 +184,7 @@ public class LiveOpenCustomPopup extends CenterPopupView { @Override 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 openAnchorSay(); + + //设置联系方式 + void openCallMe(); } } diff --git a/common/src/main/res/drawable/background_e6000.xml b/common/src/main/res/drawable/background_e6000.xml new file mode 100644 index 000000000..564f3e6fc --- /dev/null +++ b/common/src/main/res/drawable/background_e6000.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_live_new_function.xml b/common/src/main/res/layout/dialog_live_new_function.xml index 431285898..7a444507f 100644 --- a/common/src/main/res/layout/dialog_live_new_function.xml +++ b/common/src/main/res/layout/dialog_live_new_function.xml @@ -335,7 +335,48 @@ android:textColor="#FF9A9A9A" android:textSize="12sp" /> + + + + + + + + + + + diff --git a/common/src/main/res/layout/live_anchor_call_me_edit_title.xml b/common/src/main/res/layout/live_anchor_call_me_edit_title.xml new file mode 100644 index 000000000..964b43618 --- /dev/null +++ b/common/src/main/res/layout/live_anchor_call_me_edit_title.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + diff --git a/common/src/main/res/layout/view_live_open.xml b/common/src/main/res/layout/view_live_open.xml index d40b58280..54aba0a57 100644 --- a/common/src/main/res/layout/view_live_open.xml +++ b/common/src/main/res/layout/view_live_open.xml @@ -2,7 +2,7 @@ @@ -206,6 +206,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/src/main/res/mipmap-xxhdpi/ic_live_fun_anchor_letter.png b/common/src/main/res/mipmap-xxhdpi/ic_live_fun_anchor_letter.png new file mode 100644 index 000000000..7f4ecfb95 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/ic_live_fun_anchor_letter.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/ic_live_fun_anchor_say.png b/common/src/main/res/mipmap-xxhdpi/ic_live_fun_anchor_say.png new file mode 100644 index 000000000..fc7d99691 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/ic_live_fun_anchor_say.png differ diff --git a/common/src/main/res/values-en/strings.xml b/common/src/main/res/values-en/strings.xml index b46fdb4e6..52ad1db6d 100644 --- a/common/src/main/res/values-en/strings.xml +++ b/common/src/main/res/values-en/strings.xml @@ -1089,4 +1089,5 @@ Limited ride And limited avatar frame Get a fan badge for giving gifts Whether to clear unread messages The application collects location data to support login and registration functions. + 女神說 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index f2933b3b4..6ab009269 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -734,6 +734,8 @@ 語音連麥 周星榜 暫時離開 + 聯繫方式 + 女神說 恢復直播 請輸入數字 您是當前主播的周守護\n守護日期截止到 @@ -1088,6 +1090,7 @@ 說點什麽吧... %s 来了 + 女神說 diff --git a/live/src/main/assets/ic_live_anchor_call_me.svga b/live/src/main/assets/ic_live_anchor_call_me.svga new file mode 100644 index 000000000..ba388de6d Binary files /dev/null and b/live/src/main/assets/ic_live_anchor_call_me.svga differ diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index cc565e6ec..533e60088 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -68,6 +68,7 @@ import com.yunbao.live.dialog.LiveNewGuardListDialogFragment; import com.yunbao.live.dialog.LiveRedPackListDialogFragment; import com.yunbao.live.dialog.LiveRedPackSendDialogFragment; import com.yunbao.live.dialog.LiveShareDialogFragment; +import com.yunbao.live.dialog.LiveUserAnchorMailBoxPopDialog; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveUserMoreDialogFragment; import com.yunbao.live.http.LiveHttpConsts; @@ -108,7 +109,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL public String anyway; public ViewGroup mContainer; protected ViewGroup mPageContainer; - protected LiveRoomViewHolder mLiveRoomViewHolder; + public LiveRoomViewHolder mLiveRoomViewHolder; protected AbsLiveViewHolder mLiveBottomViewHolder; protected LiveAddImpressViewHolder mLiveAddImpressViewHolder; protected LiveContributeViewHolder mLiveContributeViewHolder; @@ -895,8 +896,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL * 打开私信列表窗口 */ public void openChatListWindow() { - Intent intent = new Intent(mContext, PDLIiveChatActivity.class); - mContext.startActivity(intent); + // Intent intent = new Intent(mContext, PDLIiveChatActivity.class); + // mContext.startActivity(intent); + new LiveUserAnchorMailBoxPopDialog(mContext).showDialog(); } @@ -1288,7 +1290,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL @Override public void onError(String error) { Log.e("LiveUserMoreDialog", error); - ToastUtil.show( R.string.net_error); + ToastUtil.show(R.string.net_error); } }); } else { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java index 92e5187d1..788d257ce 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java @@ -483,6 +483,8 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic } mLiveRoomViewHolder.initHourRankList(); mLiveRoomViewHolder.startAnchorLight(); + //初始化女神说 + mLiveRoomViewHolder.initAnchorSay(); } if (mLiveAnchorViewHolder == null) { mLiveAnchorViewHolder = new LiveAnchorViewHolder(mContext, mContainer); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 5ead5be28..1cd0b0652 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1277,6 +1277,9 @@ public class LiveAudienceActivity extends LiveActivity { manager.endDRGif(); } 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() { runOnUiThread(new Runnable() { @Override diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index ae017e117..3d17a4414 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -262,6 +262,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl mLiveReadyViewHolder = new LiveNewReadyRyViewHolder(mContext, mContainer, mLiveSDK); mLiveReadyViewHolder.setManager(manager); mLiveReadyViewHolder.addToParent(); + mLiveReadyViewHolder.setLiveUid(mLiveUid); mLiveReadyViewHolder.subscribeActivityLifeCycle(); mLiveLinkMicPresenter = new LiveLinkMicPresenter(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.startAnchorLight(); - + //初始化女神说 + mLiveRoomViewHolder.initAnchorSay(); } if (mLiveAnchorViewHolder == null) { mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer); diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveAnchorEditCallMeAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveAnchorEditCallMeAdapter.java new file mode 100644 index 000000000..692b24e30 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/LiveAnchorEditCallMeAdapter.java @@ -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 { + 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 onItemClickListener; + private List list = new ArrayList<>(); + + public LiveAnchorEditCallMeAdapter(Context mContext) { + this.mContext = mContext; + } + + public void setList(List list) { + this.list = list; + notifyDataSetChanged(); + } + + public void setOnItemClickListener(OnItemClickListener 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() { + @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() { + @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; + } + } + + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveAnchorSayItemsAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveAnchorSayItemsAdapter.java new file mode 100644 index 000000000..a0a6d8998 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/LiveAnchorSayItemsAdapter.java @@ -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 { + private Context mContext; + private List list; + private int click = -1; + private OnItemClickListener onItemClickListener; + + public LiveAnchorSayItemsAdapter(Context mContext) { + this.mContext = mContext; + list = new ArrayList<>(); + } + + public void setList(List list) { + this.list = list; + notifyDataSetChanged(); + } + + public void setOnItemClickListener(OnItemClickListener 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); + } + } + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveUserAnchorMailBoxAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveUserAnchorMailBoxAdapter.java new file mode 100644 index 000000000..9503f63fb --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/LiveUserAnchorMailBoxAdapter.java @@ -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 { + private Context mContext; + private List list; + OnItemClickListener onItemClickListener; + + public LiveUserAnchorMailBoxAdapter(Context mContext) { + this.mContext = mContext; + list = new ArrayList<>(); + } + + public void setList(List list) { + this.list = list; + notifyDataSetChanged(); + } + + public List getList() { + return list; + } + + public void setOnItemClickListener(OnItemClickListener 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() { + @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(); + } + } + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java b/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java index 0fcae4596..662e3dcda 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java @@ -17,8 +17,10 @@ import android.widget.TextView; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.lxj.xpopup.XPopup; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.PrankGiftBean; +import com.yunbao.common.dialog.AbsDialogPopupWindow; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.StringUtil; @@ -34,15 +36,14 @@ import com.yunbao.live.http.LiveHttpUtil; import java.util.ArrayList; import java.util.List; +import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; 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 View mContentView; private LiveGiftPagerAdapter mLiveGiftPagerAdapter; private GiftPopDialog.ActionListener mActionListener; private View mLoading; @@ -60,16 +61,27 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O private int prangNum; private InputMethodManager imm; private List 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); - items = (RecyclerView) mRootView.findViewById(R.id.items); - mViewPager = (ViewPager) mRootView.findViewById(R.id.viewPager); - mRadioGroup = (RadioGroup) mRootView.findViewById(R.id.radio_group); - mBtnSend = mRootView.findViewById(R.id.btn_send); - mBtnContext = mRootView.findViewById(R.id.btn_context); - mBtn = mRootView.findViewById(R.id.gift_btn); - mBack = mRootView.findViewById(R.id.gift_back); + + public GiftPopDialog(@NonNull Context context) { + super(context); + } + + private void initView() { + mLoading = findViewById(R.id.loading); + items = (RecyclerView) findViewById(R.id.items); + 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); items.setLayoutManager(manager); 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; - mParent = parent; mActionListener = actionListener; - mContentView = LayoutInflater.from(mContext).inflate(R.layout.dialog_live_select_gift_wrap, null); - ViewParent viewParent = mContentView.getParent(); - if (viewParent != null) { - ((ViewGroup) viewParent).removeView(mContentView); - } - setContentView(mContentView); - setWidth(ViewGroup.LayoutParams.MATCH_PARENT); - setHeight(ViewGroup.LayoutParams.MATCH_PARENT); - 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); + // setAnimationStyle(R.style.leftToRightAnim); + + } + + @Override + protected void onCreate() { + super.onCreate(); + initView(); initDate(); } + public GiftPopDialog setShowNumber(boolean showNumber) { + this.showNumber = showNumber; + return this; + } + + public GiftPopDialog setTitle(String title) { + this.title = title; + return this; + } + private void initDate() { LiveHttpUtil.getNewGiftList(new HttpCallback() { @Override @@ -214,10 +215,6 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O } } - public void show() { - showAtLocation(mParent, Gravity.CENTER, 0, 0); - } - @Override 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) { try { prangNum = Integer.parseInt(content); - if (prangNum <= 0 ) { + if (prangNum <= 0) { ToastUtil.show("數量不能為0或負數"); return; } - if(prangNum>999){ + if (prangNum > 999) { ToastUtil.show("數量不能大於999"); return; } @@ -298,6 +295,14 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O } } 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) { dismiss(); } @@ -307,6 +312,16 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O 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 { void onSelectGift(PrankGiftBean bean); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java new file mode 100644 index 000000000..c78ad3c1e --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeDialog.java @@ -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 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 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() { + @Override + public void onSuccess(LiveAnchorCallMeModel data) { + setData(data); + } + + @Override + public void onError(String error) { + setData(new LiveAnchorCallMeModel()); + } + + void setData(LiveAnchorCallMeModel data) { + callMeModel = data; + List 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() { + @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() { + @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; + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeEditAppDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeEditAppDialog.java new file mode 100644 index 000000000..bba88abff --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorEditCallMeEditAppDialog.java @@ -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 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 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(); + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveAnchorSayPopDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorSayPopDialog.java new file mode 100644 index 000000000..67006691c --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/LiveAnchorSayPopDialog.java @@ -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 onItemClickListener; + + public LiveAnchorSayPopDialog(@NonNull Context context) { + super(context); + } + + public LiveAnchorSayPopDialog setLiveUid(String mLiveUid) { + this.mLiveUid = mLiveUid; + return this; + } + + public LiveAnchorSayPopDialog setOnItemClickListener(OnItemClickListener 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() { + @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() { + @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() { + @Override + public void onSuccess(LiveAnchorSayModel data) { + sayModel = data; + List 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) { + + } + }); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java index 4366e4bd6..336b4d1b5 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftDialogFragment.java @@ -4,6 +4,7 @@ import static com.yunbao.common.CommonAppConfig.isGetNewWrap; import static com.yunbao.common.utils.RouteUtil.PATH_COIN; import static com.yunbao.live.views.LiveRoomViewHolder.bean1; +import android.content.DialogInterface; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; @@ -25,7 +26,11 @@ import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.ViewPager; @@ -124,6 +129,9 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On private TextView mVipGoldDesc; private TextView mGiftPackage; private boolean isPk; + private int isContactGift = 0; + DialogInterface.OnDismissListener onDismissListener; + DialogInterface.OnShowListener onShowListener; @Override @@ -155,6 +163,22 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On 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) { isPk = pk; } @@ -208,7 +232,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On @Override 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); } } @@ -278,6 +302,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On mStream = bundle.getString(Constants.LIVE_STREAM); mWishGiftId = bundle.getString(Constants.LIVE_WISH_GIFTID); by = bundle.getString("by"); + isContactGift = bundle.getBoolean("isContactGift", false) ? 1 : 0; } loadGiftListData(); loadUserVip(); @@ -665,9 +690,9 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On } SendGiftCallback callback = new SendGiftCallback(mLiveGiftBean); if (by != null) { - LiveHttpUtil.sendGift("1", mLiveUid, mStream, mLiveGiftBean.getId(), mCount, callback); + LiveHttpUtil.sendGift("1", mLiveUid, mStream, mLiveGiftBean.getId(), mCount, isContactGift, callback); } 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()); } + public void setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) { + this.onDismissListener = onDismissListener; + } + + public void setOnShowListener(DialogInterface.OnShowListener onShowListener) { + this.onShowListener = onShowListener; + } + private class SendGiftCallback extends HttpCallback { private LiveGiftBean mGiftBean; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java index 3fc60e1a5..12a8fd209 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java @@ -25,7 +25,9 @@ import android.widget.TextView; import com.lxj.xpopup.XPopup; import com.yunbao.common.Constants; +import com.yunbao.common.bean.LiveAnchorSayModel; import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; 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.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) { ((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.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(); } } diff --git a/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java index 110932759..a5e0d1cf2 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java @@ -141,7 +141,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O ToastUtil.show("可添加禮物數量達到上限"); return; } - GiftPopDialog dialog = new GiftPopDialog(mContext, mRootView, new GiftPopDialog.ActionListener() { + GiftPopDialog dialog = new GiftPopDialog(mContext, new GiftPopDialog.ActionListener() { @Override public void onSelectGift(PrankGiftBean bean) { @@ -156,7 +156,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O } }); dialog.setList(giftBeans); - dialog.show(); + dialog.showDialog(); } else { setPrankConfig(); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxPopDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxPopDialog.java new file mode 100644 index 000000000..1b15d422d --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxPopDialog.java @@ -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>() { + @Override + public void onSuccess(List 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 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)); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxWebInfoPopDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxWebInfoPopDialog.java new file mode 100644 index 000000000..143eaed8d --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserAnchorMailBoxWebInfoPopDialog.java @@ -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); + } +} diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 49600b5f1..89aa31a10 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -299,7 +299,8 @@ public class LiveAudienceEvent extends BaseModel { UPDATA_ROBOT(53, "更新机器人消息"), LIVE_VIDEO(54, "画质选择"), LUCKY_100_CHECK(55, "幸运百分百"), - LIVE_END(56, "主播下播"); + LIVE_END(56, "主播下播"), + LIVE_HIDE_MSG_RED(57,"隐藏红点"); private int type; private String name; diff --git a/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java b/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java index 13b68c9f1..a86c2906d 100644 --- a/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java +++ b/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java @@ -606,10 +606,19 @@ public class LiveHttpUtil { * 观众给主播送礼物 */ 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) .params("liveuid", liveUid) .params("stream", stream) .params("giftid", giftId) + .params("isContactGift", isContactGift) .params("giftcount", giftCount) .params("isprank", by) .params("appVersion", CommonAppConfig.getInstance().getVersion()) diff --git a/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java b/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java index b6868174e..4f38c8143 100644 --- a/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/AbsLiveViewHolder.java @@ -17,7 +17,7 @@ import org.greenrobot.eventbus.EventBus; public abstract class AbsLiveViewHolder extends AbsViewHolder implements View.OnClickListener { - private TextView mRedPoint; + public TextView mRedPoint; public AbsLiveViewHolder(Context context, ViewGroup parentView) { super(context, parentView); diff --git a/live/src/main/java/com/yunbao/live/views/Banner4CustomViewHolder.java b/live/src/main/java/com/yunbao/live/views/Banner4CustomViewHolder.java index 39954fdf6..9be9377aa 100644 --- a/live/src/main/java/com/yunbao/live/views/Banner4CustomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/Banner4CustomViewHolder.java @@ -12,7 +12,11 @@ public class Banner4CustomViewHolder implements BannerViewHolder { @Override public View createView(Context context, int position, BannerBean data) { 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; } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java index 1411da666..b167214ce 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java @@ -27,6 +27,8 @@ import com.lxj.xpopup.interfaces.XPopupCallback; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; 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.LiveRoomTypeBean; 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.interfaces.CommonCallback; import com.yunbao.common.interfaces.ImageResultCallback; +import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; @@ -53,6 +56,8 @@ import com.yunbao.faceunity.FaceManager; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; 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.LiveNewRoomClassDialogFragment; import com.yunbao.live.dialog.LiveNewRoomTypeDialogFragment; @@ -96,6 +101,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl private int selectClarity = 1; private LiveOpenCustomPopup liveOpenCustomPopup; private boolean selector = true; + private String mLiveUid; public LiveNewReadyRyViewHolder(Context context, ViewGroup parentView, int 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_horizontally).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) { manager.setFaceStatusChanged(new FaceManager.FaceStatusChanged() { @@ -389,6 +397,8 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl } // startLive(); liveOpenCustomPopup = new LiveOpenCustomPopup(mContext, IMLoginManager.get(mContext).getSelectClarity(), classBean, liveRoomTypeBean) + .setSayStatus(IMLoginManager.get(mContext).getAnchorSayStatus()) + .setCallMeStatus(IMLoginManager.get(mContext).getAnchorCallStatus()) .setCallBack(new LiveOpenCustomPopup.LiveOpenCallBack() { @Override @@ -537,6 +547,16 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl //点击心愿单 openWishListWindow(); } + + @Override + public void openAnchorSay() { + openAnchorSayDialog(); + } + + @Override + public void openCallMe() { + openAnchorCallMeDialog(); + } }); new XPopup.Builder(mContext) .asCustom(liveOpenCustomPopup) @@ -565,6 +585,10 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl .append("&token=") .append(model.getToken()); 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() { + @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() { + @Override + public void onItemClick(LiveAnchorCallMeModel bean, int position) { + if (liveOpenCustomPopup != null) { + liveOpenCustomPopup.setCallMeStatus(bean.getIsShow() == 1); + } + } + }).showDialog(); + } + @Subscribe(threadMode = ThreadMode.MAIN) public void updateStart(LiveAudienceEvent event) { if (event.getType() == WISH_LIST_UPDATE) { @@ -893,4 +939,8 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl public void onDestroy() { LiveHttpUtil.cancel(LiveHttpConsts.CREATE_ROOM); } + + public void setLiveUid(String mLiveUid) { + this.mLiveUid = mLiveUid; + } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 35009cae9..abe3b71b3 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -71,10 +71,13 @@ import com.yunbao.common.bean.HourRank; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LevelBean; 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.LiveGiftBean; import com.yunbao.common.bean.LiveRoomActivityBanner; import com.yunbao.common.bean.LiveUserGiftBean; +import com.yunbao.common.bean.LiveUserMailBoxModel; import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.NewPeopleTaskModel; import com.yunbao.common.bean.PkRankBean; @@ -140,6 +143,7 @@ import com.yunbao.live.custom.TopGradual; import com.yunbao.live.dialog.LiveFaceUnityDialogFragment; import com.yunbao.live.dialog.LiveFansMedalDialogFragment; import com.yunbao.live.dialog.LiveGameDialogFragment; +import com.yunbao.live.dialog.LiveGiftDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; @@ -301,6 +305,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private List mBannerList2 = new ArrayList<>(); private List mBannerList3 = new ArrayList<>(); private List mBannerList4 = new ArrayList<>(); + private List mTopBannerList = new ArrayList<>(); private LinearLayout btn_event2, btn_event3, btn_event4, enterRoomLeave2; private ImageView imgEvent; private View btnEvent; @@ -340,6 +345,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //全服通知 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) { super(context, parentView); @@ -682,6 +694,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void init() { 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); fullScreen = (FullServiceNotificationView) findViewById(R.id.full_screen); noble = (NobleNoticeView) findViewById(R.id.noble); @@ -835,6 +854,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis mPkRankTopIcon = (ImageView) findViewById(R.id.icon_pk_top); mRedVal = (TextView) findViewById(R.id.pk_rank_red_val); mBlueVal = (TextView) findViewById(R.id.pk_rank_blue_val); + topBanner1 = (Banner) findViewById(R.id.top_banner1); if (LivePushTxViewHolder.mTRTCCloud != null || LivePushRyViewHolder.rtcRoom != null) { fans_btn.setVisibility(View.GONE); @@ -1142,6 +1162,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis 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.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); @@ -1190,6 +1216,48 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis 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); + } + /** * 获取当前直播间星级 */ @@ -1849,7 +1917,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onError(String error) { - ToastUtil.show(R.string.net_error); + ToastUtil.show( R.string.net_error); } }); @@ -4332,4 +4400,147 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }); enterRoomLeave.startAnimation(animationSet1); } + LiveAnchorSayModel sayModel; + + public void initAnchorSayData() { + LiveNetManager.get(mContext) + .getLivePreviewInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback() { + @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() { + @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>() { + @Override + public void onSuccess(List data) { + for (LiveUserMailBoxModel model : data) { + if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) { + ((LiveAudienceActivity) mContext).showMsgRed(0); + return; + } + } + + } + + @Override + public void onError(String error) { + + } + }); + } } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index b262fcd02..fd0361d52 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -475,6 +475,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setVotes(data.getEnterRoomInfo().getVotestotal()); //真爱排行 数量 mLiveRoomViewHolder.setMedaRankNum(data.getEnterRoomInfo().getMedalRankNum()); + //初始化女神说 + mLiveRoomViewHolder.initAnchorSay(); + //初始化顶部banner + mLiveRoomViewHolder.initTopBanner(); + isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention()); if (isattention == 0) { if (countDownTimer != null) { @@ -1367,6 +1372,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void setPkStatus(boolean isPk) { if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.hotAddVisibility(isPk); + if (isPk) { + mLiveRoomViewHolder.hideAnchorSayAndCallAnchor(); + } else { + mLiveRoomViewHolder.showAnchorSayAndCallAnchor(); + } } } diff --git a/live/src/main/java/com/yunbao/live/views/TopBannerCustomViewHolder.java b/live/src/main/java/com/yunbao/live/views/TopBannerCustomViewHolder.java new file mode 100644 index 000000000..a9edba0e6 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/TopBannerCustomViewHolder.java @@ -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 { + 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; + } +} diff --git a/live/src/main/res/anim/view_live_anchor_say_text_in.xml b/live/src/main/res/anim/view_live_anchor_say_text_in.xml new file mode 100644 index 000000000..b31b61750 --- /dev/null +++ b/live/src/main/res/anim/view_live_anchor_say_text_in.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/live/src/main/res/anim/view_live_anchor_say_text_out.xml b/live/src/main/res/anim/view_live_anchor_say_text_out.xml new file mode 100644 index 000000000..33a223e8b --- /dev/null +++ b/live/src/main/res/anim/view_live_anchor_say_text_out.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/main/src/main/res/drawable/background_33ffffff.xml b/live/src/main/res/drawable/background_33ffffff.xml similarity index 100% rename from main/src/main/res/drawable/background_33ffffff.xml rename to live/src/main/res/drawable/background_33ffffff.xml diff --git a/live/src/main/res/drawable/bg_anchor_say.xml b/live/src/main/res/drawable/bg_anchor_say.xml new file mode 100644 index 000000000..e698c0765 --- /dev/null +++ b/live/src/main/res/drawable/bg_anchor_say.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_anchor_say_select.xml b/live/src/main/res/drawable/bg_anchor_say_select.xml new file mode 100644 index 000000000..607704adc --- /dev/null +++ b/live/src/main/res/drawable/bg_anchor_say_select.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_item_live_user_mailbox_info_text.xml b/live/src/main/res/drawable/bg_item_live_user_mailbox_info_text.xml new file mode 100644 index 000000000..486ce2347 --- /dev/null +++ b/live/src/main/res/drawable/bg_item_live_user_mailbox_info_text.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_item_live_user_mailbox_top_text.xml b/live/src/main/res/drawable/bg_item_live_user_mailbox_top_text.xml new file mode 100644 index 000000000..4d55b339c --- /dev/null +++ b/live/src/main/res/drawable/bg_item_live_user_mailbox_top_text.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_item_live_user_mailbox_username_text.xml b/live/src/main/res/drawable/bg_item_live_user_mailbox_username_text.xml new file mode 100644 index 000000000..1808b740a --- /dev/null +++ b/live/src/main/res/drawable/bg_item_live_user_mailbox_username_text.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_ready_btn2.xml b/live/src/main/res/drawable/bg_live_ready_btn2.xml new file mode 100644 index 000000000..f7cda2e72 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_ready_btn2.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_top_banner.xml b/live/src/main/res/drawable/bg_live_top_banner.xml new file mode 100644 index 000000000..bf21e74a3 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_top_banner.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_top_banner_text.xml b/live/src/main/res/drawable/bg_live_top_banner_text.xml new file mode 100644 index 000000000..1589f8921 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_top_banner_text.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_anchor_call_edit_app.xml b/live/src/main/res/layout/dialog_anchor_call_edit_app.xml new file mode 100644 index 000000000..a398e27b8 --- /dev/null +++ b/live/src/main/res/layout/dialog_anchor_call_edit_app.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + +