Merge branch 'dev_6.7.0'

This commit is contained in:
Martin 2024-06-19 11:13:16 +08:00
commit e89f22329f
105 changed files with 3725 additions and 390 deletions

View File

@ -30,7 +30,6 @@ import com.tencent.imsdk.v2.V2TIMGroupMemberInfo;
import com.tencent.imsdk.v2.V2TIMManager; import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSimpleMsgListener; import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
import com.tencent.imsdk.v2.V2TIMUserInfo; import com.tencent.imsdk.v2.V2TIMUserInfo;
import com.yunbao.common.http.Data;
import com.yunbao.common.manager.OpenAdManager; import com.yunbao.common.manager.OpenAdManager;
import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.BuildConfig; import com.yunbao.common.BuildConfig;

View File

@ -202,6 +202,8 @@ public class Constants {
public static final String LuckyAngel = "LuckyCheck";//幸运天使 public static final String LuckyAngel = "LuckyCheck";//幸运天使
public static final String Lucky100Check = "Lucky100Check";//幸运天使 public static final String Lucky100Check = "Lucky100Check";//幸运天使
public static final String PrankSendData = "PrankSendData";//整蛊进度
public static final int SOCKET_WHAT_CONN = 0; public static final int SOCKET_WHAT_CONN = 0;
public static final int SOCKET_WHAT_DISCONN = 2; public static final int SOCKET_WHAT_DISCONN = 2;
public static final int SOCKET_WHAT_BROADCAST = 1; public static final int SOCKET_WHAT_BROADCAST = 1;

View File

@ -0,0 +1,79 @@
package com.yunbao.common.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import java.util.HashMap;
import java.util.List;
public abstract class BaseAdapter<T> extends RecyclerView.Adapter<BaseAdapter.BaseViewHolder> {
private Context context;
public List<T> data;
public BaseAdapter(Context context, List<T> data) {
this.context = context;
this.data = data;
}
@Override
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(getItemLayoutId(), parent, false);
return new BaseViewHolder(view);
}
@Override
public void onBindViewHolder(BaseAdapter.BaseViewHolder holder, int position) {
T t = data.get(position);
convert(holder, t);
}
@Override
public int getItemCount() {
return data == null ? 0 : data.size();
}
public abstract void convert(BaseViewHolder holder, T t);
public abstract int getItemLayoutId();
class BaseViewHolder extends RecyclerView.ViewHolder {
private HashMap<Integer,View> views;
public BaseViewHolder(View itemView) {
super(itemView);
views = new HashMap<>();
if (onItemClickListener != null){
itemView.setOnClickListener(v ->onItemClickListener.onItemClick(getAdapterPosition()) );
}
}
public View getView(int id) {
View view = views.get(id);
if (view == null) {
view = itemView.findViewById(id);
views.put(id, view);
if (onItemClickListener != null){
view.setOnClickListener(v -> {
onItemClickListener.onItemChildClick(v, getAdapterPosition());
});
}
}
return view;
}
}
private OnItemClickListener onItemClickListener;
private void setOnItemClickListener(OnItemClickListener onItemClickListener){
this.onItemClickListener = onItemClickListener;
}
public interface OnItemClickListener{
default void onItemClick(int position){}
default void onItemChildClick(View view,int position){}
}
}

View File

@ -24,6 +24,10 @@ public class AnchorRecommendModel extends BaseModel {
@SerializedName("live_battle_pass_show_status") @SerializedName("live_battle_pass_show_status")
private int showWarOrder = 0;//是否显示首页戰令 private int showWarOrder = 0;//是否显示首页戰令
@SerializedName("live_battle_pass_image_cn")
private String battlePassImageCn;
@SerializedName("live_battle_pass_image_en")
private String battlePassImageEn;
//是否支持换一批0=不支持 1=支持 //是否支持换一批0=不支持 1=支持
@SerializedName("up_show") @SerializedName("up_show")
@ -58,6 +62,22 @@ public class AnchorRecommendModel extends BaseModel {
return listShow; return listShow;
} }
public String getBattlePassImageCn() {
return battlePassImageCn;
}
public void setBattlePassImageCn(String battlePassImageCn) {
this.battlePassImageCn = battlePassImageCn;
}
public String getBattlePassImageEn() {
return battlePassImageEn;
}
public void setBattlePassImageEn(String battlePassImageEn) {
this.battlePassImageEn = battlePassImageEn;
}
public AnchorRecommendModel setListShow(int listShow) { public AnchorRecommendModel setListShow(int listShow) {
this.listShow = listShow; this.listShow = listShow;
return this; return this;

View File

@ -56,4 +56,15 @@ public class PrankGiftBean extends BaseModel{
public void setGiftId(String giftId) { public void setGiftId(String giftId) {
this.giftId = giftId; this.giftId = giftId;
} }
@Override
public String toString() {
return "PrankGiftBean{" +
"title='" + title + '\'' +
", name='" + name + '\'' +
", icon='" + icon + '\'' +
", num=" + num +
", giftId='" + giftId + '\'' +
'}';
}
} }

View File

@ -0,0 +1,33 @@
package com.yunbao.common.bean;
import java.util.List;
public class PrankGiftResultBean extends BaseModel{
private List<PrankGiftBean> prank_list;
private String status;
private String prank_type;
public List<PrankGiftBean> getPrank_list() {
return prank_list;
}
public void setPrank_list(List<PrankGiftBean> prank_list) {
this.prank_list = prank_list;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getPrank_type() {
return prank_type;
}
public void setPrank_type(String prank_type) {
this.prank_type = prank_type;
}
}

View File

@ -0,0 +1,176 @@
package com.yunbao.common.bean;
import com.google.gson.JsonElement;
import java.util.List;
public class PrankProgressBean extends BaseModel {
private int status;//整蛊状态 0.关闭 1.开启
private int prank_turntable_status;// 转盘整蛊状态 0=关闭 1=开启
private int prank_type;// 整蛊类型 1.礼物整蛊 2.连击整蛊
private List<PrankList> prank_list;// 整蛊进度
private List<PrankList> completed_list;// 待完成的整蛊
public PrankProgressBean(){
}
public static class PrankList{
private int gift_id;// 礼物ID
private int gift_num;// 整蛊需要的礼物数量
private String prank_content; // 整蛊内容
private int send_num; // 用户已赠送的礼物数量
private int completed_num;// 待完成的整蛊次数
private String gift_name;// 礼物名称
private String gift_icon; // 礼物图片链接
private String gift_name_en;
private int continuous_click_num;
public int getContinuous_click_num() {
return continuous_click_num;
}
public void setContinuous_click_num(int continuous_click_num) {
this.continuous_click_num = continuous_click_num;
}
public String getGift_name_en() {
return gift_name_en;
}
public void setGift_name_en(String gift_name_en) {
this.gift_name_en = gift_name_en;
}
public int getGift_id() {
return gift_id;
}
public void setGift_id(int gift_id) {
this.gift_id = gift_id;
}
public int getGift_num() {
return gift_num;
}
public void setGift_num(int gift_num) {
this.gift_num = gift_num;
}
public String getPrank_content() {
return prank_content;
}
public void setPrank_content(String prank_content) {
this.prank_content = prank_content;
}
public int getSend_num() {
return send_num;
}
public void setSend_num(int send_num) {
this.send_num = send_num;
}
public int getCompleted_num() {
return completed_num;
}
public void setCompleted_num(int completed_num) {
this.completed_num = completed_num;
}
public String getGift_name() {
return gift_name;
}
public void setGift_name(String gift_name) {
this.gift_name = gift_name;
}
public String getGift_icon() {
return gift_icon;
}
public void setGift_icon(String gift_icon) {
this.gift_icon = gift_icon;
}
//计算完成度
public double getCompletionRate() {
if (gift_num == 0) return 0; // Avoid division by zero
return (double) send_num / gift_num;
}
@Override
public String toString() {
return "PrankList{" +
"gift_id=" + gift_id +
", gift_num=" + gift_num +
", prank_content='" + prank_content + '\'' +
", send_num=" + send_num +
", completed_num=" + completed_num +
", gift_name='" + gift_name + '\'' +
", gift_icon='" + gift_icon + '\'' +
", gift_name_en='" + gift_name_en + '\'' +
", continuous_click_num=" + continuous_click_num +
'}';
}
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getPrank_type() {
return prank_type;
}
public void setPrank_type(int prank_type) {
this.prank_type = prank_type;
}
public List<PrankList> getPrank_list() {
return prank_list;
}
public void setPrank_list(List<PrankList> prank_list) {
this.prank_list = prank_list;
}
public List<PrankList> getCompleted_list() {
return completed_list;
}
public void setCompleted_list(List<PrankList> completed_list) {
this.completed_list = completed_list;
}
public int getPrank_turntable_status() {
return prank_turntable_status;
}
public void setPrank_turntable_status(int prank_turntable_status) {
this.prank_turntable_status = prank_turntable_status;
}
@Override
public String toString() {
return "PrankProgressBean{" +
"status=" + status +
", prank_turntable_status=" + prank_turntable_status +
", prank_type=" + prank_type +
", prank_list=" + prank_list +
", completed_list=" + completed_list +
'}';
}
}

View File

@ -37,6 +37,8 @@ public class AllServerNotifyFFGGGDJANEvent extends BaseModel {
private List<ButtonStyleDTO> buttonStyle; private List<ButtonStyleDTO> buttonStyle;
@SerializedName("h5_type") @SerializedName("h5_type")
private String h5Type; private String h5Type;
@SerializedName("left_image")
private String leftImage;
public String getH5Type() { public String getH5Type() {
return h5Type; return h5Type;
@ -47,6 +49,14 @@ public class AllServerNotifyFFGGGDJANEvent extends BaseModel {
return this; return this;
} }
public String getLeftImage() {
return leftImage;
}
public void setLeftImage(String leftImage) {
this.leftImage = leftImage;
}
public String getMethod() { public String getMethod() {
return method; return method;
} }

View File

@ -16,6 +16,7 @@ import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition; import com.bumptech.glide.request.transition.Transition;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.interfaces.OnItemClickListener;
import java.io.File; import java.io.File;
@ -226,14 +227,20 @@ public class ImgLoader {
.skipMemoryCache(SKIP_MEMORY_CACHE) .skipMemoryCache(SKIP_MEMORY_CACHE)
.into(imageView); .into(imageView);
} }
public static void displayDrawable(Context context, String url, final DrawableCallback callback) { public static void displayDrawable(Context context, String url, final DrawableCallback callback) {
displayDrawable(context, url, -1, -1, callback);
}
public static void displayDrawable(Context context, String url, int width, int height, final DrawableCallback callback) {
if (TextUtils.isEmpty(url) || !contextIsExist(context)) { if (TextUtils.isEmpty(url) || !contextIsExist(context)) {
if (callback != null) if (callback != null)
callback.onLoadFailed(); callback.onLoadFailed();
} else { } else {
Glide.with(context).asDrawable().load(url).thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() { RequestBuilder<Drawable> builder = Glide.with(context).asDrawable().load(url);
if (width != -1 && height != -1) {
builder = builder.override(width, height);
}
builder.thumbnail(thumbnail).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
@Override @Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) { public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {

View File

@ -54,7 +54,9 @@ import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.OpenAdModel; import com.yunbao.common.bean.OpenAdModel;
import com.yunbao.common.bean.PkRankBean; import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.bean.PrankGiftResultBean;
import com.yunbao.common.bean.PrankHttpTurntableBean; import com.yunbao.common.bean.PrankHttpTurntableBean;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.bean.QuickGiftSendGiftModel; import com.yunbao.common.bean.QuickGiftSendGiftModel;
import com.yunbao.common.bean.RandomPkUserBean; import com.yunbao.common.bean.RandomPkUserBean;
import com.yunbao.common.bean.RankPkInfoBean; import com.yunbao.common.bean.RankPkInfoBean;
@ -505,7 +507,16 @@ public interface PDLiveApi {
* 获取整蛊列表 * 获取整蛊列表
*/ */
@GET("/api/public/?service=Prank.prankList") @GET("/api/public/?service=Prank.prankList")
Observable<ResponseModel<List<PrankGiftBean>>> prankList(@Query("anchor_id") String anchor_id); Observable<ResponseModel<PrankGiftResultBean>>prankList(
@Query("anchor_id") String anchor_id,
@Query("prank_type") String prank_type
);
/**
* 获取整蛊进度列表
*/
@GET("/api/public/?service=Prank.prankCompletedList")
Observable<ResponseModel<PrankProgressBean>> getPrankProgressList(@Query("anchor_id") String anchor_id);
/** /**
* 设置礼物整蛊 * 设置礼物整蛊
@ -513,9 +524,11 @@ public interface PDLiveApi {
@GET("/api/public/?service=Prank.setPrank") @GET("/api/public/?service=Prank.setPrank")
Observable<ResponseModel<List<BaseModel>>> setPrank( Observable<ResponseModel<List<BaseModel>>> setPrank(
@Query("anchor_id") String anchor_id, @Query("anchor_id") String anchor_id,
@Query("gift_id") String gift_id, @Query("status") String status,
@Query("gift_num") String gift_num, @Query("prank_json") String prank_json,
@Query("prank_content") String prank_content @Query("prank_type") String prank_type,
@Query("is_cleared") String is_cleared
); );
/** /**
@ -1235,4 +1248,17 @@ public interface PDLiveApi {
); );
@GET("/api/public/?service=Tx.getShengwangToken") @GET("/api/public/?service=Tx.getShengwangToken")
Observable<ResponseModel<SwTokenModel>> getSwToken(); Observable<ResponseModel<SwTokenModel>> getSwToken();
/**
*
* @param anchor_id
* @param gift_id
* @return
*/
@GET("/api/public/?service=Prank.anchorClickFinish")
Observable<ResponseModel<List<BaseModel>>> anchorClickFinish(
@Query("anchor_id")String anchor_id,
@Query("gift_id")String gift_id
);
} }

View File

@ -54,7 +54,9 @@ import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.OpenAdModel; import com.yunbao.common.bean.OpenAdModel;
import com.yunbao.common.bean.PkRankBean; import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.bean.PrankGiftResultBean;
import com.yunbao.common.bean.PrankHttpTurntableBean; import com.yunbao.common.bean.PrankHttpTurntableBean;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.bean.QuickGiftSendGiftModel; import com.yunbao.common.bean.QuickGiftSendGiftModel;
import com.yunbao.common.bean.RandomPkUserBean; import com.yunbao.common.bean.RandomPkUserBean;
import com.yunbao.common.bean.RankPkInfoBean; import com.yunbao.common.bean.RankPkInfoBean;
@ -880,9 +882,9 @@ public class LiveNetManager {
/** /**
* 获取转盘整蛊列表 * 获取转盘整蛊列表
*/ */
public void getPrankGiftList(String mLiveUid, HttpCallback<List<PrankGiftBean>> callback) { public void getPrankGiftList(String mLiveUid, String prank_type,HttpCallback<PrankGiftResultBean> callback) {
API.get().pdLiveApi(mContext) API.get().pdLiveApi(mContext)
.prankList(mLiveUid) .prankList(mLiveUid,prank_type)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.subscribe(responseModel -> { .subscribe(responseModel -> {
@ -899,12 +901,31 @@ public class LiveNetManager {
}).isDisposed(); }).isDisposed();
} }
/**
* 获取整蛊进度列表
*/
public void getPrankProgressList(String mLiveUid, HttpCallback<PrankProgressBean> callback){
API.get().pdLiveApi(mContext)
.getPrankProgressList(mLiveUid)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(responseModel->{
if (callback != null){
callback.onSuccess(responseModel.getData().getInfo());
}
},throwable->{
if (callback != null){
callback.onError(throwable.getMessage());
}
} ).isDisposed();
}
/** /**
* 设置礼物整蛊 * 设置礼物整蛊
*/ */
public void setPrankGift(String mLiveUid, String gift_id, String gift_num, String prank_content, HttpCallback<PrankHttpTurntableBean> callback) { public void setPrankGift(String mLiveUid, String status, String prank_json,String prank_type,String is_cleared, HttpCallback<PrankHttpTurntableBean> callback) {
API.get().pdLiveApi(mContext) API.get().pdLiveApi(mContext)
.setPrank(mLiveUid, gift_id, gift_num, prank_content) .setPrank(mLiveUid, status, prank_json, prank_type,is_cleared)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.subscribe(responseModel -> { .subscribe(responseModel -> {
@ -3192,6 +3213,31 @@ public class LiveNetManager {
} }
public void anchorClickFinish(String mLiveId, String giftId, HttpCallback<List<BaseModel>>callback) {
API.get().pdLiveApi(mContext)
.anchorClickFinish(mLiveId, giftId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ResponseModel<List<BaseModel>>>() {
@Override
public void accept(ResponseModel<List<BaseModel>> listResponseModel) throws Exception {
if (callback != null) {
callback.onSuccess(listResponseModel.getData().getInfo());
}
}
}, new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
throwable.printStackTrace();
if (callback != null) {
callback.onError(mContext.getString(R.string.net_error));
}
}
}).isDisposed();
}
public void updateFile(File file, HttpCallback<AvatarBean> callback) { public void updateFile(File file, HttpCallback<AvatarBean> callback) {
MultipartBody.Part uploadFile = createUploadFile(file); MultipartBody.Part uploadFile = createUploadFile(file);
API.get().pdLiveApi(mContext) API.get().pdLiveApi(mContext)

View File

@ -0,0 +1,12 @@
package com.yunbao.common.utils;
import android.view.View;
public class ViewUtils {
public static <T extends View> T findViewById(View view,int id,Class<T> clazz){
return view.findViewById(id);
}
public static <T extends View> T findViewById(View view,int id){
return view.findViewById(id);
}
}

View File

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

View File

@ -182,11 +182,35 @@
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout
android:layout_width="40dp"
android:layout_height="40dp">
<ImageView <ImageView
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:src="@mipmap/icon_zhenggu" /> android:src="@mipmap/icon_zhenggu" />
<TextView
android:id="@+id/red_menu"
android:layout_width="6dp"
android:layout_height="6dp"
android:layout_marginTop="5dp"
android:layout_alignParentEnd="true"
android:background="@drawable/live_room_menu_red"
android:gravity="center"
android:includeFontPadding="false"
android:minWidth="14dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:textColor="#fff"
android:textSize="10sp"
android:translationY="-4dp"
android:visibility="gone" />
</RelativeLayout>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1353,11 +1353,11 @@ Limited ride And limited avatar frame</string>
<string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string> <string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string>
<string name="interactive_game_search_room_bhe_game">Noonly enter the game</string> <string name="interactive_game_search_room_bhe_game">Noonly enter the game</string>
<string name="interactive_game_rooms_oin">There are currently no rooms to join</string> <string name="interactive_game_rooms_oin">There are currently no rooms to join</string>
<string name="prank_switch">Turntable prank switch</string> <string name="prank_switch">Turntable Trick Switch</string>
<string name="see_the_contents_of">After closing, all users will not be able to see the contents of the turntable</string> <string name="see_the_contents_of">After turning it on, all users will not be able to see the content of the carousel.</string>
<string name="diamonds_every_time">The turntable consumes diamonds every time</string> <string name="diamonds_every_time">Each turn of the wheel consumes diamonds</string>
<string name="diamonds_every_time_requirement_of">Minimum requirement of 1000 diamonds</string> <string name="diamonds_every_time_requirement_of">Starting with at least 1000 diamonds</string>
<string name="diamonds_every_time_requirement_of_hint">Fill in the content of the prankFill in a minimum of 2 words and a maximum of 10 words</string> <string name="diamonds_every_time_requirement_of_hint">Choose a gift</string>
<string name="prank_content_yet_hint">You have not set up the prank content yet</string> <string name="prank_content_yet_hint">You have not set up the prank content yet</string>
<string name="choose_a_prank_gift">Choose a prank gift</string> <string name="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string> <string name="choose_a_prank_gift_hint">Enter the prank content...</string>

View File

@ -1499,5 +1499,6 @@
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string> <string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string> <string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
<string name="main_type_theater">短劇</string> <string name="main_type_theater">短劇</string>
<string name="prank_complete">完成*1</string>
<string name="pking_over">主播正在PK稍後再試</string> <string name="pking_over">主播正在PK稍後再試</string>
</resources> </resources>

View File

@ -1498,5 +1498,6 @@
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string> <string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string> <string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
<string name="main_type_theater">短劇</string> <string name="main_type_theater">短劇</string>
<string name="prank_complete">完成*1</string>
<string name="pking_over">主播正在PK稍後再試</string> <string name="pking_over">主播正在PK稍後再試</string>
</resources> </resources>

View File

@ -1495,6 +1495,7 @@
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string> <string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string> <string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
<string name="main_type_theater">短劇</string> <string name="main_type_theater">短劇</string>
<string name="prank_complete">完成*1</string>
<string name="pking_over">主播正在PK稍後再試</string> <string name="pking_over">主播正在PK稍後再試</string>
</resources> </resources>

View File

@ -1356,11 +1356,11 @@ Limited ride And limited avatar frame</string>
<string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string> <string name="interactive_game_search_room_broadcast_room">Whether to enter the live broadcast room</string>
<string name="interactive_game_search_room_bhe_game">Noonly enter the game</string> <string name="interactive_game_search_room_bhe_game">Noonly enter the game</string>
<string name="interactive_game_rooms_oin">There are currently no rooms to join</string> <string name="interactive_game_rooms_oin">There are currently no rooms to join</string>
<string name="prank_switch">Turntable prank switch</string> <string name="prank_switch">Turntable Trick Switch</string>
<string name="see_the_contents_of">After closing, all users will not be able to see the contents of the turntable</string> <string name="see_the_contents_of">After turning it on, all users will not be able to see the content of the carousel.</string>
<string name="diamonds_every_time">The turntable consumes diamonds every time</string> <string name="diamonds_every_time">Each turn of the wheel consumes diamonds</string>
<string name="diamonds_every_time_requirement_of">Minimum requirement of 1000 diamonds</string> <string name="diamonds_every_time_requirement_of">Starting with at least 1000 diamonds</string>
<string name="diamonds_every_time_requirement_of_hint">Fill in the content of the prankFill in a minimum of 2 words and a maximum of 10 words</string> <string name="diamonds_every_time_requirement_of_hint">Choose a gift</string>
<string name="prank_content_yet_hint">You have not set up the prank content yet</string> <string name="prank_content_yet_hint">You have not set up the prank content yet</string>
<string name="choose_a_prank_gift">Choose a prank gift</string> <string name="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string> <string name="choose_a_prank_gift_hint">Enter the prank content...</string>
@ -1505,4 +1505,5 @@ Limited ride And limited avatar frame</string>
<string name="dragon_rule7">3.The final interpretation of this activity belongs to PDLIVE.</string> <string name="dragon_rule7">3.The final interpretation of this activity belongs to PDLIVE.</string>
<string name="main_type_theater" >Theater</string> <string name="main_type_theater" >Theater</string>
<string name="pking_over">The anchor is in PK, please try again later</string> <string name="pking_over">The anchor is in PK, please try again later</string>
<string name="prank_complete">once</string>
</resources> </resources>

View File

@ -131,4 +131,10 @@
<item name="android:activityCloseEnterAnimation">@anim/out_to_right_abit</item> <item name="android:activityCloseEnterAnimation">@anim/out_to_right_abit</item>
<item name="android:activityCloseExitAnimation">@anim/out_to_right</item> <item name="android:activityCloseExitAnimation">@anim/out_to_right</item>
</style> </style>
<style name="PrankTabLayoutTextStyle" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
<item name="android:textAllCaps">false</item>
</style>
</resources> </resources>

View File

@ -9,9 +9,11 @@ ext {
] ]
manifestPlaceholders = [ manifestPlaceholders = [
// //
serverHost : "https://napi.yaoulive.com", // serverHost : "https://napi.yaoulive.com",
// //
// serverHost : "https://ceshi.yaoulive.com", serverHost : "https://ceshi.yaoulive.com",
buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")),
buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")), buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")),

View File

@ -771,13 +771,15 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
mLiveSwLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1); mLiveSwLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1);
pr = new pkRunnable(pkUid, pkhead, pkname, isLadders); pr = new pkRunnable(pkUid, pkhead, pkname, isLadders);
mHandler.postDelayed(pr, 4000);//3秒后执行Runnable中的run方法 mHandler.postDelayed(pr, 4000);//3秒后执行Runnable中的run方法
mLiveRoomViewHolder.initAnchorSay();
mLiveRoomViewHolder.closePrankView();
} }
} else { } else {
if (mLiveRyLinkMicPkPresenter != null && mLiveRoomViewHolder != null) { if (mLiveRyLinkMicPkPresenter != null && mLiveRoomViewHolder != null) {
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1); mLiveRyLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1);
pr = new pkRunnable(pkUid, pkhead, pkname, isLadders); pr = new pkRunnable(pkUid, pkhead, pkname, isLadders);
mHandler.postDelayed(pr, 4000);//3秒后执行Runnable中的run方法 mHandler.postDelayed(pr, 4000);//3秒后执行Runnable中的run方法
mLiveRoomViewHolder.closePrankView();
} }
} }
} }

View File

@ -1057,6 +1057,11 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
} }
@Override
public void onUpdatePrankProgress(String prankString) {
}
/** /**
* 腾讯sdk连麦时候主播混流 * 腾讯sdk连麦时候主播混流
*/ */

View File

@ -618,6 +618,11 @@ public class LiveAudienceActivity extends LiveActivity {
manager.prankTurntable(msgtype, time, jsonObject); manager.prankTurntable(msgtype, time, jsonObject);
} }
@Override
public void onUpdatePrankProgress(String prankString) {
}
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (manager != null && manager.getsudGameMin()) { if (manager != null && manager.getsudGameMin()) {

View File

@ -266,7 +266,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mContainerWrap = (ViewGroup) findViewById(R.id.container_wrap); mContainerWrap = (ViewGroup) findViewById(R.id.container_wrap);
mContainer = (ViewGroup) findViewById(R.id.container); mContainer = (ViewGroup) findViewById(R.id.container);
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer); mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer);
RandomPkManager.getInstance().addOnRandomPkTimer(onRandomPkTimer); RandomPkManager.getInstance().addOnRandomPkTimer(onRandomPkTimer);
//添加开播前设置控件 //添加开播前设置控件
@ -298,8 +297,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
ToastUtil.show(mContext.getString(R.string.live_push_failed)); ToastUtil.show(mContext.getString(R.string.live_push_failed));
} }
}); });
} }
private void initFaceManager() { private void initFaceManager() {
@ -378,8 +375,17 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
case Constants.LIVE_FUNC_ZG://zg case Constants.LIVE_FUNC_ZG://zg
// ToastUtil.show("開發中,敬請期待"); // ToastUtil.show("開發中,敬請期待");
LivePrankDialogFragment fragment = new LivePrankDialogFragment(); LivePrankDialogFragment fragment = new LivePrankDialogFragment();
fragment.setOnPrankResultListener(new LivePrankDialogFragment.onPrankResultListener() {
@Override
public void OpenAndCloseListener() {
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress(1);
}
}
});
fragment.setmLiveUid(mLiveUid); fragment.setmLiveUid(mLiveUid);
fragment.show(getSupportFragmentManager(), "LivePrankDialogFragment"); fragment.show(getSupportFragmentManager(), "LivePrankDialogFragment");
mLiveAnchorViewHolder.closeMenuRed();
break; break;
case Constants.LIVE_FUNC_MIC://語音 case Constants.LIVE_FUNC_MIC://語音
//ToastUtil.show("開發中,敬請期待"); //ToastUtil.show("開發中,敬請期待");
@ -698,6 +704,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
bundle.putBoolean("isPk", isDRPK == 1 || PKing || mLivePushViewHolder.isPking()); bundle.putBoolean("isPk", isDRPK == 1 || PKing || mLivePushViewHolder.isPking());
bundle.putLong("liveTime", mLiveAnchorViewHolder.getmAnchorLiveTime()); bundle.putLong("liveTime", mLiveAnchorViewHolder.getmAnchorLiveTime());
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen()); bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
bundle.putBoolean("isShowZgRed",mLiveAnchorViewHolder.isShowMenuRed());
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.setFunctionClickListener(this); fragment.setFunctionClickListener(this);
fragment.show(getSupportFragmentManager(), "LiveFunctionDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveFunctionDialogFragment");
@ -806,6 +813,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRoomViewHolder.initAnchorSay(); mLiveRoomViewHolder.initAnchorSay();
mLiveRoomViewHolder.setGiftWall(obj.getString("gift_wall_lighten_number"), obj.getString("gift_wall_lighten_total")); mLiveRoomViewHolder.setGiftWall(obj.getString("gift_wall_lighten_number"), obj.getString("gift_wall_lighten_total"));
} }
mLiveRyLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
if (mLiveAnchorViewHolder == null) { if (mLiveAnchorViewHolder == null) {
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer); mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);
mLiveAnchorViewHolder.setLiveBean(mLiveBean); mLiveAnchorViewHolder.setLiveBean(mLiveBean);
@ -871,6 +879,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
getAiRobotStatus(); getAiRobotStatus();
MicedUserManager.get().removeAllMicUserList(); MicedUserManager.get().removeAllMicUserList();
MicUserManager.get().removeAllMicUserList(); MicUserManager.get().removeAllMicUserList();
//加载整蛊
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress(2);
mLiveRoomViewHolder.sendMsgPrank();
}
} }
/** /**
@ -1455,6 +1468,13 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
} }
} }
@Override
public void onUpdatePrankProgress(String prankString) {
if (mLiveRoomViewHolder != null){
mLiveRoomViewHolder.refreshPrank(prankString);
}
}
/** /**
* 腾讯sdk连麦时候主播混流 * 腾讯sdk连麦时候主播混流

View File

@ -25,7 +25,6 @@ import android.widget.ImageView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
@ -246,7 +245,6 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
mContainerWrap = (ViewGroup) findViewById(R.id.container_wrap); mContainerWrap = (ViewGroup) findViewById(R.id.container_wrap);
mContainer = (ViewGroup) findViewById(R.id.container); mContainer = (ViewGroup) findViewById(R.id.container);
mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer); mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer);
RandomPkManager.getInstance().addOnRandomPkTimer(onRandomPkTimer); RandomPkManager.getInstance().addOnRandomPkTimer(onRandomPkTimer);
manager.setOnMirrorChanged(new FaceManager.OnMirrorChanged() { manager.setOnMirrorChanged(new FaceManager.OnMirrorChanged() {
@ -366,8 +364,17 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
case Constants.LIVE_FUNC_ZG://zg case Constants.LIVE_FUNC_ZG://zg
// ToastUtil.show("開發中,敬請期待"); // ToastUtil.show("開發中,敬請期待");
LivePrankDialogFragment fragment = new LivePrankDialogFragment(); LivePrankDialogFragment fragment = new LivePrankDialogFragment();
fragment.setOnPrankResultListener(new LivePrankDialogFragment.onPrankResultListener() {
@Override
public void OpenAndCloseListener() {
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress(1);
}
}
});
fragment.setmLiveUid(mLiveUid); fragment.setmLiveUid(mLiveUid);
fragment.show(getSupportFragmentManager(), "LivePrankDialogFragment"); fragment.show(getSupportFragmentManager(), "LivePrankDialogFragment");
mLiveAnchorViewHolder.closeMenuRed();
break; break;
case Constants.LIVE_FUNC_MIC://語音 case Constants.LIVE_FUNC_MIC://語音
//ToastUtil.show("開發中,敬請期待"); //ToastUtil.show("開發中,敬請期待");
@ -692,6 +699,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
bundle.putBoolean("isPk", isDRPK == 1 || PKing || mLivePushViewHolder.isPking()); bundle.putBoolean("isPk", isDRPK == 1 || PKing || mLivePushViewHolder.isPking());
bundle.putLong("liveTime", mLiveAnchorViewHolder.getmAnchorLiveTime()); bundle.putLong("liveTime", mLiveAnchorViewHolder.getmAnchorLiveTime());
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen()); bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
bundle.putBoolean("isShowZgRed",mLiveAnchorViewHolder.isShowMenuRed());
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.setFunctionClickListener(this); fragment.setFunctionClickListener(this);
fragment.show(getSupportFragmentManager(), "LiveFunctionDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveFunctionDialogFragment");
@ -865,6 +873,12 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
getAiRobotStatus(); getAiRobotStatus();
MicedUserManager.get().removeAllMicUserList(); MicedUserManager.get().removeAllMicUserList();
MicUserManager.get().removeAllMicUserList(); MicUserManager.get().removeAllMicUserList();
//加载整蛊
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress(2);
mLiveRoomViewHolder.sendMsgPrank();
}
mLiveSwLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
} }
/** /**
@ -1472,6 +1486,13 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
} }
} }
@Override
public void onUpdatePrankProgress(String prankString) {
if (mLiveRoomViewHolder != null){
mLiveRoomViewHolder.refreshPrank(prankString);
}
}
/** /**
* 腾讯sdk连麦时候主播混流 * 腾讯sdk连麦时候主播混流

View File

@ -0,0 +1,76 @@
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.bean.PrankProgressBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.live.R;
import java.util.ArrayList;
import java.util.List;
public class ComboAdapter extends RecyclerView.Adapter<ComboAdapter.MyViewHolder>{
private List<PrankProgressBean.PrankList> mList = new ArrayList<>();
private Context mContext;
public ComboAdapter(Context context){
mContext = context;
}
public void setList(List<PrankProgressBean.PrankList> list){
mList.clear();
mList.addAll(list);
notifyDataSetChanged();
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new MyViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_combo_vote, parent, false));
}
@Override
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
PrankProgressBean.PrankList data = mList.get(position);
holder.itemView.setOnClickListener(v-> onItemClickListener.onItemClick(v,data.getGift_id()));
holder.combo_item_prank_name.setText(data.getPrank_content());
ImgLoader.display(mContext,data.getGift_icon(),holder.combo_item_icon);
holder.combo_item_combo.setText(String.valueOf(data.getSend_num()));
}
@Override
public int getItemCount() {
return mList.size();
}
class MyViewHolder extends RecyclerView.ViewHolder{
private TextView combo_item_prank_name,combo_item_combo;
private ImageView combo_item_icon;
public MyViewHolder(@NonNull View itemView){
super(itemView);
combo_item_prank_name = itemView.findViewById(R.id.combo_item_prank_name);
combo_item_combo = itemView.findViewById(R.id.combo_item_combo);
combo_item_icon = itemView.findViewById(R.id.combo_item_icon);
}
}
private OnItemClickListener onItemClickListener;
public interface OnItemClickListener {
void onItemClick(View view,int giftId);
}
public void addOnItemClickListener(OnItemClickListener onItemClickListener){
this.onItemClickListener = onItemClickListener;
}
}

View File

@ -42,6 +42,7 @@ public class FrameGiftAdapter extends RecyclerView.Adapter {
if (!TextUtils.isEmpty(wishGiftId) && TextUtils.equals(giftJson.get(position).getId() + "", wishGiftId)) { if (!TextUtils.isEmpty(wishGiftId) && TextUtils.equals(giftJson.get(position).getId() + "", wishGiftId)) {
Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(giftJson.get(position))); Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(giftJson.get(position)));
wishGiftId = null;
} }
FrameGiftViewHolder frameGiftViewHolder = (FrameGiftViewHolder) holder; FrameGiftViewHolder frameGiftViewHolder = (FrameGiftViewHolder) holder;

View File

@ -146,31 +146,13 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
if (code == 0 && info.length > 0) { if (code == 0 && info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]); JSONObject obj = JSON.parseObject(info[0]);
if (obj != null) { if (obj != null) {
if (TextUtils.equals(obj.getString("ispk"), "0")) {//自己不在PK可以发起邀请 if(mDrPkNum!=-1){
LiveHttpUtil.getMicList(liveUid, 0, new com.yunbao.common.http.HttpCallback() { LiveHttpUtil.getMicList(liveUid, 0, new com.yunbao.common.http.HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
System.out.println("code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info)); System.out.println("code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info));
//非0认为未开通连麦权限 //非0认为未开通连麦权限
if (code != 0) { if (code != 0) {
if (mDrPkNum == -1) {
if (WordUtil.isNewZh()) {
ToastUtil.show("邀请 " + bean.getUserNiceName() + " 发送成功");
} else {
ToastUtil.show("invite " + bean.getUserNiceName() + " successful");
}
mOnItemClickListener.onItemClick(bean, -1);
if(mContext instanceof LiveSwAnchorActivity){
((LiveSwAnchorActivity) mContext).linkMicAnchorApply(bean.getId(), bean.getId(),
false);
}else{
((LiveRyAnchorActivity) mContext).linkMicAnchorApply(bean.getId(), bean.getId(),
((LiveRyAnchorActivity) mContext).buildLinkMicJSON().toString()
);
}
return;
}
if (mDrPkNum <= 0) { if (mDrPkNum <= 0) {
if (WordUtil.isNewZh()) { if (WordUtil.isNewZh()) {
ToastUtil.show("多人次數已用完"); ToastUtil.show("多人次數已用完");
@ -202,6 +184,39 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
} }
} }
}); });
}else{
if (TextUtils.equals(obj.getString("ispk"), "0")) {//自己不在PK可以发起邀请
LiveHttpUtil.getMicList(liveUid, 0, new com.yunbao.common.http.HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
System.out.println("code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info));
//非0认为未开通连麦权限
if (code != 0) {
if (mDrPkNum == -1) {
if (WordUtil.isNewZh()) {
ToastUtil.show("邀请 " + bean.getUserNiceName() + " 发送成功");
} else {
ToastUtil.show("invite " + bean.getUserNiceName() + " successful");
}
mOnItemClickListener.onItemClick(bean, -1);
if(mContext instanceof LiveSwAnchorActivity){
((LiveSwAnchorActivity) mContext).linkMicAnchorApply(bean.getId(), bean.getId(),
false);
}else{
((LiveRyAnchorActivity) mContext).linkMicAnchorApply(bean.getId(), bean.getId(),
((LiveRyAnchorActivity) mContext).buildLinkMicJSON().toString()
);
}
}
} else {
if (WordUtil.isNewZh()) {
ToastUtil.show("請先關閉語音連麥");
} else {
ToastUtil.show("Please disable the voice connection first");
}
}
}
});
}else{ }else{
if (WordUtil.isNewZh()) { if (WordUtil.isNewZh()) {
ToastUtil.show("請先關閉PK"); ToastUtil.show("請先關閉PK");
@ -212,6 +227,7 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
} }
} }
} }
}
}); });

View File

@ -0,0 +1,79 @@
package com.yunbao.live.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.live.R;
import java.util.ArrayList;
import java.util.List;
public class ItemLivePrankGiftNumberAdapter extends RecyclerView.Adapter<ItemLivePrankGiftNumberAdapter.ViewHolder> {
List<Integer> list = new ArrayList<>();
int selectNumber;
OnSelectNumberListener onSelectNumberListener;
public void setOnSelectNumberListener(OnSelectNumberListener onSelectNumberListener) {
this.onSelectNumberListener = onSelectNumberListener;
}
public void setSelectNumber(int selectNumber) {
this.selectNumber = selectNumber;
}
public int getSelectNumber() {
return selectNumber;
}
public void setList(List<Integer> list) {
this.list = list;
notifyDataSetChanged();
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_prank_dialog_add_gift_number, parent, false));
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.setData(list.get(position), selectNumber);
}
@Override
public int getItemCount() {
return list.size();
}
public interface OnSelectNumberListener {
void onSelectNumber(int number);
}
public class ViewHolder extends RecyclerView.ViewHolder {
private Button button;
public ViewHolder(@NonNull View itemView) {
super(itemView);
button = itemView.findViewById(R.id.coin);
}
public void setData(int number, int selectNumber) {
button.setText(String.valueOf(number));
if (number == selectNumber) {
button.setBackgroundResource(R.drawable.bg_prank_btn_gift_add_number);
} else {
button.setBackgroundResource(R.drawable.bg_prank_coin);
}
button.setOnClickListener(view -> {
ItemLivePrankGiftNumberAdapter.this.selectNumber = number;
notifyDataSetChanged();
});
}
}
}

View File

@ -6,6 +6,8 @@ import static com.yunbao.live.bean.LiveChatBean.LUCKY_ANGEL;
import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY; import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY;
import static com.yunbao.live.bean.LiveChatBean.STAR_CHALLENGE_UPGRADE_NOTIFY; import static com.yunbao.live.bean.LiveChatBean.STAR_CHALLENGE_UPGRADE_NOTIFY;
import static com.yunbao.live.bean.LiveChatBean.SYSTEM3_COLOR; import static com.yunbao.live.bean.LiveChatBean.SYSTEM3_COLOR;
import static com.yunbao.live.bean.LiveChatBean.TYPE_TO_ANCHOR_PRANK;
import static com.yunbao.live.bean.LiveChatBean.TYPE_TO_ANCHOR_PRANK_GIFT;
import static com.yunbao.live.bean.LiveChatBean.TYPE_TO_USER_MSG; import static com.yunbao.live.bean.LiveChatBean.TYPE_TO_USER_MSG;
import static com.yunbao.live.bean.LiveChatBean.WISH_LIST_PROGRESS; import static com.yunbao.live.bean.LiveChatBean.WISH_LIST_PROGRESS;
import static com.yunbao.live.bean.LiveChatBean.XYD_COMPLETE; import static com.yunbao.live.bean.LiveChatBean.XYD_COMPLETE;
@ -219,6 +221,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
LinearLayoutCompat attentionLayout; LinearLayoutCompat attentionLayout;
ClipPathCircleImage clipImage2; ClipPathCircleImage clipImage2;
LinearLayoutCompat prank_open_live_layout;
TextView prank_open_live_msg;
TextView prank_to_setting;
public Vh(View itemView) { public Vh(View itemView) {
super(itemView); super(itemView);
mBg = (LinearLayout) itemView.findViewById(R.id.bg); mBg = (LinearLayout) itemView.findViewById(R.id.bg);
@ -245,6 +251,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
btnAttention = (ImageView) itemView.findViewById(R.id.btn_attention); btnAttention = (ImageView) itemView.findViewById(R.id.btn_attention);
textLeave = (ImageView) itemView.findViewById(R.id.text_leave); textLeave = (ImageView) itemView.findViewById(R.id.text_leave);
prank_open_live_layout = itemView.findViewById(R.id.prank_open_live_layout);
prank_open_live_msg = itemView.findViewById(R.id.prank_open_live_msg);
prank_to_setting = itemView.findViewById(R.id.prank_to_setting);
} }
void setData(final LiveChatBean bean, int position) { void setData(final LiveChatBean bean, int position) {
@ -255,9 +265,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
Bus.get().post(new LiveAudienceEvent() Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.INPUT_DIALOG) .setType(LiveAudienceEvent.LiveAudienceType.INPUT_DIALOG)
.setOlineUserlistModel(new OlineUserlistModel().setId(bean.getId()).setUserNicename(bean.getUserNiceName()))); .setOlineUserlistModel(new OlineUserlistModel().setId(bean.getId()).setUserNicename(bean.getUserNiceName())));
} }
Log.e("eqwewqeweq", bean.toString()); Log.e("eqwewqeweq", bean.toString());
return true; return true;
} }
@ -521,6 +529,28 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
if (!StringUtil.isEmpty(bean.getBubble())) { if (!StringUtil.isEmpty(bean.getBubble())) {
new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1); new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
} }
} else if(bean.getType() == TYPE_TO_ANCHOR_PRANK){
/*String str1 = "<font color='#ff1a1a'>娛樂整蠱</font>";
String str2 = "<font color='#0d0d0d'>全新升級,快去設置整蠱内容,給直播間增加更多趣味吧!</font>";
String str3 = "<font color='#3384ff'>>>立即前往>></font>";
mTextView.setText(Html.fromHtml(str1+str2+str3));
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);*/
LinearLayout.LayoutParams params3 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params3.setMargins(0, 8, DpUtil.dp2px(80), 8);
params3.gravity = Gravity.CENTER_VERTICAL;
mBg.setLayoutParams(params3);
prank_open_live_layout.setVisibility(View.VISIBLE);
}else if(bean.getType() == TYPE_TO_ANCHOR_PRANK_GIFT){
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("<font color='#ffffff'>"+(WordUtil.isNewZh()?"整蠱來了!":"Tricky is coming")+"</font>");
stringBuffer.append(" <font color='#ECB238'>"+bean.getUserNiceName()+"</font>");
stringBuffer.append("<font color='#ffffff'>"+(WordUtil.isNewZh()?"送出":"send")+""+bean.getGiftName()+"*"+bean.getHot_num()+"】</font>");
stringBuffer.append("<font color='#ffffff'>"+(WordUtil.isNewZh()?"主播需完成":",and the anchor needs to complete ")+"</font>");
stringBuffer.append( "<font color='#ECB238'>【"+bean.getContent()+"】</font>");
mTextView.setText(Html.fromHtml(stringBuffer.toString()));
new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1);
}else{ }else{
if (bean.getBubble() != null && !bean.getBubble().equals("")) { if (bean.getBubble() != null && !bean.getBubble().equals("")) {
//加载.9图聊天气泡 //加载.9图聊天气泡

View File

@ -11,6 +11,7 @@ import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.event.LiveGiftItemEvent; import com.yunbao.live.event.LiveGiftItemEvent;
import com.yunbao.live.event.LiveParcelItemRefreshEvent;
import com.yunbao.live.views.LiveParcelItemViewHolder; import com.yunbao.live.views.LiveParcelItemViewHolder;
import java.util.ArrayList; import java.util.ArrayList;
@ -56,9 +57,11 @@ public class LiveParcelItemAdapter extends RecyclerView.Adapter {
notifyDataSetChanged(); notifyDataSetChanged();
} }
public void refreshWrapListAfterSend(LiveGiftBean model) { public void refreshWrapListAfterSend(LiveParcelItemRefreshEvent refreshEvent) {
LiveGiftBean liveGiftBean = refreshEvent.getLiveGiftModel();
int sendCount = refreshEvent.getSendCount();//赠送礼物数量
for (int i = 0; i < giftJson.size(); i++) { for (int i = 0; i < giftJson.size(); i++) {
if (giftJson.get(i).getId() == model.getId()) { if (giftJson.get(i).getId() == liveGiftBean.getId()) {
String giftNum = giftJson.get(i).getGiftNum(); String giftNum = giftJson.get(i).getGiftNum();
@ -70,10 +73,11 @@ public class LiveParcelItemAdapter extends RecyclerView.Adapter {
number = 0; number = 0;
} }
if (number == 1) { if (number == 1) {
//如果礼物只剩一个直接移除礼物
giftJson.remove(i); giftJson.remove(i);
} else { } else {
giftJson.get(i).setGiftNum(String.valueOf(number - 1)); //设置送礼后的礼物数量
giftJson.get(i).setGiftNum(String.valueOf(number - sendCount));
} }
} }
} }

View File

@ -1,5 +1,6 @@
package com.yunbao.live.adapter; package com.yunbao.live.adapter;
import android.annotation.SuppressLint;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -17,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
@ -107,7 +109,6 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
private ImageView mIcon; private ImageView mIcon;
private TextView mTitle; private TextView mTitle;
private TextView mName; private TextView mName;
private TextView mNum;
private ImageView mRemove; private ImageView mRemove;
public GiftViewHolder(View itemView) { public GiftViewHolder(View itemView) {
@ -115,21 +116,19 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
mIcon = itemView.findViewById(R.id.gift_icon); mIcon = itemView.findViewById(R.id.gift_icon);
mTitle = itemView.findViewById(R.id.gift_title); mTitle = itemView.findViewById(R.id.gift_title);
mName = itemView.findViewById(R.id.gift_name); mName = itemView.findViewById(R.id.gift_name);
mNum = itemView.findViewById(R.id.gift_num);
mRemove = itemView.findViewById(R.id.gift_close); mRemove = itemView.findViewById(R.id.gift_close);
mRemove.setOnClickListener(v -> { mRemove.setOnClickListener(v -> {
PrankGiftBean bean = (PrankGiftBean) v.getTag(); PrankGiftBean bean = (PrankGiftBean) v.getTag();
onItemClickListener.onItemClick(bean.getGiftId(), (Integer) itemView.getTag()); onItemClickListener.onItemClick(bean.getGiftId(), (Integer) itemView.getTag());
}); });
} }
@SuppressLint("SetTextI18n")
public void setDate(PrankGiftBean bean, int position) { public void setDate(PrankGiftBean bean, int position) {
ImgLoader.display(mContext, bean.getIcon(), mIcon); ImgLoader.display(mContext, bean.getIcon(), mIcon);
itemView.setTag(position); itemView.setTag(position);
mName.setText(bean.getName()); mName.setText(bean.getName());
mTitle.setText(bean.getTitle()); mTitle.setText(bean.getTitle());
mNum.setText(bean.getNum() + "");
mRemove.setTag(bean); mRemove.setTag(bean);
} }
@ -148,11 +147,11 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
context = itemView.findViewById(R.id.prank_turntable_val); context = itemView.findViewById(R.id.prank_turntable_val);
context.setOnClickListener(v -> { context.setOnClickListener(v -> {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
DialogUitl.showSimpleInputDialog(mContext, "填寫整蠱內容", DialogUitl.INPUT_TYPE_TEXT, 10, new DialogUitl.SimpleCallback() { DialogUitl.showSimpleInputDialog(mContext, WordUtil.isNewZh() ? "填寫整蠱內容" : "prank content", DialogUitl.INPUT_TYPE_TEXT, 10, new DialogUitl.SimpleCallback() {
@Override @Override
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
if (WordUtil.isSpecialChar(content)) { if (WordUtil.isSpecialChar(content)) {
ToastUtil.show("整蠱內容不能包含特殊字符"); ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容不能包含特殊字符" : "The prank content must not contain special characters");
return; return;
} }
if (content.length() >= 2 && content.length() <= 10) { if (content.length() >= 2 && content.length() <= 10) {
@ -205,10 +204,38 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
probability.setText(getProbability(bean.getId(), mContext)); probability.setText(getProbability(bean.getId(), mContext));
context.setText(bean.getContext()); context.setText(bean.getContext());
if (StringUtil.isEmpty(context.getText().toString().trim())) {
String str = null;
switch (position) {
case 0:
str = WordUtil.isNewZh() ? "請輸入整蠱内容,例如:深情表白三分钟" : "For example: Confess affectionately for three minutes";
break;
case 1:
str = WordUtil.isNewZh() ? "請輸入整蠱内容,例如:唱一首拿手歌曲" : "For example: sing a favorite song";
break;
case 2:
str = WordUtil.isNewZh() ? "請輸入整蠱内容,例如:跳一支熱門舞蹈" : "For example: dance a popular dance";
break;
case 3:
str = WordUtil.isNewZh() ? "請輸入整蠱内容,例如:回答一次真心話" : "For example: answer the truth once";
break;
case 4:
str = WordUtil.isNewZh() ? "請輸入整蠱内容,例如:進行一次大冒險" : "For example: Go on a big adventure";
break;
case 5:
str = WordUtil.isNewZh() ? "請輸入整蠱内容,例如:其他擅長的才藝" : "For example: other talents that you are good at";
break;
default:
str = WordUtil.getNewString(R.string.diamonds_every_time_requirement_of_hint);
}
context.setText(null);
context.setHint(str);
}
itemView.setTag(position); itemView.setTag(position);
} }
private String getChineseNum(int id) { private String getChineseNum(int id) {
if(WordUtil.isNewZh()){
switch (id) { switch (id) {
case 1: case 1:
return ""; return "";
@ -223,6 +250,22 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
case 6: case 6:
return ""; return "";
} }
}else{
switch (id) {
case 1:
return " No. 1";
case 2:
return " No. 2";
case 3:
return " No. 3";
case 4:
return " No. 4";
case 5:
return " No. 5";
case 6:
return " No. 6";
}
}
return ""; return "";
} }
@ -245,17 +288,17 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
} else { } else {
switch (id) { switch (id) {
case 1: case 1:
return "Extraction probability40%"; return "Chance of extraction: 40%";
case 2: case 2:
return "Extraction probability30%"; return "Chance of extraction: 30%";
case 3: case 3:
return "Extraction probability15%"; return "Chance of extraction: 15%";
case 4: case 4:
return "Extraction probability10%"; return "Chance of extraction: 10%";
case 5: case 5:
return "Extraction probability4%"; return "Chance of extraction: 4%";
default: default:
return "Extraction probability1%"; return "Chance of extraction: 1%";
} }
} }

View File

@ -0,0 +1,170 @@
package com.yunbao.live.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.MarqueeTextView;
import com.yunbao.live.R;
import com.yunbao.live.views.LiveRoomViewHolder;
import java.util.ArrayList;
import java.util.List;
public class PrankAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private List<PrankProgressBean.PrankList> mList = new ArrayList<>();
private Context mContext;
private boolean isAn;
public static final int TYPE_GIFT = 1;
public static final int TYPE_COMBO = 2;
private int viewType1 = TYPE_GIFT;
public PrankAdapter(Context context){
mContext = context;
}
public void setViewType(int viewType) {
this.viewType1 = viewType;
}
public void setList(List<PrankProgressBean.PrankList> list){
mList.clear();
mList.addAll(list);
notifyDataSetChanged();
}
public void showAnView(List<PrankProgressBean.PrankList> list,boolean isAn){
this.isAn = isAn;
mList.clear();
mList.addAll(list);
notifyDataSetChanged();
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if (viewType1 ==TYPE_GIFT){
return new MyViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_prank_progress, parent, false));
}else{
return new MyComboViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_combo_vote, parent, false));
}
}
@SuppressLint("SetTextI18n")
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
PrankProgressBean.PrankList data = mList.get(position);
if(viewHolder instanceof MyViewHolder){
MyViewHolder holder = (MyViewHolder) viewHolder;
holder.itemView.setOnClickListener(v-> onItemClickListener.onItemClick(v,data.getGift_id()));
int completedNum = data.getCompleted_num();
if (completedNum>99){
holder.prank_item_subscript.setText("99+");
}else {
holder.prank_item_subscript.setText(String.valueOf(data.getCompleted_num()));
}
holder.prank_item_prank_name.setText(data.getPrank_content());
holder.prank_item_gift_name.setText(WordUtil.isNewZh() ? data.getGift_name() : data.getGift_name_en());
holder.prank_item_now_progress.setText(String.valueOf(data.getSend_num()));
holder.prank_item_total_progress.setText("/"+ data.getGift_num());
ImgLoader.display(mContext,data.getGift_icon(),holder.prank_item_icon);
holder.prank_item_progress.setMax(data.getGift_num());
holder.prank_item_progress.setProgress(data.getSend_num());
holder.an_prank_name.setText(data.getPrank_content());
holder.an_prank_remove.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onItemClickListener.onItemDel(data.getGift_id());
}
});
if(isAn){
holder.anLayout.setVisibility(View.VISIBLE);
holder.progressLayout.setVisibility(View.GONE);
holder.nameLayout.setVisibility(View.GONE);
}else{
holder.anLayout.setVisibility(View.GONE);
holder.progressLayout.setVisibility(View.VISIBLE);
holder.nameLayout.setVisibility(View.VISIBLE);
}
}else{
MyComboViewHolder holder = (MyComboViewHolder) viewHolder;
holder.itemView.setOnClickListener(v-> onItemClickListener.onItemClick(v,data.getGift_id()));
holder.combo_item_prank_name.setText(data.getPrank_content());
ImgLoader.display(mContext,data.getGift_icon(),holder.combo_item_icon);
holder.combo_item_combo.setText(String.valueOf(data.getSend_num()));
}
}
@Override
public int getItemCount() {
return mList.size();
}
class MyViewHolder extends RecyclerView.ViewHolder{
private TextView prank_item_subscript,prank_item_prank_name,prank_item_gift_name,prank_item_now_progress,prank_item_total_progress;
private ImageView prank_item_icon;
private ProgressBar prank_item_progress;
private LinearLayout anLayout;
private MarqueeTextView an_prank_name;
private TextView an_prank_remove;
private LinearLayout progressLayout;
private LinearLayout nameLayout;
public MyViewHolder(@NonNull View itemView) {
super(itemView);
prank_item_subscript = itemView.findViewById(R.id.prank_item_subscript);
prank_item_prank_name = itemView.findViewById(R.id.prank_item_prank_name);
prank_item_gift_name = itemView.findViewById(R.id.prank_item_gift_name);
prank_item_now_progress = itemView.findViewById(R.id.prank_item_now_progress);
prank_item_total_progress = itemView.findViewById(R.id.prank_item_total_progress);
prank_item_icon = itemView.findViewById(R.id.prank_item_icon);
prank_item_progress = itemView.findViewById(R.id.prank_item_progress);
nameLayout = itemView.findViewById(R.id.nameLayout);
progressLayout = itemView.findViewById(R.id.progressLayout);
//主播
anLayout = itemView.findViewById(R.id.anLayout);
an_prank_name = itemView.findViewById(R.id.an_prank_name);
an_prank_remove = itemView.findViewById(R.id.an_prank_remove);
}
}
class MyComboViewHolder extends RecyclerView.ViewHolder{
private TextView combo_item_prank_name,combo_item_combo;
private ImageView combo_item_icon;
public MyComboViewHolder(@NonNull View itemView){
super(itemView);
combo_item_prank_name = itemView.findViewById(R.id.combo_item_prank_name);
combo_item_combo = itemView.findViewById(R.id.combo_item_combo);
combo_item_icon = itemView.findViewById(R.id.combo_item_icon);
}
}
private OnItemClickListener onItemClickListener;
public interface OnItemClickListener {
void onItemClick(View view,int giftId);
void onItemDel(int giftId);
}
public void addOnItemClickListener(OnItemClickListener onItemClickListener){
this.onItemClickListener = onItemClickListener;
}
}

View File

@ -30,7 +30,8 @@ public class LiveChatBean {
public static final int WISH_LIST_PROGRESS = 307;//心愿单进度通知 public static final int WISH_LIST_PROGRESS = 307;//心愿单进度通知
public static final int BLIND_BOX = 409;//盲盒礼物消息 public static final int BLIND_BOX = 409;//盲盒礼物消息
public static final int TYPE_TO_USER_MSG = 500;//指定信息 public static final int TYPE_TO_USER_MSG = 500;//指定信息
public static final int TYPE_TO_ANCHOR_PRANK = 501;//整蠱-開播提示語
public static final int TYPE_TO_ANCHOR_PRANK_GIFT = 502;//整蠱-禮物
private String id; private String id;
private String userNiceName; private String userNiceName;
@ -68,6 +69,14 @@ public class LiveChatBean {
return WordUtil.isNewZh() ? giftName : giftname_en; return WordUtil.isNewZh() ? giftName : giftname_en;
} }
public String getGiftname_en() {
return giftname_en;
}
public void setGiftname_en(String giftname_en) {
this.giftname_en = giftname_en;
}
public LiveChatBean setGiftName(String giftName) { public LiveChatBean setGiftName(String giftName) {
this.giftName = giftName; this.giftName = giftName;
return this; return this;

View File

@ -702,7 +702,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
} }
isGetNewWrap = true; isGetNewWrap = true;
if (isWrap) { if (isWrap) {
Bus.get().post(new LiveParcelItemRefreshEvent().setLiveGiftModel(liveGiftModel)); //刷新包裹中的礼物数量
Bus.get().post(new LiveParcelItemRefreshEvent().setLiveGiftModel(liveGiftModel).setSendCount(Integer.parseInt(mCount)));
} }
} }
} else { } else {
@ -1380,9 +1381,10 @@ public class LiveGiftPopup extends AbsDialogFragment {
// //刷新包裹列表wrap_gift_num -1:表示数量没有变化 // //刷新包裹列表wrap_gift_num -1:表示数量没有变化
// mObjGiftSendback = obj; // mObjGiftSendback = obj;
isGetNewWrap = true; isGetNewWrap = true;
//是包裹里的礼物
if (isWrap) { if (isWrap) {
Bus.get().post(new LiveParcelItemRefreshEvent().setLiveGiftModel(liveGiftModel)); //刷新包裹中礼物的数量
Bus.get().post(new LiveParcelItemRefreshEvent().setLiveGiftModel(liveGiftModel).setSendCount(Integer.parseInt(mCount)));
} }
} }
} else if (code == 1007 && mGiftBean.getType() != 0) { } else if (code == 1007 && mGiftBean.getType() != 0) {

View File

@ -58,7 +58,10 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
private String liveUid; private String liveUid;
private TextView red_menu;
// boolean isRy = false; // boolean isRy = false;
private boolean isShowRed;
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
return R.layout.dialog_live_new_function; return R.layout.dialog_live_new_function;
@ -99,6 +102,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
// isRy = bundle.getBoolean("isRy", false); // isRy = bundle.getBoolean("isRy", false);
mAnchorLiveTime = bundle.getLong("liveTime"); mAnchorLiveTime = bundle.getLong("liveTime");
liveUid = bundle.getString("liveUid"); liveUid = bundle.getString("liveUid");
isShowRed = bundle.getBoolean("isShowZgRed");
} }
mWishView = findViewById(R.id.live_tool_wish); mWishView = findViewById(R.id.live_tool_wish);
mPrankView = findViewById(R.id.live_tool_prank); mPrankView = findViewById(R.id.live_tool_prank);
@ -111,6 +115,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mMicView = findViewById(R.id.live_tool_mic); mMicView = findViewById(R.id.live_tool_mic);
mRandomPk = findViewById(R.id.live_tool_random_pk); mRandomPk = findViewById(R.id.live_tool_random_pk);
mLiveTimeTextView = (TextView) findViewById(R.id.live_time); mLiveTimeTextView = (TextView) findViewById(R.id.live_time);
red_menu = (TextView) findViewById(R.id.red_menu);
mWishView.setOnClickListener(this); mWishView.setOnClickListener(this);
mPrankView.setOnClickListener(this); mPrankView.setOnClickListener(this);
mWksView.setOnClickListener(this); mWksView.setOnClickListener(this);
@ -141,6 +146,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mLiveRoomHandler = new LiveRoomHandler(); mLiveRoomHandler = new LiveRoomHandler();
mLiveTimeTextView.setText(StringUtil.getDurationText(mAnchorLiveTime)); mLiveTimeTextView.setText(StringUtil.getDurationText(mAnchorLiveTime));
startAnchorLiveTime(); startAnchorLiveTime();
red_menu.setVisibility(isShowRed?View.VISIBLE:View.GONE);
} }
public void setFunctionClickListener(LiveFunctionClickListener functionClickListener) { public void setFunctionClickListener(LiveFunctionClickListener functionClickListener) {
@ -169,6 +175,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mFunctionClickListener.onClick(LIVE_FUNC_WISHLIST); mFunctionClickListener.onClick(LIVE_FUNC_WISHLIST);
} else if (id == R.id.live_tool_prank) { } else if (id == R.id.live_tool_prank) {
mFunctionClickListener.onClick(LIVE_FUNC_ZG); mFunctionClickListener.onClick(LIVE_FUNC_ZG);
red_menu.setVisibility(View.GONE);
} else if (id == R.id.live_tool_wks) { } else if (id == R.id.live_tool_wks) {
mFunctionClickListener.onClick(LIVE_FUNC_WKS); mFunctionClickListener.onClick(LIVE_FUNC_WKS);
} else if (id == R.id.live_tool_beauty) { } else if (id == R.id.live_tool_beauty) {

View File

@ -0,0 +1,161 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import java.util.ArrayList;
import java.util.List;
public class LivePrankAddGiftDialog extends AbsDialogPopupWindow {
private TextView prankBtn;
private ImageView backBtn;
private TextView giftText;
private TextView numberText;
private EditText contentText;
private LinearLayout giftNumberLayout;
private boolean isShowGiftNumber = true;
private OnItemClickListener<PrankGiftBean> onItemClickListener;
private List<PrankGiftBean> giftBeans = new ArrayList<>();
public LivePrankAddGiftDialog(@NonNull Context context) {
super(context);
}
@Override
public void buildDialog(XPopup.Builder builder) {
builder.autoFocusEditText(false);
}
public LivePrankAddGiftDialog setGiftBeans(List<PrankGiftBean> giftBeans,boolean isShow) {
this.isShowGiftNumber = isShow;
this.giftBeans = giftBeans;
return this;
}
@Override
public int bindLayoutId() {
return R.layout.dialog_live_prank_add_gift;
}
@Override
protected void onCreate() {
super.onCreate();
initView();
}
public void setOnItemClickListener(OnItemClickListener<PrankGiftBean> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
void initView() {
prankBtn = findViewById(R.id.prank_btn);
backBtn = findViewById(R.id.back);
giftText = findViewById(R.id.gift_text);
numberText = findViewById(R.id.number_text);
contentText = findViewById(R.id.content_text);
giftNumberLayout= findViewById(R.id.giftNumberLayout);
if(isShowGiftNumber){
giftNumberLayout.setVisibility(VISIBLE);
}
ViewClicksAntiShake.clicksAntiShake(backBtn, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
}
});
ViewClicksAntiShake.clicksAntiShake(giftText, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
GiftPopDialog dialog = new GiftPopDialog(mContext, new GiftPopDialog.ActionListener() {
@Override
public void onSelectGift(PrankGiftBean bean) {
if (bean != null) {
giftText.setText(bean.getName());
/*ImgLoader.displayDrawable(mContext, bean.getIcon(), DpUtil.dp2px(16), DpUtil.dp2px(16), new ImgLoader.DrawableCallback() {
@Override
public void onLoadSuccess(Drawable drawable) {
giftText.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
}
@Override
public void onLoadFailed() {
}
});*/
giftText.setTag(bean);
}
}
@Override
public void onDismiss() {
}
});
dialog.setShowNumber(false);
dialog.setList(giftBeans);
dialog.showDialog();
}
});
ViewClicksAntiShake.clicksAntiShake(numberText, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
new LivePrankAddGiftNumberDialog(mContext)
.setOnItemClickListener(new OnItemClickListener<Integer>() {
@Override
public void onItemClick(Integer bean, int position) {
numberText.setText(String.valueOf(bean));
numberText.setTag(bean);
}
})
.showDialog();
}
});
ViewClicksAntiShake.clicksAntiShake(prankBtn, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
PrankGiftBean bean = (PrankGiftBean) giftText.getTag();
String prankContent = contentText.getText().toString();
if (bean == null) {
ToastUtil.show(WordUtil.isNewZh() ? "整蠱禮物不能為空" : "A trick gift can't be empty");
return;
}
if(isShowGiftNumber){
if (numberText.getTag()==null||StringUtil.isEmpty(prankContent)){
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容或數量不能為空" : "The content or number of pranks cannot be empty");
return;
}
bean.setNum(Integer.parseInt(numberText.getText().toString()));
}else{
if (StringUtil.isEmpty(prankContent)){
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容或數量不能為空" : "The content or number of pranks cannot be empty");
return;
}
}
bean.setTitle(prankContent);
onItemClickListener.onItemClick(bean,0);
dismiss();
}
});
}
}

View File

@ -0,0 +1,142 @@
package com.yunbao.live.dialog;
import android.app.Dialog;
import android.content.Context;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
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.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
import com.yunbao.live.adapter.ItemLivePrankGiftNumberAdapter;
import java.util.ArrayList;
import java.util.List;
public class LivePrankAddGiftNumberDialog extends AbsDialogPopupWindow {
private TextView prankBtn;
private ImageView backBtn;
private Button mBtnNumber;
private RecyclerView numberRecycler;
private ItemLivePrankGiftNumberAdapter mAdapter;
private OnItemClickListener<Integer> onItemClickListener;
private int giftNumber = -1;
private List<PrankGiftBean> giftBeans = new ArrayList<>();
public LivePrankAddGiftNumberDialog(@NonNull Context context) {
super(context);
}
public LivePrankAddGiftNumberDialog setOnItemClickListener(OnItemClickListener<Integer> onItemClickListener) {
this.onItemClickListener = onItemClickListener;
return this;
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_live_prank_add_gift_number;
}
@Override
protected void onCreate() {
super.onCreate();
initView();
initData();
}
@Override
protected void onDismiss() {
super.onDismiss();
}
void initView() {
prankBtn = findViewById(R.id.prank_btn);
backBtn = findViewById(R.id.back);
numberRecycler = findViewById(R.id.numberList);
mBtnNumber = findViewById(R.id.btnNumber);
mAdapter = new ItemLivePrankGiftNumberAdapter();
numberRecycler.setAdapter(mAdapter);
mAdapter.setOnSelectNumberListener(number -> {
if (number > 0) {
giftNumber = number;
mBtnNumber.setText(R.string.live_prank_gift_dialog_number_btn);
}
});
ViewClicksAntiShake.clicksAntiShake(mBtnNumber, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
DialogUitl.showSimpleInputDialog(mContext, WordUtil.isNewZh() ? "输入数量" : "Input number", DialogUitl.INPUT_TYPE_NUMBER,4, new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
try {
int number = Integer.parseInt(content);
if (number > 0 && number < 10000) {
mBtnNumber.setText(content);
giftNumber = number;
mAdapter.setSelectNumber(-1);
mAdapter.notifyDataSetChanged();
dialog.dismiss();
}
} catch (Exception e) {
e.printStackTrace();
mBtnNumber.setText(R.string.live_prank_gift_dialog_number_btn);
dialog.dismiss();
}
}
});
}
});
ViewClicksAntiShake.clicksAntiShake(prankBtn, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (onItemClickListener != null) {
if(mAdapter.getSelectNumber()==0){
ToastUtil.show(WordUtil.isNewZh()?"請輸入數量":"Please enter the quantity");
return;
}
if (mAdapter.getSelectNumber() > 0) {
giftNumber = mAdapter.getSelectNumber();
}
onItemClickListener.onItemClick(giftNumber, 0);
dismiss();
}
}
});
}
List<Integer> mList = new ArrayList<>();
void initData() {
mList.add(9999);
mList.add(3344);
mList.add(1314);
mList.add(520);
mList.add(88);
mList.add(68);
mList.add(10);
mList.add(8);
mList.add(1);
mAdapter.setList(mList);
}
}

View File

@ -1,20 +1,30 @@
package com.yunbao.live.dialog; package com.yunbao.live.dialog;
import static com.yunbao.live.adapter.LivePrankRecyclerAdapter.TYPE_TURNTABLE;
import android.annotation.SuppressLint;
import android.app.Dialog; import android.app.Dialog;
import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSONArray;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.bean.PrankGiftResultBean;
import com.yunbao.common.bean.PrankHttpTurntableBean; import com.yunbao.common.bean.PrankHttpTurntableBean;
import com.yunbao.common.bean.PrankTurntableBean; import com.yunbao.common.bean.PrankTurntableBean;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
@ -24,11 +34,18 @@ import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ViewUtils;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.adapter.LivePrankRecyclerAdapter; import com.yunbao.live.adapter.LivePrankRecyclerAdapter;
import com.yunbao.live.socket.SocketRyChatUtil;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -36,7 +53,7 @@ import java.util.Locale;
public class LivePrankDialogFragment extends AbsDialogFragment implements View.OnClickListener { public class LivePrankDialogFragment extends AbsDialogFragment implements View.OnClickListener {
private TabLayout mTabLayout; private TabLayout mTabLayout;
private View mTurntableConfigLayout; private View mTurntableConfigLayout, mGiftConfigLayout;
private TextView mPrankBtn; private TextView mPrankBtn;
private ImageView mTurntableConfigImageView; private ImageView mTurntableConfigImageView;
private TextView mCoinTextView; private TextView mCoinTextView;
@ -45,7 +62,22 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
private LivePrankRecyclerAdapter recyclerAdapter; private LivePrankRecyclerAdapter recyclerAdapter;
private String mLiveUid; private String mLiveUid;
private PrankHttpTurntableBean bean = new PrankHttpTurntableBean(); private PrankHttpTurntableBean bean = new PrankHttpTurntableBean();
private List<PrankGiftBean> giftBeans; private List<PrankGiftBean> giftBeans = new ArrayList<>();
private TextView giftSwitch1TitleText;
private TextView giftSwitch1DescText;
private ImageView giftSwitch1Btn;
private TextView giftTypeNowText;
private TextView giftTypeTodoText;
private TextView giftTypeNowSwitchText;
private Button mBtnAddGift;
private ImageView help;
private onPrankResultListener onPrankResultListener;
public void setOnPrankResultListener(LivePrankDialogFragment.onPrankResultListener onPrankResultListener) {
this.onPrankResultListener = onPrankResultListener;
}
public void setmLiveUid(String mLiveUid) { public void setmLiveUid(String mLiveUid) {
this.mLiveUid = mLiveUid; this.mLiveUid = mLiveUid;
@ -82,11 +114,14 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
initView(); initView();
initTab(); initTab();
initTurntableData(); initTurntableData();
initGiftConfigLayoutView();
} }
private void initView() { private void initView() {
help = (ImageView) findViewById(R.id.help);
mTabLayout = (TabLayout) findViewById(R.id.prank_tabLayout); mTabLayout = (TabLayout) findViewById(R.id.prank_tabLayout);
mTurntableConfigLayout = findViewById(R.id.turntable_layout); mTurntableConfigLayout = findViewById(R.id.turntable_layout);
mGiftConfigLayout = findViewById(R.id.gift_layout);
mTurntableConfigImageView = (ImageView) findViewById(R.id.switch1_btn); mTurntableConfigImageView = (ImageView) findViewById(R.id.switch1_btn);
mCoinTextView = (TextView) findViewById(R.id.switch2_btn); mCoinTextView = (TextView) findViewById(R.id.switch2_btn);
mPrankRecyclerView = (RecyclerView) findViewById(R.id.prank_config); mPrankRecyclerView = (RecyclerView) findViewById(R.id.prank_config);
@ -97,14 +132,19 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
mPrankRecyclerView.setAdapter(recyclerAdapter); mPrankRecyclerView.setAdapter(recyclerAdapter);
mCoinTextView.setOnClickListener(this); mCoinTextView.setOnClickListener(this);
mTurntableConfigImageView.setOnClickListener(this); mTurntableConfigImageView.setOnClickListener(this);
help.setOnClickListener(this);
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
mPrankBtn.setText("保存設置"); mPrankBtn.setText("發送圖標");
} else { } else {
mPrankBtn.setText("Save Settings"); mPrankBtn.setText("send icon");
} }
recyclerAdapter.setOnItemClickListener(new OnItemClickListener<String>() { recyclerAdapter.setOnItemClickListener(new OnItemClickListener<String>() {
@Override @Override
public void onItemClick(String bean, int position) { public void onItemClick(String bean, int position) {
if (position == -2) {
showGiftDialog();
return;
}
if (recyclerAdapter.getViewTypeOfList()) { if (recyclerAdapter.getViewTypeOfList()) {
switch (position) { switch (position) {
case 1: case 1:
@ -127,21 +167,20 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
break; break;
} }
} else { } else {
LiveNetManager.get(mContext).deletePrankGift(mLiveUid, position + "", new HttpCallback<PrankHttpTurntableBean>() { giftBeans.remove(position);
@Override recyclerAdapter.setList(giftBeans);
public void onSuccess(PrankHttpTurntableBean data) { recyclerAdapter.notifyDataSetChanged();
initGiftData(); if (giftBeans.size() < 6) {
mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE);
} else {
mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE);
} }
@Override
public void onError(String error) {
initGiftData();
}
});
} }
} }
}); });
mPrankBtn.setOnClickListener(view -> { /* mPrankBtn.setOnClickListener(view -> {
if ((int) view.getTag() == 1) { if ((int) view.getTag() == 1) {
if (giftBeans != null && giftBeans.size() >= 20) { if (giftBeans != null && giftBeans.size() >= 20) {
@ -173,6 +212,46 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} else { } else {
setPrankConfig(); setPrankConfig();
} }
});*/
ViewClicksAntiShake.clicksAntiShake(mPrankBtn, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (mPrankBtn.getTag() != null && Integer.parseInt(mPrankBtn.getTag().toString()) == 0) {
SocketRyChatUtil.sendPrankIcon();
} else {
showGiftDialog();
}
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_save), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if ((int) mPrankBtn.getTag() == 0) {
setPrankConfig(false);
} else {
setGiftBean(recyclerAdapter.getList(),"0");
}
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.btn_clear), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if ((int) mPrankBtn.getTag() == 0) {
clearPrankConfig();
setPrankConfig(true);
} else {
giftSwitch1Btn.setTag("false");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_off);
giftBeans = new ArrayList<>();
recyclerAdapter.setList(giftBeans);
recyclerAdapter.notifyDataSetChanged();
mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE);
setGiftBean(recyclerAdapter.getList(),"1");
}
ToastUtil.show(WordUtil.isNewZh()?"清空成功!":"Cleared successfully!");
}
}); });
mPrankBtn.setTag(0); mPrankBtn.setTag(0);
} }
@ -184,14 +263,14 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
turntable.setText("轉盤整蠱"); turntable.setText("轉盤整蠱");
gift.setText("禮物整蠱"); gift.setText("禮物整蠱");
} else { } else {
turntable.setText("Turntable prank"); turntable.setText("Turntable");
gift.setText("Gift prank"); gift.setText("Gift");
} }
turntable.setTag(0); turntable.setTag(0);
gift.setTag(1); gift.setTag(1);
mTabLayout.addTab(turntable); mTabLayout.addTab(turntable);
mTabLayout.addTab(gift); mTabLayout.addTab(gift);
mPrankBtn.setTag(0);
mTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { mTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override @Override
public void onTabSelected(TabLayout.Tab tab) { public void onTabSelected(TabLayout.Tab tab) {
@ -200,32 +279,39 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
if ((int) tab.getTag() == 0) { if ((int) tab.getTag() == 0) {
mTurntableConfigLayout.setVisibility(View.VISIBLE); mTurntableConfigLayout.setVisibility(View.VISIBLE);
mGiftConfigLayout.setVisibility(View.GONE);
mPrankRecyclerView.setVisibility(View.VISIBLE); mPrankRecyclerView.setVisibility(View.VISIBLE);
mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE); mGiftNotDate.setVisibility(View.GONE);
recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_TURNTABLE); recyclerAdapter.setViewType(TYPE_TURNTABLE);
mPrankBtn.setBackgroundResource(R.drawable.bg_live_prank_turntable_save); mPrankBtn.setBackgroundResource(R.drawable.bg_live_prank_turntable_save);
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
mPrankBtn.setText("保存設置"); mPrankBtn.setText("發送圖標");
} else { } else {
mPrankBtn.setText("Save Settings"); mPrankBtn.setText("send icon");
} }
mPrankBtn.setTag(0); mPrankBtn.setTag(0);
recyclerAdapter.clearList(); recyclerAdapter.clearList();
initTurntableData(); initTurntableData();
mPrankBtn.setVisibility(View.VISIBLE);
} else { } else {
mTurntableConfigLayout.setVisibility(View.GONE); mTurntableConfigLayout.setVisibility(View.GONE);
mPrankBtn.setBackgroundResource(R.drawable.bg_live_prank_gift_set); mGiftConfigLayout.setVisibility(View.VISIBLE);
mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE);
recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_GIFT);
mPrankBtn.setBackgroundResource(R.drawable.bg_live_prank_turntable_save);
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { /*if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
mPrankBtn.setText("添加禮物"); mPrankBtn.setText("添加禮物");
} else { } else {
mPrankBtn.setText("Add gift"); mPrankBtn.setText("Add gift");
} }*/
mPrankBtn.setTag(1); mPrankBtn.setTag(1);
recyclerAdapter.clearList(); recyclerAdapter.clearList();
mGiftNotDate.setVisibility(View.VISIBLE);
initGiftData(); initGiftData();
mPrankBtn.setVisibility(View.GONE);
} }
} }
@ -241,6 +327,73 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
}); });
} }
private void showGiftDialog() {
LivePrankAddGiftDialog livePrankAddGiftDialog = new LivePrankAddGiftDialog(mContext).setGiftBeans(giftBeans, giftTypeNowText.getTag().equals("1"));
livePrankAddGiftDialog.setOnItemClickListener(new OnItemClickListener<PrankGiftBean>() {
@SuppressLint("NotifyDataSetChanged")
@Override
public void onItemClick(PrankGiftBean bean, int position) {
giftBeans.add(bean);
recyclerAdapter.setList(giftBeans);
recyclerAdapter.notifyDataSetChanged();
if (giftBeans.size() < 6) {
mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE);
} else {
mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE);
}
}
});
livePrankAddGiftDialog.showDialog();
}
private void initGiftConfigLayoutView() {
giftSwitch1TitleText = (TextView) findViewById(R.id.gift_switch1_title_text);
giftSwitch1DescText = (TextView) findViewById(R.id.gift_switch1_desc_text);
giftSwitch1Btn = (ImageView) findViewById(R.id.gift_switch1_btn);
giftTypeNowText = (TextView) findViewById(R.id.gift_type_now_text);
giftTypeTodoText = (TextView) findViewById(R.id.gift_type_todo);
giftTypeNowSwitchText = (TextView) findViewById(R.id.gift_type_now_switch);
giftTypeNowText.setTag("2");
mBtnAddGift = (Button) findViewById(R.id.gift_add_btn);
mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE);
ViewClicksAntiShake.clicksAntiShake(giftSwitch1Btn, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
if (giftSwitch1Btn.getTag().equals("true")) {
giftSwitch1Btn.setTag("false");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_off);
} else {
giftSwitch1Btn.setTag("true");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_on);
}
}
});
ViewClicksAntiShake.clicksAntiShake(giftTypeNowSwitchText, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
CharSequence tmp = giftTypeNowText.getText();
giftTypeNowText.setText(giftTypeNowSwitchText.getText());
giftTypeNowSwitchText.setText(tmp);
if (giftTypeNowText.getTag().equals("1")) {
giftTypeNowText.setTag("2");
} else {
giftTypeNowText.setTag("1");
}
initGiftData();
}
});
ViewClicksAntiShake.clicksAntiShake(mBtnAddGift, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
showGiftDialog();
}
});
}
private void initTurntableData() { private void initTurntableData() {
LiveNetManager.get(mContext).getAnchorPrankTurntable(mLiveUid, new HttpCallback<PrankHttpTurntableBean>() { LiveNetManager.get(mContext).getAnchorPrankTurntable(mLiveUid, new HttpCallback<PrankHttpTurntableBean>() {
@Override @Override
@ -256,11 +409,23 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
}); });
} }
private void setGiftBean(PrankGiftBean bean) { private void setGiftBean(List<PrankGiftBean> prankGiftBeans,String is_cleared) {
LiveNetManager.get(mContext).setPrankGift(mLiveUid, bean.getGiftId(), bean.getNum() + "", bean.getTitle(), new HttpCallback<PrankHttpTurntableBean>() { JSONArray prankJson = getJsonObjects(prankGiftBeans);
LiveNetManager.get(mContext).setPrankGift(mLiveUid, giftSwitch1Btn.getTag().equals("true") ? "1" : "0", new Gson().toJson(prankJson), giftTypeNowText.getTag().toString(),is_cleared, new HttpCallback<PrankHttpTurntableBean>() {
@Override @Override
public void onSuccess(PrankHttpTurntableBean data) { public void onSuccess(PrankHttpTurntableBean data) {
initGiftData(); initGiftData();
if(!is_cleared.equals("1")){
if (WordUtil.isNewZh()) {
ToastUtil.show("保存成功!");
} else {
ToastUtil.show("successful");
}
}
//通知主播刷新整蛊信息
if(onPrankResultListener!=null){
onPrankResultListener.OpenAndCloseListener();
}
} }
@Override @Override
@ -270,21 +435,53 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
}); });
} }
@NonNull
private static JSONArray getJsonObjects(List<PrankGiftBean> prankGiftBeans) {
JSONArray prankJson = new JSONArray();
for (int i = 0; i < prankGiftBeans.size(); i++) {
JsonObject temp = new JsonObject();
temp.addProperty("gift_id", prankGiftBeans.get(i).getGiftId());
temp.addProperty("gift_num", prankGiftBeans.get(i).getNum());
temp.addProperty("prank_content", prankGiftBeans.get(i).getTitle());
prankJson.add(temp);
}
return prankJson;
}
private void initGiftData() { private void initGiftData() {
LiveNetManager.get(mContext).getPrankGiftList(mLiveUid, new HttpCallback<List<PrankGiftBean>>() { LiveNetManager.get(mContext).getPrankGiftList(mLiveUid, giftTypeNowText.getTag().toString(), new HttpCallback<PrankGiftResultBean>() {
@Override @Override
public void onSuccess(List<PrankGiftBean> data) { public void onSuccess(PrankGiftResultBean data) {
if (!data.isEmpty()) { if (mPrankBtn.getTag().toString().equals("1")) {
if (data.getPrank_list() != null) {
if (data.getPrank_list().size() < 6) {
mBtnAddGift.setVisibility(View.VISIBLE);
mGiftNotDate.setVisibility(View.VISIBLE);
} else {
mBtnAddGift.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.GONE); mGiftNotDate.setVisibility(View.GONE);
}
mPrankRecyclerView.setVisibility(View.VISIBLE); mPrankRecyclerView.setVisibility(View.VISIBLE);
recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_GIFT); recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_GIFT);
giftBeans = data; giftBeans = data.getPrank_list();
recyclerAdapter.setList(data); recyclerAdapter.setList(giftBeans);
recyclerAdapter.notifyDataSetChanged(); recyclerAdapter.notifyDataSetChanged();
if (data.getStatus().equals("1")) {
giftSwitch1Btn.setTag("true");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_on);
} else {
giftSwitch1Btn.setTag("false");
giftSwitch1Btn.setImageResource(R.mipmap.special_icon_off);
}
}
}
/*if (!data.isEmpty()) {
} else { } else {
mPrankRecyclerView.setVisibility(View.GONE); mPrankRecyclerView.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.VISIBLE); mGiftNotDate.setVisibility(View.VISIBLE);
} }*/
} }
@Override @Override
@ -303,6 +500,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
list.add(buildBean(4, bean.getTurntable4())); list.add(buildBean(4, bean.getTurntable4()));
list.add(buildBean(5, bean.getTurntable5())); list.add(buildBean(5, bean.getTurntable5()));
list.add(buildBean(6, bean.getTurntable6())); list.add(buildBean(6, bean.getTurntable6()));
recyclerAdapter.setViewType(TYPE_TURNTABLE);
recyclerAdapter.setList(list); recyclerAdapter.setList(list);
recyclerAdapter.notifyDataSetChanged(); recyclerAdapter.notifyDataSetChanged();
if (bean.getStatus() == 1) { if (bean.getStatus() == 1) {
@ -324,7 +522,14 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
return bean; return bean;
} }
private void setPrankConfig() { private void clearPrankConfig() {
bean = new PrankHttpTurntableBean();
setCoin(1000);
setDate(bean);
}
private void setPrankConfig(boolean isClear) {
if(!isClear){
if (StringUtil.isEmpty(bean.getTurntable1(), bean.getTurntable2(), bean.getTurntable3(), bean.getTurntable4(), bean.getTurntable5(), bean.getTurntable6())) { if (StringUtil.isEmpty(bean.getTurntable1(), bean.getTurntable2(), bean.getTurntable3(), bean.getTurntable4(), bean.getTurntable5(), bean.getTurntable6())) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
@ -334,26 +539,26 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
return; return;
} }
LiveNetManager.get(mContext).setAnchorPrankTurntable( }
mLiveUid, if(isClear){
bean.getCoin() + "", bean.setTurntable1("");
bean.getTurntable1(), bean.setTurntable2("");
bean.getTurntable2(), bean.setTurntable3("");
bean.getTurntable3(), bean.setTurntable4("");
bean.getTurntable4(), bean.setTurntable5("");
bean.getTurntable5(), bean.setTurntable6("");
bean.getTurntable6(), }
bean.getStatus() + "", LiveNetManager.get(mContext).setAnchorPrankTurntable(mLiveUid, bean.getCoin() + "", bean.getTurntable1(), bean.getTurntable2(), bean.getTurntable3(), bean.getTurntable4(), bean.getTurntable5(), bean.getTurntable6(), bean.getStatus() + "", new HttpCallback<Object>() {
new HttpCallback<Object>() {
@Override @Override
public void onSuccess(Object data) { public void onSuccess(Object data) {
if(!isClear){
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存成功"); ToastUtil.show("保存成功");
} else { } else {
ToastUtil.show("Save success"); ToastUtil.show("Save success");
} }
} }
}
@Override @Override
public void onError(String error) { public void onError(String error) {
@ -363,8 +568,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
ToastUtil.show("Save failed" + error); ToastUtil.show("Save failed" + error);
} }
} }
} });
);
} }
@Override @Override
@ -415,7 +619,13 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} }
}); });
} }
} else if (id == R.id.help) {
LivePrankExplainDialog livePrankExplainDialog = new LivePrankExplainDialog(mContext);
livePrankExplainDialog.showDialog();
}
}
} public interface onPrankResultListener{
void OpenAndCloseListener();
} }
} }

View File

@ -0,0 +1,110 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.text.Html;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.lxj.xpopup.XPopup;
import com.yunbao.common.dialog.AbsDialogPopupWindow;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
public class LivePrankExplainDialog extends AbsDialogPopupWindow {
TextView content;
public LivePrankExplainDialog(@NonNull Context context) {
super(context);
}
@Override
public void buildDialog(XPopup.Builder builder) {
}
@Override
public int bindLayoutId() {
return R.layout.dialog_live_prank_explain;
}
@Override
protected void onCreate() {
super.onCreate();
initView();
}
@Override
protected void onDismiss() {
super.onDismiss();
}
void initView() {
content = findViewById(R.id.content);
findViewById(R.id.back).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
StringBuffer stringBuffer = new StringBuffer();
if(WordUtil.isNewZh()){
stringBuffer.append(getHtmlContent(true,"1、當前整蠱分類有哪些","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"當前分爲轉盤整蠱和禮物整蠱。可根據實際情況決定,例如都設置或只設置一種。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"2、轉盤整蠱如何填寫","\"#F9B003\"",false));
stringBuffer.append(getHtmlContent(false,"打開開關→設置價格→填寫6個整蠱→保存設置。","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"注意:若有人發起整蠱,將提示你完成該整蠱,期間若有人花費鑽石拯救你,則不用完成整蠱。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"3、禮物整蠱如何填寫","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"當前分爲禮物數達成整蠱和連擊數最高整蠱。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(false,"禮物數達成整蠱:打開開關→選擇禮物→填寫數量→填寫整蠱→保存設置。","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"連擊數最高整蠱:打開開關→切換→選擇禮物→填寫整蠱→保存設置。","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(true,"4、整蠱如何填寫","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"根據你的實際情況決定。例如:唱歌、跳舞、情書、下蹲、吃辣或其他任意才藝。","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"5、我怎麽知道該做哪些整蠱","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"系統將發送消息至彈幕;","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"你需要做的整蠱會自動挂起。","\"#FFFFFF\"",false));
}else{
stringBuffer.append(getHtmlContent(true,"1. What are the current categories of pranks?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"Currently it is divided into turntable tricking and gift tricking. It can be decided according to the actual situation, for example, setting both or only one type.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"2. How to fill in the turntable trick?","\"#F9B003\"",false));
stringBuffer.append(getHtmlContent(false,"Turn on the switch → set the price → fill in 6 tricks → save the settings.","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"Note: If someone initiates a trick, you will be prompted to complete the trick. If someone spends diamonds to save you during this period, you do not need to complete the trick.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"3. How to fill in the gift form?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"Currently, it is divided into the number of gifts to reach Tricky and the number of combos to reach Tricky.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(false,"The number of gifts reaches Trick: turn on the switch → select the gift → fill in the quantity → fill in the trick → save the settings.","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(false,"The trick with the highest number of combos: turn on the switch → switch → select the gift → fill in the trick → save the settings.","\"#F9B003\"",true));
stringBuffer.append(getHtmlContent(true,"4. How to fill in Tricky?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"Decide based on your actual situation. For example: singing, dancing, love letters, squatting, eating spicy food or any other talent.","\"#FFFFFF\"",true));
stringBuffer.append(getHtmlContent(true,"5. How do I know which tricks to do?","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"The system will send a message to the barrage;","\"#FFFFFF\"",false));
stringBuffer.append(getHtmlContent(false,"The tricks you need to do will automatically hang.","\"#FFFFFF\"",false));
}
content.setText(Html.fromHtml(stringBuffer.toString()));
}
public String getHtmlContent(boolean isTitle, String content, String color, boolean linebreak) {
StringBuffer result = new StringBuffer();
if (isTitle) {
result.append("<br><b><font color=" + color + ">");
result.append(content);
result.append("</br></b></font>");
} else {
result.append("<br><font color=" + color + ">");
result.append(content);
result.append("</br></font>");
}
if (linebreak) {
result.append("<br></br>");
}
return result.toString();
}
}

View File

@ -6,6 +6,17 @@ import com.yunbao.common.bean.LiveGiftBean;
public class LiveParcelItemRefreshEvent extends BaseModel { public class LiveParcelItemRefreshEvent extends BaseModel {
private LiveGiftBean liveGiftModel; private LiveGiftBean liveGiftModel;
private int sendCount;
public int getSendCount() {
return sendCount;
}
public LiveParcelItemRefreshEvent setSendCount(int sendCount) {
this.sendCount = sendCount;
return this;
}
public LiveGiftBean getLiveGiftModel() { public LiveGiftBean getLiveGiftModel() {
return liveGiftModel; return liveGiftModel;
} }

View File

@ -11,6 +11,7 @@ import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.AppManager; import com.yunbao.common.utils.AppManager;
import com.yunbao.live.views.LiveRoomViewHolder;
public abstract class AbsLinkMicPkPresenter { public abstract class AbsLinkMicPkPresenter {
private boolean isSw = false; private boolean isSw = false;
@ -29,6 +30,7 @@ public abstract class AbsLinkMicPkPresenter {
protected String mApplyNmae;//正在申请Pk的主播的名字 protected String mApplyNmae;//正在申请Pk的主播的名字
protected boolean mIsApplyDialogShow;//是否显示了申请PK的弹窗 protected boolean mIsApplyDialogShow;//是否显示了申请PK的弹窗
public LiveRoomViewHolder mLiveRoomViewHolder;
/** /**
* 主播与主播PK 主播收到其他主播发过来的多人PK申请的回调 * 主播与主播PK 主播收到其他主播发过来的多人PK申请的回调
@ -38,6 +40,10 @@ public abstract class AbsLinkMicPkPresenter {
showDRApplyDialogTmp(u); showDRApplyDialogTmp(u);
} }
public void setmLiveRoomViewHolder(LiveRoomViewHolder mLiveRoomViewHolder) {
this.mLiveRoomViewHolder = mLiveRoomViewHolder;
}
/** /**
* 主播与主播PK 主播收到其他主播发过来的PK申请的回调 * 主播与主播PK 主播收到其他主播发过来的PK申请的回调
*/ */

View File

@ -64,6 +64,7 @@ import com.yunbao.common.utils.HtmlTagHandler;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.MicStatusManager;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
@ -276,6 +277,7 @@ public class LiveGiftAnimPresenter {
mFrameImageView = (FrameImageView) v.findViewById(R.id.all_frame_img); mFrameImageView = (FrameImageView) v.findViewById(R.id.all_frame_img);
full_service_notice_new = v.findViewById(R.id.full_service_notice_new); full_service_notice_new = v.findViewById(R.id.full_service_notice_new);
full_service_notice_new_bg = v.findViewById(R.id.full_service_notice_new_bg); full_service_notice_new_bg = v.findViewById(R.id.full_service_notice_new_bg);
full_service_notice_new_icon = v.findViewById(R.id.full_service_notice_new_icon);
full_service_notice_new_text = v.findViewById(R.id.full_service_notice_new_text); full_service_notice_new_text = v.findViewById(R.id.full_service_notice_new_text);
iv_look_full_service_notice_new = v.findViewById(R.id.iv_look_full_service_notice_new); iv_look_full_service_notice_new = v.findViewById(R.id.iv_look_full_service_notice_new);
iv_look_full_service_notice_new3 = v.findViewById(R.id.iv_look_full_service_notice_new3); iv_look_full_service_notice_new3 = v.findViewById(R.id.iv_look_full_service_notice_new3);
@ -1152,6 +1154,7 @@ public class LiveGiftAnimPresenter {
View full_service_notice_new; View full_service_notice_new;
ImageView full_service_notice_new_bg; ImageView full_service_notice_new_bg;
ImageView full_service_notice_new_icon;
TextView full_service_notice_new_text; TextView full_service_notice_new_text;
TextView iv_look_full_service_notice_new; TextView iv_look_full_service_notice_new;
AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent; AllServerNotifyFFGGGDJANEvent notifyFFGGGDJANEvent;
@ -1188,6 +1191,12 @@ public class LiveGiftAnimPresenter {
full_service_notice_new.setAlpha(1f); full_service_notice_new.setAlpha(1f);
full_service_notice_new.setVisibility(View.VISIBLE); full_service_notice_new.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, event.getBackgroundImage(), full_service_notice_new_bg); ImgLoader.display(mContext, event.getBackgroundImage(), full_service_notice_new_bg);
if(!StringUtil.isEmpty(event.getLeftImage())){
full_service_notice_new_icon.setVisibility(View.VISIBLE);
ImgLoader.display(mContext,event.getLeftImage(),full_service_notice_new_icon);
}else{
full_service_notice_new_icon.setVisibility(View.GONE);
}
SpannableStringBuilder builder = new SpannableStringBuilder(); SpannableStringBuilder builder = new SpannableStringBuilder();
String msgN = WordUtil.isNewZh() ? event.getMsgCn() : event.getMsgEn(); String msgN = WordUtil.isNewZh() ? event.getMsgCn() : event.getMsgEn();
builder.append(msgN); builder.append(msgN);

View File

@ -72,6 +72,7 @@ import com.yunbao.live.socket.SocketRyLinkMicPkUtil;
import com.yunbao.live.socket.SocketSendBean; import com.yunbao.live.socket.SocketSendBean;
import com.yunbao.live.views.LiveLinkMicPkViewHolder; import com.yunbao.live.views.LiveLinkMicPkViewHolder;
import com.yunbao.live.views.LivePushRyViewHolder; import com.yunbao.live.views.LivePushRyViewHolder;
import com.yunbao.live.views.LiveRoomViewHolder;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
@ -247,6 +248,10 @@ public class LiveRyLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
} }
public LiveRyLinkMicPkPresenter(Context context, LivePushRyViewHolder linkMicViewHolder, boolean isAnchor, View root) { public LiveRyLinkMicPkPresenter(Context context, LivePushRyViewHolder linkMicViewHolder, boolean isAnchor, View root) {
super(false); super(false);
mContext = context; mContext = context;
@ -1043,6 +1048,10 @@ public class LiveRyLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
} }
} }
} }
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
} }
}); });
} }
@ -1826,6 +1835,10 @@ public class LiveRyLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
} }
}); });
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
} }
}); });

View File

@ -607,6 +607,10 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
dRjoinOtherRoom(u); dRjoinOtherRoom(u);
//展示结束连麦按钮 //展示结束连麦按钮
mLiveAnchorViewHolder.showEndPkBt(); mLiveAnchorViewHolder.showEndPkBt();
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
} }
@ -685,6 +689,10 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
onLinkMicPkStart(mApplyUid, 2); onLinkMicPkStart(mApplyUid, 2);
} }
}); });
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
} }
@Override @Override
@ -831,9 +839,15 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
//设置多人PK 房主ROOM UID //设置多人PK 房主ROOM UID
mLiveAnchorViewHolder.setDrpkRoomId(mApplyUid); mLiveAnchorViewHolder.setDrpkRoomId(mApplyUid);
mLiveAnchorViewHolder.showEndPkBt(); mLiveAnchorViewHolder.showEndPkBt();
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
} }
} }
}); });
} }
}); });
} }
@ -1511,6 +1525,10 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
mPkTimeCount = PK_TIME_MAX; mPkTimeCount = PK_TIME_MAX;
} }
Log.d("mPkTimeCount2", "" + mPkTimeCount + ";mPkTimeFromServer=" + mPkTimeFromServer); Log.d("mPkTimeCount2", "" + mPkTimeCount + ";mPkTimeFromServer=" + mPkTimeFromServer);
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
} }

View File

@ -346,4 +346,9 @@ public interface SocketMessageListener {
* *
*/ */
void onHourRank(LiveChatBean bean,JSONObject ranks); void onHourRank(LiveChatBean bean,JSONObject ranks);
/**
* 整蛊列表数据更新
*/
void onUpdatePrankProgress(String prankString);
} }

View File

@ -14,6 +14,7 @@ import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
@ -797,4 +798,64 @@ public class SocketRyChatUtil {
}); });
} }
public static void sendPrankIcon() {
IMLoginModel userInfo = IMLoginManager.get(AppManager.getInstance().getMainActivity()).getUserInfo();
final SocketSendBean msg = new SocketSendBean()
.param("_method_", Constants.SOCKET_SEND_MSG)
.param("action", 0)
.param("msgtype", 2)
.param("uid", String.valueOf(userInfo.getId()))
.param("uname", userInfo.getUserNicename())
.param("ugood", String.valueOf(userInfo.getId()))
.param("uname", userInfo.getLevel())
.param("tougood", "")
.param("touid", "")
.param("touname", "")
.param("liangname", "")
.param("vip_type", userInfo.getVip().getType())
.param("usertype", Constants.SOCKET_USER_TYPE_ANCHOR)
.param("prankIcon", "https://downs.yaoulive.com/Tricky/prankIcon.png")
.param("ct", "主播发送了转盘整蛊提示更新到最新版APP后即可查看。"
);
msg.create();
String targetId = "g" + userInfo.getId();
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
TextMessage messageContent = TextMessage.obtain(msg.mResult.toString());
Message message = Message.obtain(targetId, conversationType, messageContent);
RongcloudIMManager.sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override
public void onAttached(Message message) {
}
@Override
public void onSuccess(Message message) {
Log.i("tx", "发送成功");
if (SocketRyClient.mSocketHandler != null) {
SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
}
LiveNetManager.get(CommonAppContext.sInstance)
.addChatCount(LiveActivity.mStream, new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
@Override
public void onSuccess(HttpCallbackModel data) {
}
@Override
public void onError(String error) {
}
});
}
@Override
public void onError(Message message, RongIMClient.ErrorCode errorCode) {
}
});
}
} }

View File

@ -4,6 +4,7 @@ import static com.blankj.utilcode.util.SnackbarUtils.dismiss;
import static com.blankj.utilcode.util.ViewUtils.runOnUiThread; import static com.blankj.utilcode.util.ViewUtils.runOnUiThread;
import static com.yunbao.common.Constants.SOCKET_LIVE_MSG_TO_USER; import static com.yunbao.common.Constants.SOCKET_LIVE_MSG_TO_USER;
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK; import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
import static com.yunbao.live.bean.LiveChatBean.TYPE_TO_ANCHOR_PRANK_GIFT;
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot; import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
import android.app.Activity; import android.app.Activity;
@ -14,11 +15,15 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Toast;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
@ -55,6 +60,7 @@ import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ToastUtils;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
@ -192,7 +198,7 @@ public class SocketRyClient {
SocketReceiveBean received = JSON.parseObject(socketMsg, SocketReceiveBean.class); SocketReceiveBean received = JSON.parseObject(socketMsg, SocketReceiveBean.class);
JSONObject map = received.getMsg().getJSONObject(0); JSONObject map = received.getMsg().getJSONObject(0);
// LogUtils.e("yqw=====>收到的socket:"+map.getString("_method_")+","+map.getString("ct"));
switch (map.getString("_method_")) { switch (map.getString("_method_")) {
//用户连麦 //用户连麦
case Constants.LIAN_MAI: case Constants.LIAN_MAI:
@ -290,6 +296,45 @@ public class SocketRyClient {
} }
} }
break; break;
case Constants.PrankSendData:
//整蛊礼物刷新
L.e("整蛊礼物刷新 整蛊礼物刷新 整蛊礼物刷新");
if (map.getIntValue("action") == 13 && map.getString("msgtype").equals("4")){
String ctString = map.getString("ct");
L.e("整蛊礼物刷新 整蛊礼物刷新 整蛊礼物刷新 "+ctString);
JsonElement jsonElement = JsonParser.parseString(ctString);
if (jsonElement == null) break;
// LogUtils.e("yqw=====>整蛊礼物列表:"+ctString);
JsonObject jsonObject = jsonElement.getAsJsonObject();
String content = WordUtil.isNewZh() ? jsonObject.get("msg").getAsString() : jsonObject.get("msg_en").getAsString();
if(jsonObject.get("is_complete")!=null){
String is_complete = jsonObject.get("is_complete").getAsString(); //0.未达成整蛊需要的数量 1.已达成整蛊
if(is_complete.equals("1")){
String user_name = jsonObject.get("user_name").getAsString(); //用户昵称
String prank_content = jsonObject.get("prank_content").getAsString(); //整蛊内容
String gift_count = jsonObject.get("gift_count").getAsString(); // 礼物数量
LiveChatBean chatBean = new LiveChatBean();
chatBean.setUserNiceName(user_name);
chatBean.setGiftName(jsonObject.get("gift_name").getAsString());
chatBean.setGiftname_en(jsonObject.get("gift_name_en").getAsString());
chatBean.setHot_num(gift_count);
chatBean.setContent(prank_content);
chatBean.setType(TYPE_TO_ANCHOR_PRANK_GIFT);
mListener.onChat(chatBean, 1);
}
}else{
if (!TextUtils.isEmpty(content)){
systemChatMessage2(content);
}
}
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)&&"完成1次".equals(jsonObject.get("msg").getAsString())){
Toast toast = Toast.makeText(mContext,WordUtil.isNewZh()?jsonObject.get("msg").getAsString():jsonObject.get("msg_en").getAsString(),Toast.LENGTH_LONG);
toast.show();
}
mListener.onUpdatePrankProgress(ctString);
}
break;
case Constants.SOCKET_KICK://踢人 case Constants.SOCKET_KICK://踢人
systemChatMessage2(map.getString("ct")); systemChatMessage2(map.getString("ct"));
mListener.onKick(map.getString("touid")); mListener.onKick(map.getString("touid"));

View File

@ -4,6 +4,7 @@ import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
import static com.yunbao.common.Constants.SOCKET_LIVE_MSG_TO_USER; import static com.yunbao.common.Constants.SOCKET_LIVE_MSG_TO_USER;
import static com.yunbao.live.activity.LiveSwAnchorActivity.isDRPK; import static com.yunbao.live.activity.LiveSwAnchorActivity.isDRPK;
import static com.yunbao.live.activity.LiveSwAnchorActivity.DRPKing; import static com.yunbao.live.activity.LiveSwAnchorActivity.DRPKing;
import static com.yunbao.live.bean.LiveChatBean.TYPE_TO_ANCHOR_PRANK_GIFT;
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot; import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
import android.app.Activity; import android.app.Activity;
@ -14,12 +15,16 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Toast;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
@ -280,6 +285,44 @@ public class SocketSwClient {
} }
} }
break; break;
case Constants.PrankSendData:
//整蛊礼物刷新
L.e("整蛊礼物刷新 整蛊礼物刷新 整蛊礼物刷新");
if (map.getIntValue("action") == 13 && map.getString("msgtype").equals("4")){
String ctString = map.getString("ct");
L.e("整蛊礼物刷新 整蛊礼物刷新 整蛊礼物刷新 "+ctString);
JsonElement jsonElement = JsonParser.parseString(ctString);
if (jsonElement == null) break;
// LogUtils.e("yqw=====>整蛊礼物列表:"+ctString);
JsonObject jsonObject = jsonElement.getAsJsonObject();
String content = WordUtil.isNewZh() ? jsonObject.get("msg").getAsString() : jsonObject.get("msg_en").getAsString();
if(jsonObject.get("is_complete")!=null){
String is_complete = jsonObject.get("is_complete").getAsString(); //0.未达成整蛊需要的数量 1.已达成整蛊
if(is_complete.equals("1")){
String user_name = jsonObject.get("user_name").getAsString(); //用户昵称
String prank_content = jsonObject.get("prank_content").getAsString(); //整蛊内容
String gift_count = jsonObject.get("gift_count").getAsString(); // 礼物数量
LiveChatBean chatBean = new LiveChatBean();
chatBean.setUserNiceName(user_name);
chatBean.setGiftName(jsonObject.get("gift_name").getAsString());
chatBean.setGiftname_en(jsonObject.get("gift_name_en").getAsString());
chatBean.setHot_num(gift_count);
chatBean.setContent(prank_content);
chatBean.setType(TYPE_TO_ANCHOR_PRANK_GIFT);
mListener.onChat(chatBean, 1);
}
}else{
if (!TextUtils.isEmpty(content)){
systemChatMessage2(content);
}
}
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)&&"完成1次".equals(jsonObject.get("msg").getAsString())){
Toast toast = Toast.makeText(mContext,WordUtil.isNewZh()?jsonObject.get("msg").getAsString():jsonObject.get("msg_en").getAsString(),Toast.LENGTH_LONG);
toast.show();
}
mListener.onUpdatePrankProgress(ctString);
}
break;
case Constants.SOCKET_KICK://踢人 case Constants.SOCKET_KICK://踢人
systemChatMessage2(map.getString("ct")); systemChatMessage2(map.getString("ct"));
mListener.onKick(map.getString("touid")); mListener.onKick(map.getString("touid"));

View File

@ -365,6 +365,7 @@ public class LiveTextRender {
} }
createPrefixCallback.onPrefixCallback(builder, 0);*/ createPrefixCallback.onPrefixCallback(builder, 0);*/
show(drawable); show(drawable);
//createPrefixCallback.onPrefixCallback(builder, 0);
} }
@Override @Override

View File

@ -0,0 +1,90 @@
package com.yunbao.live.utils
import android.graphics.Color
import android.graphics.LinearGradient
import android.graphics.Shader
import android.text.Spannable
import android.text.SpannableString
import android.text.style.ForegroundColorSpan
import android.view.View
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.core.view.isGone
import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import java.util.regex.Pattern
//显示控件
fun View.visible(){
isVisible = true
}
//隐藏控件
fun View.gone(){
isGone = true
}
//隐藏控件
fun View.inVisible(){
isInvisible = true
}
//文字颜色渐变
fun setGradientFont(view: TextView,floatArray: FloatArray,colors : Array<String>) {
view.measure(View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED),0)
// val floats = floatArrayOf(0.5f,1.0f)
val colorsInt = colors.map { Color.parseColor(it) }.toIntArray()
val linearGradient =
LinearGradient(0f, 0f,
view.measuredWidth.toFloat(),
0f,
colorsInt,
floatArray,
Shader.TileMode.CLAMP)
view.paint.shader = linearGradient
view.invalidate()
}
/**
*@MethodName: setOnSingleClick
*@Description: 调用控件的点击事件
*@Author: Yqw
*@Date: 2023/4/21 18:10
**/
private var lastClickTime = 0L
private const val internalTime = 500L
interface OnClickListener{
fun onClick(view : View)
}
fun setOnSingleClick(view: View,onClick : OnClickListener){
view.setOnClickListener {
if (lastClickTime != 0L && (System.currentTimeMillis()- lastClickTime)< internalTime){
// lastClickTime = System.currentTimeMillis()
// "Do not click repeatedly!".toastShort
return@setOnClickListener
}else{
lastClickTime = System.currentTimeMillis()
onClick.onClick(it)
}
}
}
//设置关键词样式
fun setSpannable(content: String, keys: Array<String>,color : String): SpannableString {
val msp = SpannableString(content)
for (index in keys.indices){
val p = Pattern.compile(keys[index])
val m = p.matcher(msp)
while (m.find()){
msp.setSpan(
ForegroundColorSpan(Color.parseColor(color)),
m.start(),
m.end(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
// msp.setSpan(StyleSpan(Typeface.BOLD),m.start(),m.end(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
// msp.setSpan(AbsoluteSizeSpan(25,true),m.start(),m.end(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
// msp.setSpan(UnderlineSpan(),m.start(),m.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
}
}
return msp
}

View File

@ -56,6 +56,16 @@ public class LiveGiftItemFragment extends BaseFragment {
frameGiftList.setLayoutManager(new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false)); frameGiftList.setLayoutManager(new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false));
frameGiftAdapter = new FrameGiftAdapter(contextLayoutGiftHeight, giftJson, mStream, mLiveUid, wishGiftId); frameGiftAdapter = new FrameGiftAdapter(contextLayoutGiftHeight, giftJson, mStream, mLiveUid, wishGiftId);
frameGiftList.setAdapter(frameGiftAdapter); frameGiftList.setAdapter(frameGiftAdapter);
frameGiftList.post(()->{
if (!TextUtils.isEmpty(wishGiftId) && !giftJson.isEmpty()){
for (int i = 0; i < giftJson.size(); i++) {
if (giftJson.get(i).getId()== Integer.parseInt(wishGiftId)){
frameGiftAdapter.giftSelect(giftJson.get(i));
}
}
}
});
} }
@Override @Override

View File

@ -77,6 +77,6 @@ public class LiveParcelItemFragment extends BaseFragment {
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onLiveParcelItemRefreshEvent(LiveParcelItemRefreshEvent event) { public void onLiveParcelItemRefreshEvent(LiveParcelItemRefreshEvent event) {
frameGiftAdapter.refreshWrapListAfterSend(event.getLiveGiftModel()); frameGiftAdapter.refreshWrapListAfterSend(event);
} }
} }

View File

@ -44,6 +44,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SizeUtils;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.load.engine.GlideException;
@ -51,6 +54,9 @@ import com.bumptech.glide.load.resource.gif.GifDrawable;
import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.target.Target;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView; import com.makeramen.roundedimageview.RoundedImageView;
@ -62,6 +68,8 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity; import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MobclickAgent; import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
@ -151,9 +159,11 @@ import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.activity.LiveSwAnchorActivity; import com.yunbao.live.activity.LiveSwAnchorActivity;
import com.yunbao.live.activity.ZhuangBanActivity; import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.adapter.ComboAdapter;
import com.yunbao.live.adapter.LiveChatAdapter; import com.yunbao.live.adapter.LiveChatAdapter;
import com.yunbao.live.adapter.LiveRoomFastMessageRecyclerViewAdapter; import com.yunbao.live.adapter.LiveRoomFastMessageRecyclerViewAdapter;
import com.yunbao.live.adapter.LiveUserAdapter; import com.yunbao.live.adapter.LiveUserAdapter;
import com.yunbao.live.adapter.PrankAdapter;
import com.yunbao.live.bean.DrPkbean; import com.yunbao.live.bean.DrPkbean;
import com.yunbao.live.bean.LiveBuyGuardMsgBean; import com.yunbao.live.bean.LiveBuyGuardMsgBean;
import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveChatBean;
@ -175,6 +185,7 @@ import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
import com.yunbao.live.dialog.LiveFansMedalDialogFragment; import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
import com.yunbao.live.dialog.LiveGameDialogFragment; import com.yunbao.live.dialog.LiveGameDialogFragment;
import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LivePrankDialogFragment;
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog; import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveUserDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
@ -190,6 +201,7 @@ import com.yunbao.live.presenter.LiveLightAnimPresenter;
import com.yunbao.live.utils.LiveRoomVoteManager; import com.yunbao.live.utils.LiveRoomVoteManager;
import com.yunbao.live.utils.LiveTextRender; import com.yunbao.live.utils.LiveTextRender;
import com.yunbao.live.utils.LoadDian9TuUtil; import com.yunbao.live.utils.LoadDian9TuUtil;
import com.yunbao.live.utils.ZeusKt;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
@ -199,6 +211,7 @@ import java.lang.ref.WeakReference;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -210,6 +223,7 @@ import io.rong.imkit.userinfo.RongUserInfoManager;
import io.rong.imlib.RongIMClient; import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation; import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.UserInfo; import io.rong.imlib.model.UserInfo;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import pl.droidsonroids.gif.GifImageView; import pl.droidsonroids.gif.GifImageView;
/** /**
@ -402,6 +416,24 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private View quick_gift_reminder; private View quick_gift_reminder;
private int guardType = 0; private int guardType = 0;
//整蛊进度列表功能
private View prank_group;
public TextView prank_group_title,prank_group_turntable;
private RecyclerView recycler_prank;
private ImageView prank_group_bottom_icon,prank_group_turntable_icon;
private GifImageView prank_small_icon;
private PrankAdapter prankAdapter;
private List<PrankProgressBean.PrankList> prankAndComboList = new ArrayList<>();
private List<PrankProgressBean.PrankList> completedList = new ArrayList<>();
private int isPrank;
private boolean prankAnisShow;
private LinearLayout prank_top_layout;
private ImageView prank_group_top_icon;
private int mPrankType;
private pl.droidsonroids.gif.GifDrawable mGifDrawable;
private static boolean isSw; private static boolean isSw;
public LiveRoomViewHolder setGuardType(int guardType) { public LiveRoomViewHolder setGuardType(int guardType) {
@ -1340,18 +1372,45 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mLiveChatAdapter.removetItem(bean); mLiveChatAdapter.removetItem(bean);
((LiveActivity) mContext).sendChatMessage("Hi~", null, null); ((LiveActivity) mContext).sendChatMessage("Hi~", null, null);
} else if (bean.getType() == -5) { } else if (bean.getType() == -5) {
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Turntable&a=tricky"; String url = CommonAppConfig.HOST + "/h5/activity/Turntable/index.html";
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() +
"&active_id=6";
Log.i("tag", url); Log.i("tag", url);
Bundle bundle1 = new Bundle(); Bundle bundle1 = new Bundle();
bundle1.putString("url", url); bundle1.putString("url", url);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment(); LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle1); liveHDDialogFragment.setArguments(bundle1);
if(mContext instanceof LiveAudienceActivity){
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}else if(mContext instanceof LiveRyAnchorActivity){
liveHDDialogFragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}else if(mContext instanceof LiveSwAnchorActivity){
liveHDDialogFragment.show(((LiveSwAnchorActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}
} else if (bean.getType() == RECOMMEND_CARD_NOTIFY) { } else if (bean.getType() == RECOMMEND_CARD_NOTIFY) {
gotoLive(bean.getMsgModel().getAnchorId()); gotoLive(bean.getMsgModel().getAnchorId());
} else if (bean.getType() == bean.STAR_CHALLENGE_UPGRADE_NOTIFY) { } else if (bean.getType() == bean.STAR_CHALLENGE_UPGRADE_NOTIFY) {
gotoLive(bean.getMsgModel().getLiveUid()); gotoLive(bean.getMsgModel().getLiveUid());
} else if(bean.getType()==bean.TYPE_TO_ANCHOR_PRANK){
LivePrankDialogFragment fragment = new LivePrankDialogFragment();
fragment.setOnPrankResultListener(new LivePrankDialogFragment.onPrankResultListener() {
@Override
public void OpenAndCloseListener() {
initPrankProgress(1);
}
});
fragment.setmLiveUid(mLiveUid);
if(mContext instanceof LiveRyAnchorActivity){
fragment.show(((LiveRyAnchorActivity)mContext).getSupportFragmentManager(), "LivePrankDialogFragment");
}else if(mContext instanceof LiveSwAnchorActivity){
fragment.show(((LiveSwAnchorActivity)mContext).getSupportFragmentManager(), "LivePrankDialogFragment");
}
if(mContext instanceof LiveRyAnchorActivity){
com.yunbao.live.activity.LiveRyAnchorActivity.mLiveAnchorViewHolder.closeMenuRed();
}else if(mContext instanceof LiveSwAnchorActivity){
com.yunbao.live.activity.LiveSwAnchorActivity.mLiveAnchorViewHolder.closeMenuRed();
}
}else{ }else{
showUserDialog(bean.getId()); showUserDialog(bean.getId());
} }
@ -1575,7 +1634,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
findViewById(R.id.btn_follow).setVisibility(View.GONE); findViewById(R.id.btn_follow).setVisibility(View.GONE);
findViewById(R.id.live_rank_pk).setVisibility(View.GONE); findViewById(R.id.live_rank_pk).setVisibility(View.GONE);
} }
if (mContext instanceof LiveRyAnchorActivity) { if (mContext instanceof LiveRyAnchorActivity ||mContext instanceof LiveSwAnchorActivity) {
findViewById(R.id.open_sidebar).setVisibility(View.GONE); findViewById(R.id.open_sidebar).setVisibility(View.GONE);
findViewById(R.id.btn_follow).setVisibility(View.GONE); findViewById(R.id.btn_follow).setVisibility(View.GONE);
findViewById(R.id.live_rank_pk).setVisibility(View.GONE); findViewById(R.id.live_rank_pk).setVisibility(View.GONE);
@ -1585,7 +1644,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
reloadIM(); reloadIM();
// initStarChallengeStatus(); // initStarChallengeStatus();
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1);
pa_pao_layout = (FrameLayout) findViewById(R.id.pa_pao_layout); pa_pao_layout = (FrameLayout) findViewById(R.id.pa_pao_layout);
combo_layout = (LinearLayout) findViewById(R.id.combo_layout); combo_layout = (LinearLayout) findViewById(R.id.combo_layout);
@ -1624,6 +1682,338 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
}); });
// dragonImmediateParticipation.setVisibility(View.GONE); // dragonImmediateParticipation.setVisibility(View.GONE);
//整蛊转盘优化更新
prank_top_layout= (LinearLayout) findViewById(R.id.prank_top_layout);
prank_group_top_icon= (ImageView) findViewById(R.id.prank_group_top_icon);
prank_group = findViewById(R.id.prank_group);//浮窗
prank_group_title = (TextView) findViewById(R.id.prank_group_title);//浮窗标题
recycler_prank = (RecyclerView) findViewById(R.id.recycler_prank);//列表
prank_group_turntable = (TextView) findViewById(R.id.prank_group_turntable);//文字转盘整蛊(用户端已删除,主播端为待完成整蛊按钮)
prank_group_bottom_icon = (ImageView) findViewById(R.id.prank_group_bottom_icon);//收起icon
prank_group_turntable_icon = (ImageView) findViewById(R.id.prank_group_turntable_icon);//转盘图标
prank_small_icon = (GifImageView) findViewById(R.id.prank_small_icon);//收起后图标
try {
if (WordUtil.isNewZh()){
mGifDrawable = new pl.droidsonroids.gif.GifDrawable(mContext.getResources(),R.drawable.pran_zh);
}else {
mGifDrawable = new pl.droidsonroids.gif.GifDrawable(mContext.getResources(),R.drawable.pran_en);
}
prank_small_icon.setImageDrawable(mGifDrawable);
mGifDrawable.stop();
}catch (Exception e){
e.printStackTrace();
}
//点击文字转盘整蛊(跳转转盘整蛊)
prank_group_turntable.setOnClickListener(v->{
prankAnisShow = !prankAnisShow;
if(isPrank==1){
prankAdapter.setViewType(PrankAdapter.TYPE_GIFT);
}else{
prankAdapter.setViewType(PrankAdapter.TYPE_COMBO);
}
if(prankAnisShow){
prankAdapter.showAnView(completedList,prankAnisShow);
prank_group_turntable.setText(R.string.prank_progress);
if (!completedList.isEmpty()){
limitItem(1,Math.min(completedList.size(), 4));
}else {
recycler_prank.setVisibility(View.GONE);
}
prank_group_title.setText(WordUtil.isNewZh()?"待完成整蠱":"To do");
prank_group_turntable.setText(WordUtil.isNewZh()?"整蠱進度":"progress");
}else{
prankAdapter.showAnView(prankAndComboList,prankAnisShow);
prank_group_title.setText(WordUtil.isNewZh()?"整蠱進度":"progress");
prank_group_turntable.setText(WordUtil.isNewZh()?"待完成整蠱":"To do");
recycler_prank.setVisibility(View.VISIBLE);
limitItem(1,Math.min(prankAndComboList.size(), 4));
}
});
//点击收起
prank_group_bottom_icon.setOnClickListener(v->{
prank_group.setVisibility(View.INVISIBLE);
prank_small_icon.setVisibility(View.VISIBLE);
if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
switchGifDrawable(!completedList.isEmpty());
}else {
switchGifDrawable(false);
}
});
//点击收起整蛊icon
prank_small_icon.setOnClickListener(v->{
prank_group.setVisibility(View.VISIBLE);
prank_small_icon.setVisibility(View.GONE);
});
//点击图片转盘整蛊(跳转转盘整蛊)
prank_group_turntable_icon.setOnClickListener(v->{
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.WE_CHEAT));
});
recycler_prank.setLayoutManager(new LinearLayoutManager(mContext));
initPrankAdapter();
}
/**
* 收起整蛊列表
*/
public void closePrankView(){
if(prank_group.getVisibility()==View.VISIBLE){
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.VISIBLE);
}
}
public void sendMsgPrank(){
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
LiveChatBean bean = new LiveChatBean();
bean.setContent("开播整蛊通知");
bean.setType(LiveChatBean.TYPE_TO_ANCHOR_PRANK);
mLiveChatAdapter.insertItem(bean);
}
}, 1000);
}
//初始化整蛊列表进度
public void initPrankProgress(int isShow){
// LogUtils.e("yqw=====>主播id:"+mLiveUid);
//获取整蛊列表
LiveNetManager.get(mContext).getPrankProgressList(mLiveUid, new com.yunbao.common.http.base.HttpCallback<PrankProgressBean>() {
@Override
public void onSuccess(PrankProgressBean data) {
// LogUtils.e("yqw=====>整蛊列表:"+data);
isPrank = data.getPrank_type();
prankAndComboList.clear();
prankAndComboList.addAll(data.getPrank_list());
completedList.clear();
completedList.addAll(data.getCompleted_list());
setPrankList(isShow,data.getStatus(),data.getPrank_type(),data.getPrank_turntable_status());
}
@Override
public void onError(String error) {
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.GONE);
prank_group_turntable_icon.setVisibility(View.GONE);
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
}
});
}
//刷新整蛊礼物列表
public void refreshPrank(String newPrankData){
try {
// LogUtils.e("yqw=====>整蛊礼物数据1:"+newPrankData);
org.json.JSONObject ctString = new org.json.JSONObject(newPrankData);
if (ctString.getInt("is_update") == 1){
//列表全部更新
if (ctString.getInt("status")==1){
//编辑添加整蛊
initPrankProgress(1);
}else {
//编辑取消整蛊
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.GONE);
}
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
return;
}
if (Integer.parseInt(ctString.getString("prank_turntable_status")) == 0){
prank_group_turntable_icon.setVisibility(View.GONE);
}else {
prank_group_turntable_icon.setVisibility(View.VISIBLE);
//ZeusKt.visible(prank_group_turntable_icon);
}
}else {
//送整蛊礼物更新
String prankListString = ctString.getString("prank_list");
List<PrankProgressBean.PrankList> prankList = GsonUtils.fromJson(prankListString,new TypeToken<List<PrankProgressBean.PrankList>>() {}.getType());
// LogUtils.e("yqw=====>整蛊礼物数据2:"+prankList.toString());
prankAndComboList.clear();
prankAndComboList.addAll(prankList);
String completedString = ctString.getString("completed_list");
List<PrankProgressBean.PrankList> completeds = GsonUtils.fromJson(completedString,new TypeToken<List<PrankProgressBean.PrankList>>() {}.getType());
completedList.clear();
completedList.addAll(completeds);
setPrankList(0,Integer.parseInt(ctString.getString("status")), Integer.parseInt(ctString.getString("prank_type")), Integer.parseInt(ctString.getString("prank_turntable_status")));
}
}catch (Exception e){
LogUtils.e("yqw=====>转换错误:"+e.getMessage());
}
}
private void initPrankAdapter() {
prankAdapter = new PrankAdapter(mContext);
//整蛊礼物点击
prankAdapter.addOnItemClickListener(new PrankAdapter.OnItemClickListener() {
@Override
public void onItemClick(View view, int giftId) {
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
return;
}
openGiftDialog(String.valueOf(giftId));
}
@Override
public void onItemDel(int giftId) {
LiveNetManager.get(mContext).anchorClickFinish(mLiveUid, String.valueOf(giftId), new com.yunbao.common.http.base.HttpCallback<List<BaseModel>>() {
@Override
public void onSuccess(List<BaseModel> data) {
}
@Override
public void onError(String error) {
}
});
L.e("onItemDel:"+giftId);
}
});
}
//设置整蛊礼物数据
private void setPrankList(int isShow,int status,int mPrankType,int prankTurntableStatus){
this.mPrankType =mPrankType;
// LogUtils.e("yqw=====>显示转盘icon:是否显示:"+(prankTurntableStatus == 1)+",是否在倒计时"+(lt_trickery.getVisibility() == View.VISIBLE));
if (prankTurntableStatus == 1 && lt_trickery.getVisibility() == View.GONE){
if(!CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
prank_group_turntable_icon.setVisibility(View.VISIBLE);
}
}else {
prank_group_turntable_icon.setVisibility(View.GONE);
}
// LogUtils.e("yqw=====>显示整蛊列表或者投票列表:"+status);
if (status == 1){
if(isShow==1){
prank_group.setVisibility(View.VISIBLE);
prank_small_icon.setVisibility(View.GONE);
}else if(isShow==2){
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.VISIBLE);
}
//主播可能打开整蛊功能但是不设置整蛊礼物这里会是空列表
if (!prankAndComboList.isEmpty()){
initPrankAdapter();
recycler_prank.setAdapter(prankAdapter);
if (mPrankType == 1){//礼物
// sortByCompletionRate(prankAndComboList);
prankAdapter.setViewType(PrankAdapter.TYPE_GIFT);
//prankAdapter.setList(prankAndComboList);
if(prankAnisShow){
prankAdapter.showAnView(completedList,prankAnisShow);
prank_group_title.setText(WordUtil.isNewZh()?"待完成整蠱":"To do");
prank_group_turntable.setText(WordUtil.isNewZh()?"整蠱進度":"progress");
if (!completedList.isEmpty()){
limitItem(1,Math.min(completedList.size(), 4));
}else {
recycler_prank.setVisibility(View.GONE);
}
}else{
prankAdapter.showAnView(prankAndComboList,prankAnisShow);
prank_group_title.setText(WordUtil.isNewZh()?"整蠱進度":"progress");
prank_group_turntable.setText(WordUtil.isNewZh()?"待完成整蠱":"To do");
limitItem(1,Math.min(prankAndComboList.size(), 4));
}
}else { //连击
// sortBySendNum(prankAndComboList);
prank_group_title.setText(R.string.combo_vote);
prankAdapter.setViewType(PrankAdapter.TYPE_COMBO);
prankAdapter.setList(prankAndComboList);
limitItem(2,Math.min(prankAndComboList.size(), 4));
}
}else {
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.GONE);
}
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
prank_top_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.VISIBLE);
switchGifDrawable(!completedList.isEmpty());
}
});
prank_group_top_icon.setVisibility(View.VISIBLE);
if(mPrankType==1){
prank_group_turntable.setVisibility(View.VISIBLE);
}else{
prank_group_turntable.setVisibility(View.GONE);
}
prank_group_bottom_icon.setVisibility(View.GONE);
switchGifDrawable(!completedList.isEmpty());
}else{
switchGifDrawable(false);
if(mPrankType==1){
prank_group_title.setText(R.string.prank_progress);
}else{
prank_group_title.setText(R.string.combo_vote);
}
prank_group_turntable.setVisibility(View.GONE);
prank_group_top_icon.setVisibility(View.GONE);
}
}else {
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.GONE);
}
}
//根据完成度排序
private void sortByCompletionRate(List<PrankProgressBean.PrankList> items) {
Collections.sort(items, (item1, item2) -> Double.compare(item2.getCompletionRate(), item1.getCompletionRate()));
}
//根据连击数排列
private void sortBySendNum(List<PrankProgressBean.PrankList> items) {
Collections.sort(items, (item1, item2) -> {
return Integer.compare(item2.getSend_num(), item1.getSend_num()); // 从高到低排序
});
}
//设置最多显示4个项目
private void limitItem(int prankType,int maxItem){
recycler_prank.post(() -> {
View itemView = recycler_prank.getChildAt(0);
if (itemView != null){
int gap = prankType == 1 ? SizeUtils.dp2px(3f) : 0;
int height = (itemView.getHeight() + gap)*maxItem;
ViewGroup.LayoutParams layoutParams = recycler_prank.getLayoutParams();
layoutParams.height = height;
recycler_prank.setLayoutParams(layoutParams);
}
});
}
private void switchGifDrawable(boolean start){
// LogUtils.e("yqw=====>判断闪烁:"+(mGifDrawable != null)+","+start);
if (mGifDrawable != null){
if (start){
mGifDrawable.start();
}else {
mGifDrawable.seekTo(0);
mGifDrawable.stop();
}
}
} }
int ttttttype = 0; int ttttttype = 0;
@ -1721,7 +2111,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
layoutParams.topMargin = DpUtil.dp2px(190); layoutParams.topMargin = DpUtil.dp2px(190);
dragonImmediateParticipation.setLayoutParams(layoutParams); dragonImmediateParticipation.setLayoutParams(layoutParams);
} }
if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE && mContext instanceof LiveRyAnchorActivity) { if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE && mContext instanceof LiveRyAnchorActivity||mContext instanceof LiveSwAnchorActivity) {
RelativeLayout.LayoutParams layoutParamsredPacket = (RelativeLayout.LayoutParams) redPacket.getLayoutParams(); RelativeLayout.LayoutParams layoutParamsredPacket = (RelativeLayout.LayoutParams) redPacket.getLayoutParams();
layoutParamsredPacket.topMargin = DpUtil.dp2px(110); layoutParamsredPacket.topMargin = DpUtil.dp2px(110);
redPacket.setLayoutParams(layoutParamsredPacket); redPacket.setLayoutParams(layoutParamsredPacket);
@ -2135,7 +2525,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void setLiveUid(String liveUid) { public void setLiveUid(String liveUid) {
mLiveUid = liveUid; mLiveUid = liveUid;
LiveHttpUtil.getAnchorActiveImgStatus(mLiveUid, new HttpCallback() { /*LiveHttpUtil.getAnchorActiveImgStatus(mLiveUid, new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && imgEvent != null) { if (code == 0 && imgEvent != null) {
@ -2158,7 +2548,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
} }
} }
}); });*/
} }
//获取心愿单列表 //获取心愿单列表
@ -4600,6 +4990,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
content = jsonObject.getString("content"); content = jsonObject.getString("content");
name = jsonObject.getString("user_nicename"); name = jsonObject.getString("user_nicename");
lt_trickery.setVisibility(View.VISIBLE); lt_trickery.setVisibility(View.VISIBLE);
prank_group_turntable_icon.setVisibility(View.GONE);
lt_trickery.setBackground(mContext.getResources().getDrawable(R.mipmap.img_buoy)); lt_trickery.setBackground(mContext.getResources().getDrawable(R.mipmap.img_buoy));
isClose = false; isClose = false;
starTimeloud(1, time); starTimeloud(1, time);
@ -4643,6 +5034,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
countDownTimerTrickery.cancel(); countDownTimerTrickery.cancel();
countDownTimerTrickery = null; countDownTimerTrickery = null;
lt_trickery.setVisibility(View.GONE); lt_trickery.setVisibility(View.GONE);
if(!CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
prank_group_turntable_icon.setVisibility(View.VISIBLE);
}
LiveNetManager.get(mContext).endPrankTurntable(mLiveUid, new com.yunbao.common.http.base.HttpCallback<BaseModel>() { LiveNetManager.get(mContext).endPrankTurntable(mLiveUid, new com.yunbao.common.http.base.HttpCallback<BaseModel>() {
@Override @Override
public void onSuccess(BaseModel data) { public void onSuccess(BaseModel data) {
@ -4677,6 +5071,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
starTimeloud(2, time); starTimeloud(2, time);
} else { } else {
lt_trickery.setVisibility(View.GONE); lt_trickery.setVisibility(View.GONE);
if(!CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
prank_group_turntable_icon.setVisibility(View.VISIBLE);
}
timeOver(); timeOver();
} }
} }

View File

@ -89,6 +89,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
private TextView mLiveTimeTextView;//主播的直播时长 private TextView mLiveTimeTextView;//主播的直播时长
private long mAnchorLiveTime;//主播直播时间 private long mAnchorLiveTime;//主播直播时间
private LiveRoomHandler mLiveRoomHandler; private LiveRoomHandler mLiveRoomHandler;
private TextView menuRed;
private static LinearLayout btn_end_pk_dr; private static LinearLayout btn_end_pk_dr;
private String drpkRoomId; //多人 PK 房主 roomUid private String drpkRoomId; //多人 PK 房主 roomUid
private ImageView leaveImg; private ImageView leaveImg;
@ -237,6 +238,8 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
mLiveTimeTextView = (TextView) findViewById(R.id.live_time); mLiveTimeTextView = (TextView) findViewById(R.id.live_time);
mLiveTimeTextView.setVisibility(View.VISIBLE); mLiveTimeTextView.setVisibility(View.VISIBLE);
mLiveRoomHandler = new LiveRoomHandler(); mLiveRoomHandler = new LiveRoomHandler();
menuRed = (TextView) findViewById(R.id.red_menu);
} }
private Map<String, String> yaoqing = new HashMap<>(); private Map<String, String> yaoqing = new HashMap<>();
@ -719,4 +722,12 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
} }
return now + time + -now % 1000; return now + time + -now % 1000;
} }
public void closeMenuRed(){
menuRed.setVisibility(View.GONE);
}
public boolean isShowMenuRed(){
return menuRed.getVisibility()==View.VISIBLE;
}
} }

View File

@ -231,6 +231,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private static int waitShowTopBannerTime = 6000; private static int waitShowTopBannerTime = 6000;
private boolean isSw; private boolean isSw;
private boolean isShowPrank = true;
public PortraitLiveManager setQuitF(boolean quitF) { public PortraitLiveManager setQuitF(boolean quitF) {
isQuitF = quitF; isQuitF = quitF;
@ -337,6 +338,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
loading.setVisibility(View.GONE); loading.setVisibility(View.GONE);
enterRoomLeaveHandler.post(enterRoomLeaveRunnable); enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
OpenAdManager.getInstance().show(OpenAdManager.TYPE_LIVE, LiveGuardInfo.isGuard(mLiveGuardInfo)); OpenAdManager.getInstance().show(OpenAdManager.TYPE_LIVE, LiveGuardInfo.isGuard(mLiveGuardInfo));
} }
}; };
final Runnable loadTimeoutRunnableGone = new Runnable() { final Runnable loadTimeoutRunnableGone = new Runnable() {
@ -406,8 +408,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null); mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null);
if (isSw) { if (isSw) {
mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveSwLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
} else { } else {
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveRyLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
} }
mLivePlayViewHolder.initSwEngine(mLiveBean.getUid()); mLivePlayViewHolder.initSwEngine(mLiveBean.getUid());
mLivePlayViewHolder.addToParent(); mLivePlayViewHolder.addToParent();
@ -432,10 +436,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
if (isSw) { if (isSw) {
if (mLiveSwLinkMicPkPresenter == null) { if (mLiveSwLinkMicPkPresenter == null) {
mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveSwLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
} }
} else { } else {
if (mLiveRyLinkMicPkPresenter == null) { if (mLiveRyLinkMicPkPresenter == null) {
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveRyLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
} }
} }
@ -724,6 +730,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLivePlayViewHolder.setPkView(connection_info.getPkuid()); mLivePlayViewHolder.setPkView(connection_info.getPkuid());
} }
} }
isShowPrank = false;
} }
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.pkHandler = false; mLiveRoomViewHolder.pkHandler = false;
@ -751,6 +758,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} else { } else {
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean); mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
} }
isShowPrank = false;
} else if (!pkInfo.getString("end_pk_time").equals("0")) { } else if (!pkInfo.getString("end_pk_time").equals("0")) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.pkHandler = true; mLiveRoomViewHolder.pkHandler = true;
@ -769,6 +777,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} else { } else {
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean); mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
} }
isShowPrank = false;
} else { } else {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.initPkRank(null); mLiveRoomViewHolder.initPkRank(null);
@ -806,6 +815,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time")); upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time"));
isShowPrank = false;
} }
if (data.getEnterRoomInfo().getGuard() != null) { if (data.getEnterRoomInfo().getGuard() != null) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
@ -890,7 +900,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())) { if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())) {
mLiveRoomViewHolder.onSendMoneyLong(); mLiveRoomViewHolder.onSendMoneyLong();
} }
//初始化整蠱列表
mLiveRoomViewHolder.initPrankProgress(isShowPrank?1:2);
} }
@Override @Override
@ -1945,6 +1956,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
} }
//整蛊进度数据更新
@Override
public void onUpdatePrankProgress(String prankString) {
if (mLiveRoomViewHolder != null){
mLiveRoomViewHolder.refreshPrank(prankString);
}
}
private PagerAdapter pagerAdapter = new PagerAdapter() { private PagerAdapter pagerAdapter = new PagerAdapter() {
@Override @Override
public int getCount() { public int getCount() {

View File

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

View File

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

View File

@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="68dp" android:height="23dp"> <item android:width="68dp" android:height="23dp">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="#ff8873d8" /> <solid android:color="#F4B700" />
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" android:bottomLeftRadius="12dp" android:bottomRightRadius="12dp" /> <corners android:topLeftRadius="12dp" android:topRightRadius="12dp" android:bottomLeftRadius="12dp" android:bottomRightRadius="12dp" />
</shape> </shape>
</item> </item>

View File

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

View File

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

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="93dp" android:height="28dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#fff6b600" android:endColor="#fff6b600" android:angle="90" />
<corners android:topLeftRadius="6dp" android:topRightRadius="6dp" android:bottomLeftRadius="6dp" android:bottomRightRadius="6dp" />
</shape>
</item>
</selector>

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

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

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="1dp"/>
<solid android:color="#FFA5A193"/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="1dp"/>
<solid android:color="#FFFFC949"/>
</shape>
</clip>
</item>
</layer-list>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="330dp" android:layout_height="330dp"
android:background="#000002"> android:background="#000002">
@ -12,9 +13,10 @@
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tabIndicatorColor="#F6F7FB"
app:tabIndicator="@drawable/random_pk_shape_tab_indicator" app:tabIndicator="@drawable/random_pk_shape_tab_indicator"
app:tabIndicatorColor="#F6F7FB"
app:tabIndicatorFullWidth="false" app:tabIndicatorFullWidth="false"
app:tabTextAppearance="@style/PrankTabLayoutTextStyle"
app:tabMaxWidth="100dp" app:tabMaxWidth="100dp"
app:tabMode="scrollable" app:tabMode="scrollable"
app:tabSelectedTextColor="#F6F7FB" app:tabSelectedTextColor="#F6F7FB"
@ -28,20 +30,67 @@
android:layout_width="67dp" android:layout_width="67dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="15dp"
android:background="@drawable/bg_live_prank_turntable_save" android:background="@drawable/bg_live_prank_turntable_save"
android:gravity="center" android:gravity="center"
android:textColor="#FFF" android:textColor="#FFF"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@+id/help"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<include <include
layout="@layout/view_live_prank_turntable" layout="@layout/view_live_prank_turntable"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toTopOf="@+id/button_layout"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/prank_tabLayout" /> app:layout_constraintTop_toBottomOf="@+id/prank_tabLayout" />
<ImageView
android:id="@+id/help"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="17dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/ic_zl_rule" />
<LinearLayout
android:id="@+id/button_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
android:id="@+id/btn_clear"
android:layout_width="106dp"
android:layout_height="38dp"
android:layout_marginEnd="26dp"
android:background="@drawable/bg_live_prank_btn_cancel"
android:textColor="#FFFFFF"
android:text="@string/live_prank_dialog_clear"
android:textAllCaps="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<Button
android:id="@+id/btn_save"
android:layout_width="106dp"
android:layout_height="38dp"
android:background="@drawable/bg_live_prank_btn_save"
android:text="@string/live_prank_dialog_save"
android:textColor="#FFFFFF"
android:textAllCaps="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="330dp"
android:background="#000002">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/live_prank_gift_add_title"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/prank_btn"
android:layout_width="67dp"
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_live_prank_turntable_save"
android:gravity="center"
android:text="@string/alive_prank_gift_add_gift_content_sub"
android:textAllCaps="false"
android:textColor="#FFF"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/back"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginStart="16dp"
android:layout_marginTop="18dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_back" />
<LinearLayout
android:id="@+id/gift_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="16dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="65dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:gravity="center|left"
android:text= "@string/live_prank_gift_add_gift"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<TextView
android:id="@+id/gift_text"
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_gravity="center"
android:background="@drawable/bg_prank_coin"
android:drawableEnd="@mipmap/ic_prank_gift_add_gift_to"
android:ems="10"
android:gravity="start|center"
android:hint="@string/live_prank_gift_add_gift_select"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
android:textColor="#FFFFFF"
android:textColorHint="#8C8C8C"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/prank_turntable_title" />
</LinearLayout>
<LinearLayout
android:id="@+id/giftNumberLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="65dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:gravity="center|left"
android:text="@string/live_prank_gift_add_gift_number"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<TextView
android:id="@+id/number_text"
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_gravity="center"
android:background="@drawable/bg_prank_coin"
android:drawableEnd="@mipmap/ic_prank_gift_add_gift_to"
android:ems="10"
android:gravity="start|center"
android:hint="@string/live_prank_gift_add_gift_number_select"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
android:textColor="#FFFFFF"
android:textColorHint="#8C8C8C"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/prank_turntable_title" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="65dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:gravity="center|left"
android:text="@string/live_prank_gift_add_gift_content"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<EditText
android:id="@+id/content_text"
android:layout_width="match_parent"
android:layout_height="43dp"
android:layout_gravity="center"
android:background="@drawable/bg_prank_coin"
android:ems="20"
android:maxLength="20"
android:gravity="start|center"
android:hint="@string/live_prank_gift_add_gift_contnet_select"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:singleLine="true"
android:textColor="#FFFFFF"
android:textColorHint="#8C8C8C"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/prank_turntable_title" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="330dp"
android:background="#000002">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/alive_prank_gift_dialog_number_title"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/prank_btn"
android:layout_width="67dp"
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_live_prank_turntable_save"
android:gravity="center"
android:text="@string/alive_prank_gift_add_gift_content_sub"
android:textAllCaps="false"
android:textColor="#FFF"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/back"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginStart="16dp"
android:layout_marginTop="18dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_back" />
<LinearLayout
android:id="@+id/gift_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/numberList"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="3"
tools:listitem="@layout/item_prank_dialog_add_gift_number" />
</LinearLayout>
<Button
android:id="@+id/btnNumber"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="@drawable/bg_prank_gift_add_item"
android:text="@string/live_prank_gift_dialog_number_btn"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="400dp"
android:orientation="vertical"
android:paddingBottom="20dp"
android:background="#000002">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/back"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginStart="16dp"
android:layout_marginTop="18dp"
app:srcCompat="@mipmap/icon_back" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginRight="18dp"
android:gravity="center_horizontal"
android:text="@string/alive_prank_gift_dialog_explain"
android:textColor="#FFFFFF"
android:textSize="16sp" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical">
</TextView>
</ScrollView>
</LinearLayout>

View File

@ -27,7 +27,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:background="@drawable/bg_live_prank_gift_add" android:background="@drawable/bg_live_prank_turntable_save"
android:gravity="center" android:gravity="center"
android:text="@string/live_gift_dialog_select_add" android:text="@string/live_gift_dialog_select_add"
android:textColor="#FFF" android:textColor="#FFF"

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="SmallSp"
android:layout_width="match_parent"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_height="21dp">
<ImageView
android:id="@+id/combo_item_icon"
android:layout_width="14dp"
android:layout_height="14dp"/>
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/combo_item_prank_name"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed-medium"
android:textSize="8sp"
android:textColor="@color/white"
android:layout_marginStart="1dp" />
<TextView
android:id="@+id/combo_item_combo"
android:layout_width="wrap_content"
android:minWidth="12dp"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:textStyle="bold"
android:text="12"
android:textColor="#FFFFC949"
android:textSize="8sp"/>
</LinearLayout>

View File

@ -234,6 +234,49 @@
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/prank_open_live_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:background="@drawable/chat_message_bg"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/prank_open_live_msg"
android:layout_width="match_parent"
android:paddingStart="10dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="5dp"
android:layout_weight="0.5"
android:clickable="false"
android:enabled="false"
android:gravity="start"
android:text="@string/prank_open_live_msg"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<TextView
android:id="@+id/prank_to_setting"
android:layout_width="54dp"
android:layout_height="26dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="11dp"
android:text="@string/prank_im_immediately_go"
android:gravity="center"
android:textColor="@color/white"
android:background="@drawable/prank_msg_goto"
android:textSize="10dp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<LinearLayout <LinearLayout
android:id="@+id/xyd_complete" android:id="@+id/xyd_complete"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -1,93 +1,49 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="40dp"
android:gravity="center_vertical"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/bg_prank_gift_item"> android:background="@drawable/bg_prank_gift_item">
<ImageView <ImageView
android:id="@+id/gift_icon" android:id="@+id/gift_icon"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginStart="11dp" android:layout_marginStart="11dp"
android:layout_marginTop="11dp"
android:layout_marginBottom="11dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/gift_title" android:id="@+id/gift_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="7dp" android:text="TextView"
android:gravity="top" android:textColor="#FFF"
android:textSize="14sp"
/>
<TextView
android:id="@+id/gift_title"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingEnd="10dp"
android:paddingLeft="8dp"
android:text="TextView" android:text="TextView"
android:textColor="#FFF69F" android:textColor="#FFF69F"
android:textSize="12sp" android:textSize="14sp" />
app:layout_constraintStart_toEndOf="@+id/gift_icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/gift_close" android:id="@+id/gift_close"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_live_prank_gift_item_close" /> app:srcCompat="@mipmap/icon_live_prank_gift_item_close" />
<TextView </LinearLayout>
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/live_gift"
android:textColor="#808080"
android:textSize="10sp"
app:layout_constraintStart_toEndOf="@+id/gift_icon"
app:layout_constraintTop_toBottomOf="@+id/gift_title" />
<TextView
android:id="@+id/gift_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="TextView"
android:textColor="#FFF"
android:textSize="10sp"
app:layout_constraintStart_toEndOf="@+id/textView5"
app:layout_constraintTop_toBottomOf="@+id/gift_title" />
<TextView
android:id="@+id/gift_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_marginEnd="24dp"
android:text="1"
android:textColor="#FFF"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gift_close" />
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:layout_marginEnd="8dp"
android:text="@string/lucky_red_envelope_amount"
android:textColor="#808080"
android:textSize="10sp"
app:layout_constraintEnd_toStartOf="@+id/gift_num"
app:layout_constraintTop_toBottomOf="@+id/gift_close" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -10,7 +10,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="轉盤一號位" android:text="轉盤一號位"
android:textColor="#FFF69F" android:textColor="#FFFFFF"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -21,7 +21,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:text="抽取幾率40%" android:text="抽取幾率40%"
android:textColor="#80CEF2" android:textColor="#747474"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintStart_toEndOf="@+id/prank_turntable_title" app:layout_constraintStart_toEndOf="@+id/prank_turntable_title"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@ -16,6 +16,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:gravity="top" android:gravity="top"
android:padding="5dp" android:padding="5dp"
android:maxLength="200"
android:hint="@string/video_report_tip_2" android:hint="@string/video_report_tip_2"
android:textColor="@color/textColor" android:textColor="@color/textColor"
android:textSize="14sp" android:textSize="14sp"

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools">
<Button
android:id="@+id/coin"
android:layout_width="93dp"
android:layout_height="28dp"
android:background="@drawable/bg_prank_coin"
tools:baclground="@drawable/bg_prank_btn_gift_add_number"
android:text="123"
android:layout_marginBottom="20dp"
android:textColor="#FFFFFF"
android:textSize="14sp" />
</LinearLayout>

View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_marginTop="3dp"
android:background="@drawable/bg_prank_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="SmallSp">
<TextView
android:id="@+id/prank_item_subscript"
android:layout_width="15dp"
android:layout_height="11dp"
android:gravity="center"
android:background="@drawable/bg_prank_item_subscript"
android:textStyle="bold"
android:text="1"
android:textColor="#FFF9B003"
android:textSize="8sp"/>
<LinearLayout
android:id="@+id/nameLayout"
android:layout_width="match_parent"
android:visibility="visible"
tools:visibility="gone"
android:layout_height="16dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/prank_item_icon"
android:layout_marginEnd="3dp"
android:layout_width="14dp"
android:layout_height="14dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/prank_item_prank_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:fontFamily="sans-serif-condensed-medium"
android:textColor="@color/white"
android:textSize="8sp"
android:text="跳舞跳舞跳"/>
<ProgressBar
android:id="@+id/prank_item_progress"
android:layout_width="match_parent"
android:layout_height="2dp"
android:progress="50"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:progressDrawable="@drawable/progress_prank_bg" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/progressLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:visibility="visible"
tools:visibility="gone"
android:layout_marginEnd="3dp"
android:orientation="horizontal">
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/prank_item_gift_name"
android:layout_width="17dp"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="8sp"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:ellipsize="marquee"
android:text="气球"
android:fontFamily="sans-serif-condensed-medium"/>
<TextView
android:id="@+id/prank_item_now_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="1dp"
android:textStyle="bold"
android:textSize="8sp"
android:textColor="#FFFFC949"
android:text="12"/>
<TextView
android:id="@+id/prank_item_total_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="6sp"
android:text="/45"/>
</LinearLayout>
<LinearLayout
android:id="@+id/anLayout"
android:visibility="gone"
android:layout_marginBottom="5dp"
android:layout_marginEnd="5dp"
android:layout_marginStart="5dp"
android:layout_marginTop="2dp"
android:gravity="center_vertical"
tools:visibility="visible"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/an_prank_name"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:marqueeRepeatLimit="marquee_forever"
android:fontFamily="sans-serif-condensed-medium"
android:textColor="@color/white"
android:textSize="8sp"
android:text="跳舞跳舞跳"/>
<TextView
android:id="@+id/an_prank_remove"
android:layout_width="20dp"
android:text="@string/prank_complete"
android:layout_marginLeft="5dp"
android:layout_gravity="end"
android:gravity="center"
android:paddingBottom="1dp"
android:textColor="#372B2B"
android:background="@drawable/bg_prank_an_once"
android:textSize="6dp"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>

View File

@ -1,8 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@ -11,7 +21,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="visible"> android:visibility="visible"
tools:visibility="visible">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/turntable_config_layout" android:id="@+id/turntable_config_layout"
@ -24,20 +35,22 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:text="@string/prank_switch" android:text="@string/prank_switch"
android:textColor="#A992FF" android:textColor="#FFFFFF"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/switch1_desc_text" android:id="@+id/switch1_desc_text"
android:layout_width="300dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:layout_marginEnd="10dp"
android:maxLines="2"
android:text="@string/see_the_contents_of" android:text="@string/see_the_contents_of"
android:textColor="#B3B3B3" android:textColor="#B3B3B3"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toStartOf="@+id/switch1_btn"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch1_title_text" /> app:layout_constraintTop_toBottomOf="@+id/switch1_title_text" />
@ -59,13 +72,15 @@
<TextView <TextView
android:id="@+id/switch2_title_text" android:id="@+id/switch2_title_text"
android:layout_width="270dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:layout_marginEnd="10dp"
android:maxLines="2"
android:text="@string/diamonds_every_time" android:text="@string/diamonds_every_time"
android:textColor="#A992FF" android:textColor="#FFFFFF"
app:layout_constraintEnd_toStartOf="@+id/switch2_btn"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -95,22 +110,132 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/gift_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="gone">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/gift_config_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/gift_switch1_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/live_prank_switch"
android:textColor="#FFFFFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/gift_switch1_desc_text"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/live_prank_switch_info"
android:textColor="#B3B3B3"
android:textSize="10sp"
app:layout_constraintRight_toLeftOf="@+id/gift_switch1_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gift_switch1_title_text" />
<ImageView
android:id="@+id/gift_switch1_btn"
android:layout_width="47dp"
android:layout_height="23dp"
android:layout_marginEnd="12dp"
android:tag="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/special_icon_off" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/gift_type_now_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:text="@string/live_prank_dialog_gift_type_achieved"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<TextView
android:id="@+id/gift_type_todo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginStart="10dp"
android:text="@string/live_prank_dialog_gift_type_todo"
android:textColor="#DDDDDD"
android:textSize="10sp" />
<TextView
android:id="@+id/gift_type_now_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginStart="5dp"
android:layout_marginEnd="16dp"
android:drawableEnd="@mipmap/ic_prank_gift_switch"
android:text="@string/live_prank_dialog_gift_type_number"
android:textColor="#DDDDDD"
android:textSize="10sp"
app:drawableEndCompat="@mipmap/ic_prank_gift_switch" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/prank_config" android:id="@+id/prank_config"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="10dp" /> android:layout_marginEnd="10dp"
android:layout_weight="1" />
<Button
android:id="@+id/gift_add_btn"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_prank_gift_add_item"
android:text="@string/live_prank_add_gift"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<TextView <TextView
android:id="@+id/gift_prank_not_date" android:id="@+id/gift_prank_not_date"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="250dp" android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center" android:gravity="center"
android:text="@string/prank_content_yet_hint" android:text="@string/live_prank_gift_tips"
android:textColor="#BFBFBF" android:textColor="#747474"
android:visibility="gone" /> android:visibility="visible" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -1211,17 +1211,44 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="51dp" android:layout_height="51dp"
android:translationX="500dp" android:translationX="500dp"
android:visibility="invisible"
tools:translationX="0dp" tools:translationX="0dp"
tools:visibility="visible" tools:visibility="visible">
android:visibility="invisible">
<ImageView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/full_service_notice_new_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="13dp" android:layout_marginStart="13dp"
android:layout_marginEnd="7dp" android:layout_marginEnd="7dp">
<ImageView
android:id="@+id/full_service_notice_new_bg"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="3dp"
android:scaleType="fitXY" android:scaleType="fitXY"
android:src="@mipmap/background_full_service_notice_new" /> android:src="@mipmap/full_service_notice_new_tmp_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/full_service_notice_new_icon"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginStart="0dp"
android:scaleType="fitCenter"
android:src="@mipmap/full_service_notice_new_tmp_icon"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -1248,7 +1275,7 @@
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:text="字文文字文字文字文字fdsfsdfdsfdsfsdfdsfsdf文字文字" android:text="测试"
android:textColor="#fff" android:textColor="#fff"
android:textSize="13sp" /> android:textSize="13sp" />
@ -1256,6 +1283,7 @@
android:id="@+id/iv_look_full_service_notice_new3" android:id="@+id/iv_look_full_service_notice_new3"
android:layout_width="56dp" android:layout_width="56dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_marginBottom="1dp"
android:layout_marginEnd="5dp"> android:layout_marginEnd="5dp">
<ImageView <ImageView
@ -1269,6 +1297,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:clickable="true" android:clickable="true"
tools:text="btn"
tools:textColor="@color/white"
android:gravity="center" android:gravity="center"
android:textSize="12sp" /> android:textSize="12sp" />
</FrameLayout> </FrameLayout>
@ -1472,14 +1502,6 @@
android:background="@color/white" android:background="@color/white"
android:visibility="invisible" /> android:visibility="invisible" />
<include
android:id="@+id/vote_layout"
layout="@layout/sim_live_room_vote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/icon_pk_top" android:id="@+id/icon_pk_top"
android:layout_width="110dp" android:layout_width="110dp"
@ -2365,6 +2387,34 @@
android:gravity="bottom" android:gravity="bottom"
android:orientation="vertical"> android:orientation="vertical">
<!--整蛊进度列表-->
<include
android:id="@+id/prank_group"
android:visibility="gone"
tools:visibility="visible"
layout="@layout/view_prank_group"/>
<pl.droidsonroids.gif.GifImageView
android:id="@+id/prank_small_icon"
android:layout_gravity="end"
android:visibility="gone"
android:layout_width="23dp"
android:layout_height="33dp"
android:layout_marginBottom="5dp"
/>
<ImageView
android:id="@+id/prank_group_turntable_icon"
android:src="@mipmap/turntable_icon"
android:layout_gravity="end"
android:visibility="gone"
android:layout_marginBottom="5dp"
tools:visibility="visible"
android:layout_marginEnd="16dp"
android:layout_width="44dp"
android:layout_height="46dp"/>
<LinearLayout <LinearLayout
android:id="@+id/sud_game_min" android:id="@+id/sud_game_min"
android:layout_width="75dp" android:layout_width="75dp"
@ -2397,11 +2447,12 @@
android:layout_width="52dp" android:layout_width="52dp"
android:layout_height="76dp" android:layout_height="76dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginRight="5dp" android:layout_gravity="end"
android:layout_marginEnd="16dp"
android:visibility="gone" android:visibility="gone"
app:delay_time="5000" app:delay_time="5000"
app:indicator_height="8dp" tools:visibility="visible"
app:indicator_width="8dp" /> app:indicator_height="8dp" />
<LinearLayout <LinearLayout
android:id="@+id/lt_trickery" android:id="@+id/lt_trickery"
@ -2549,6 +2600,15 @@
android:visibility="gone" /> android:visibility="gone" />
</LinearLayout> </LinearLayout>
<!-- 问答UI-->
<include
android:id="@+id/vote_layout"
layout="@layout/sim_live_room_vote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:visibility="gone" />
<pl.droidsonroids.gif.GifImageView <pl.droidsonroids.gif.GifImageView
android:id="@+id/dr_pk_end_gif" android:id="@+id/dr_pk_end_gif"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginBottom="5dp"
android:layout_marginEnd="3dp"
android:orientation="vertical"
android:layout_width="72dp"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="3dp"
android:background="@drawable/bg_prank_group"
android:orientation="vertical">
<LinearLayout
android:id="@+id/prank_top_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
<TextView
android:id="@+id/prank_group_title"
android:ellipsize="end"
android:textColor="@color/white"
android:textSize="10sp"
android:singleLine="true"
android:textStyle="bold"
android:text="@string/prank_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="SmallSp" />
<ImageView
android:id="@+id/prank_group_top_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginStart="3dp"
tools:visibility="visible"
android:scaleType="centerInside"
android:src="@mipmap/bottom_icon" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_prank"
android:overScrollMode="never"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="6dp"
android:gravity="center">
<TextView
android:id="@+id/prank_group_turntable"
android:background="@drawable/bg_prank_bottom_detail"
android:visibility="gone"
android:padding="3dp"
tools:visibility="visible"
android:textSize="8sp"
android:ellipsize="end"
android:singleLine="true"
android:maxWidth="50dp"
android:textColor="@color/white"
android:fontFamily="sans-serif-condensed-medium"
android:text="@string/turntable_prank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="SmallSp" />
<ImageView
android:id="@+id/prank_group_bottom_icon"
android:layout_width="wrap_content"
android:layout_height="12dp"
android:scaleType="centerInside"
android:layout_weight="1"
android:src="@mipmap/bottom_icon" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -282,5 +282,24 @@
app:dt_left_drawable="@drawable/bg_push_time_point" app:dt_left_drawable="@drawable/bg_push_time_point"
app:dt_left_height="4dp" app:dt_left_height="4dp"
app:dt_left_width="4dp" /> app:dt_left_width="4dp" />
<TextView
android:id="@+id/red_menu"
android:layout_width="6dp"
android:layout_height="6dp"
android:layout_alignTop="@id/btn_function"
android:layout_alignRight="@id/btn_function"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:background="@drawable/live_room_menu_red"
android:gravity="center"
android:includeFontPadding="false"
android:minWidth="14dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:textColor="#fff"
android:textSize="10sp"
android:translationY="-4dp"
android:visibility="visible" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -117,4 +117,33 @@
<string name="live_fans_group_send_gift_tips">Fan group level Of Lv%s Can send this gift</string> <string name="live_fans_group_send_gift_tips">Fan group level Of Lv%s Can send this gift</string>
<string name="live_rad_pack_join_fans_group_tip">Join the fan group can be opened [Join]</string> <string name="live_rad_pack_join_fans_group_tip">Join the fan group can be opened [Join]</string>
<string name="live_rad_pack_join_fans_group_click_tip">Join the fan group to open</string> <string name="live_rad_pack_join_fans_group_click_tip">Join the fan group to open</string>
<string name="prank_progress">Progress</string>
<string name="turntable_prank">To do</string>
<string name="details">Details></string>
<string name="combo_vote">Combo</string>
<string name="combo_vote_more">Most first</string>
<string name="live_prank_dialog_save">Save</string>
<string name="live_prank_dialog_clear">Clear</string>
<string name="live_prank_dialog_gift_type_todo">Switch to</string>
<string name="live_prank_dialog_gift_type_number">highest combo</string>
<string name="live_prank_dialog_gift_type_achieved">Quantity achieved</string>
<string name="live_prank_switch">gift trick switch</string>
<string name="live_prank_switch_info">After closing, the user cannot see the gift trick</string>
<string name="live_prank_add_gift">+ Add gift trick</string>
<string name="live_prank_gift_tips">You can add up to 6, and it is recommended to add 4.</string>
<string name="live_prank_gift_add_title">Add gift</string>
<string name="live_prank_gift_add_gift">Gift</string>
<string name="live_prank_gift_add_gift_select">Choose a gift</string>
<string name="live_prank_gift_add_gift_number">Quantity</string>
<string name="live_prank_gift_add_gift_number_select">Fill in the number</string>
<string name="live_prank_gift_add_gift_content">Content</string>
<string name="live_prank_gift_add_gift_contnet_select">Please enter prank content, such as a dance.</string>
<string name="alive_prank_gift_add_gift_content_sub">confirm</string>
<string name="alive_prank_gift_dialog_number_title">Quantity</string>
<string name="live_prank_gift_dialog_number_btn">+ Set other quantity (up to 9999)</string>
<string name="alive_prank_gift_dialog_explain">Trick instructions</string>
<string name="prank_open_live_msg">Entertainment Tricky has been newly upgraded. Go and set up Tricky content to add more fun to the live broadcast room!</string>
<string name="prank_im_immediately_go">Go now</string>
</resources> </resources>

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