同步PD整蛊内容

同步PD修复内容
调整进游戏房就关掉小窗
This commit is contained in:
zlzw 2024-06-18 14:46:41 +08:00
parent a1635151dc
commit 38a63230eb
94 changed files with 3589 additions and 380 deletions

View File

@ -202,6 +202,8 @@ public class Constants {
public static final String LuckyAngel = "LuckyCheck";//幸运天使
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_DISCONN = 2;
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

@ -56,4 +56,15 @@ public class PrankGiftBean extends BaseModel{
public void setGiftId(String 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

@ -22,7 +22,7 @@ import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.request.transition.Transition;
import com.yunbao.common.R;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.interfaces.OnItemClickListener;
import java.io.File;
import jp.wasabeef.glide.transformations.BlurTransformation;
@ -267,14 +267,20 @@ public class ImgLoader {
.skipMemoryCache(SKIP_MEMORY_CACHE)
.into(imageView);
}
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 (callback != null)
callback.onLoadFailed();
} 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
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {

View File

@ -66,7 +66,9 @@ import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.OpenAdModel;
import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.bean.PrankGiftResultBean;
import com.yunbao.common.bean.PrankHttpTurntableBean;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.bean.QuickGiftSendGiftModel;
import com.yunbao.common.bean.RandomPkUserBean;
import com.yunbao.common.bean.RankPkInfoBean;
@ -520,7 +522,16 @@ public interface PDLiveApi {
* 获取整蛊列表
*/
@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);
/**
* 设置礼物整蛊
@ -528,9 +539,11 @@ public interface PDLiveApi {
@GET("/api/public/?service=Prank.setPrank")
Observable<ResponseModel<List<BaseModel>>> setPrank(
@Query("anchor_id") String anchor_id,
@Query("gift_id") String gift_id,
@Query("gift_num") String gift_num,
@Query("prank_content") String prank_content
@Query("status") String status,
@Query("prank_json") String prank_json,
@Query("prank_type") String prank_type,
@Query("is_cleared") String is_cleared
);
/**
@ -1379,4 +1392,17 @@ public interface PDLiveApi {
);
@GET("/api/public/?service=Tx.getShengwangToken")
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

@ -68,7 +68,9 @@ import com.yunbao.common.bean.NobleTrumpetModel;
import com.yunbao.common.bean.OpenAdModel;
import com.yunbao.common.bean.PkRankBean;
import com.yunbao.common.bean.PrankGiftBean;
import com.yunbao.common.bean.PrankGiftResultBean;
import com.yunbao.common.bean.PrankHttpTurntableBean;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.bean.QuickGiftSendGiftModel;
import com.yunbao.common.bean.RandomPkUserBean;
import com.yunbao.common.bean.RankPkInfoBean;
@ -897,9 +899,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)
.prankList(mLiveUid)
.prankList(mLiveUid,prank_type)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(responseModel -> {
@ -916,12 +918,31 @@ public class LiveNetManager {
}).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)
.setPrank(mLiveUid, gift_id, gift_num, prank_content)
.setPrank(mLiveUid, status, prank_json, prank_type,is_cleared)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(responseModel -> {
@ -3506,6 +3527,31 @@ public class LiveNetManager {
}).isDisposed();
}
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) {
MultipartBody.Part uploadFile = createUploadFile(file);
API.get().pdLiveApi(mContext)

View File

@ -104,6 +104,7 @@ public class OpenAdManager {
return;
}
Collections.sort(data, new AdListComparator());
data.clear();
list = data;
if (isShow) {
if (showType == 0) {

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,10 +182,34 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<RelativeLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_zhenggu" />
android:layout_height="40dp">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
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
android:layout_width="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

@ -1359,11 +1359,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_bhe_game">Noonly enter the game</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="see_the_contents_of">After closing, all users will not be able to see the contents of the turntable</string>
<string name="diamonds_every_time">The turntable consumes diamonds every time</string>
<string name="diamonds_every_time_requirement_of">Minimum requirement of 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="prank_switch">Turntable Trick Switch</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">Each turn of the wheel consumes diamonds</string>
<string name="diamonds_every_time_requirement_of">Starting with at least 1000 diamonds</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="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string>

View File

@ -1549,4 +1549,5 @@
<string name="main_type_theater">短劇</string>
<string name="pking_over">主播正在PK稍後再試</string>
<string name="guard_buy_tips_1">您將花費%s鑽石為主播開通</string>
<string name="prank_complete">完成*1</string>
</resources>

View File

@ -1549,4 +1549,5 @@
<string name="main_type_theater">短劇</string>
<string name="pking_over">主播正在PK稍後再試</string>
<string name="guard_buy_tips_1">您將花費%s鑽石為主播開通</string>
<string name="prank_complete">完成*1</string>
</resources>

View File

@ -1547,4 +1547,5 @@
<string name="main_type_theater">短劇</string>
<string name="pking_over">主播正在PK稍後再試</string>
<string name="guard_buy_tips_1">您將花費%s鑽石為主播開通</string>
<string name="prank_complete">完成*1</string>
</resources>

View File

@ -1360,11 +1360,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_bhe_game">Noonly enter the game</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="see_the_contents_of">After closing, all users will not be able to see the contents of the turntable</string>
<string name="diamonds_every_time">The turntable consumes diamonds every time</string>
<string name="diamonds_every_time_requirement_of">Minimum requirement of 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="prank_switch">Turntable Trick Switch</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">Each turn of the wheel consumes diamonds</string>
<string name="diamonds_every_time_requirement_of">Starting with at least 1000 diamonds</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="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string>
@ -1571,4 +1571,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="main_type_theater" >Theater</string>
<string name="pking_over">The anchor is in PK, please try again later</string>
<string name="prank_complete">once</string>
</resources>

View File

@ -141,4 +141,10 @@
<declare-styleable name="MainMessageChatListItem_Layout">
<attr format="reference|enum" name="autoTextEllipsize"/>
</declare-styleable>
<style name="PrankTabLayoutTextStyle" parent="TextAppearance.Design.Tab">
<item name="textAllCaps">false</item>
<item name="android:textAllCaps">false</item>
</style>
</resources>

View File

@ -771,13 +771,15 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
mLiveSwLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1);
pr = new pkRunnable(pkUid, pkhead, pkname, isLadders);
mHandler.postDelayed(pr, 4000);//3秒后执行Runnable中的run方法
mLiveRoomViewHolder.initAnchorSay();
mLiveRoomViewHolder.closePrankView();
}
} else {
if (mLiveRyLinkMicPkPresenter != null && mLiveRoomViewHolder != null) {
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1);
pr = new pkRunnable(pkUid, pkhead, pkname, isLadders);
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连麦时候主播混流
*/

View File

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

View File

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

View File

@ -19,6 +19,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.lxj.xpopup.XPopup;
import com.lzf.easyfloat.EasyFloat;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.R;
@ -34,6 +35,7 @@ import com.yunbao.common.bean.RoomMicStatusModel;
import com.yunbao.common.bean.SudGameChatImModel;
import com.yunbao.common.bean.SudGameUserModel;
import com.yunbao.common.dialog.SudGameInputPopupWindow;
import com.yunbao.common.event.LiveFloatEvent;
import com.yunbao.common.event.CheckRemainingBalanceEvent;
import com.yunbao.common.event.SubGameEvent;
import com.yunbao.common.event.SudGameSocketImEvent;
@ -71,6 +73,7 @@ import cn.rongcloud.rtc.api.RCRTCRemoteUser;
import cn.rongcloud.rtc.api.RCRTCRoom;
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
import cn.rongcloud.rtc.base.RTCErrorCode;
import io.agora.beautyapi.faceunity.agora.LiveFloatView;
import io.agora.beautyapi.faceunity.agora.SWAuManager;
import io.rong.imlib.IRongCoreCallback;
import io.rong.imlib.IRongCoreEnum;
@ -130,6 +133,8 @@ public class SudSwGameActivity extends AbsActivity implements GameSwMicManager.M
}
});
//进游戏房就关掉小窗
EasyFloat.dismiss("LiveFloatView", true);
// 设置禁用麦克风采集
//RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);

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)) {
Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(giftJson.get(position)));
wishGiftId = null;
}
FrameGiftViewHolder frameGiftViewHolder = (FrameGiftViewHolder) holder;

View File

@ -146,31 +146,13 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
if (code == 0 && info.length > 0) {
JSONObject obj = JSON.parseObject(info[0]);
if (obj != null) {
if (TextUtils.equals(obj.getString("ispk"), "0")) {//自己不在PK可以发起邀请
if(mDrPkNum!=-1){
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()
);
}
return;
}
if (mDrPkNum <= 0) {
if (WordUtil.isNewZh()) {
ToastUtil.show("多人次數已用完");
@ -203,10 +185,44 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
}
});
}else{
if (WordUtil.isNewZh()) {
ToastUtil.show("請先關閉PK");
} else {
ToastUtil.show("Please disable the PK");
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{
if (WordUtil.isNewZh()) {
ToastUtil.show("請先關閉PK");
} else {
ToastUtil.show("Please disable the PK");
}
}
}
}

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.STAR_CHALLENGE_UPGRADE_NOTIFY;
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.WISH_LIST_PROGRESS;
import static com.yunbao.live.bean.LiveChatBean.XYD_COMPLETE;
@ -219,6 +221,10 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
LinearLayoutCompat attentionLayout;
ClipPathCircleImage clipImage2;
LinearLayoutCompat prank_open_live_layout;
TextView prank_open_live_msg;
TextView prank_to_setting;
public Vh(View itemView) {
super(itemView);
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);
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) {
@ -255,9 +265,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.INPUT_DIALOG)
.setOlineUserlistModel(new OlineUserlistModel().setId(bean.getId()).setUserNicename(bean.getUserNiceName())));
}
Log.e("eqwewqeweq", bean.toString());
return true;
}
@ -521,7 +529,29 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
if (!StringUtil.isEmpty(bean.getBubble())) {
new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
}
} else {
} 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{
if (bean.getBubble() != null && !bean.getBubble().equals("")) {
//加载.9图聊天气泡
new LoadDian9TuUtil().loadDian9Tu(mContext, mBg, bean.getBubble(), 1);

View File

@ -11,6 +11,7 @@ import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.utils.Bus;
import com.yunbao.live.R;
import com.yunbao.live.event.LiveGiftItemEvent;
import com.yunbao.live.event.LiveParcelItemRefreshEvent;
import com.yunbao.live.views.LiveParcelItemViewHolder;
import java.util.ArrayList;
@ -56,9 +57,11 @@ public class LiveParcelItemAdapter extends RecyclerView.Adapter {
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++) {
if (giftJson.get(i).getId() == model.getId()) {
if (giftJson.get(i).getId() == liveGiftBean.getId()) {
String giftNum = giftJson.get(i).getGiftNum();
@ -70,10 +73,11 @@ public class LiveParcelItemAdapter extends RecyclerView.Adapter {
number = 0;
}
if (number == 1) {
//如果礼物只剩一个直接移除礼物
giftJson.remove(i);
} 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;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
@ -17,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
@ -107,7 +109,6 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
private ImageView mIcon;
private TextView mTitle;
private TextView mName;
private TextView mNum;
private ImageView mRemove;
public GiftViewHolder(View itemView) {
@ -115,21 +116,19 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
mIcon = itemView.findViewById(R.id.gift_icon);
mTitle = itemView.findViewById(R.id.gift_title);
mName = itemView.findViewById(R.id.gift_name);
mNum = itemView.findViewById(R.id.gift_num);
mRemove = itemView.findViewById(R.id.gift_close);
mRemove.setOnClickListener(v -> {
PrankGiftBean bean = (PrankGiftBean) v.getTag();
onItemClickListener.onItemClick(bean.getGiftId(), (Integer) itemView.getTag());
});
}
@SuppressLint("SetTextI18n")
public void setDate(PrankGiftBean bean, int position) {
ImgLoader.display(mContext, bean.getIcon(), mIcon);
itemView.setTag(position);
mName.setText(bean.getName());
mName.setText(bean.getName()+"*"+bean.getNum());
mTitle.setText(bean.getTitle());
mNum.setText(bean.getNum() + "");
mRemove.setTag(bean);
}
@ -148,11 +147,11 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
context = itemView.findViewById(R.id.prank_turntable_val);
context.setOnClickListener(v -> {
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
public void onConfirmClick(Dialog dialog, String content) {
if (WordUtil.isSpecialChar(content)) {
ToastUtil.show("整蠱內容不能包含特殊字符");
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容不能包含特殊字符" : "The prank content must not contain special characters");
return;
}
if (content.length() >= 2 && content.length() <= 10) {
@ -205,23 +204,67 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
probability.setText(getProbability(bean.getId(), mContext));
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);
}
private String getChineseNum(int id) {
switch (id) {
case 1:
return "";
case 2:
return "";
case 3:
return "";
case 4:
return "";
case 5:
return "";
case 6:
return "";
if(WordUtil.isNewZh()){
switch (id) {
case 1:
return "";
case 2:
return "";
case 3:
return "";
case 4:
return "";
case 5:
return "";
case 6:
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 "";
}
@ -245,17 +288,17 @@ public class LivePrankRecyclerAdapter extends RecyclerView.Adapter<LivePrankRecy
} else {
switch (id) {
case 1:
return "Extraction probability40%";
return "Chance of extraction: 40%";
case 2:
return "Extraction probability30%";
return "Chance of extraction: 30%";
case 3:
return "Extraction probability15%";
return "Chance of extraction: 15%";
case 4:
return "Extraction probability10%";
return "Chance of extraction: 10%";
case 5:
return "Extraction probability4%";
return "Chance of extraction: 4%";
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 BLIND_BOX = 409;//盲盒礼物消息
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 userNiceName;
@ -68,6 +69,14 @@ public class LiveChatBean {
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) {
this.giftName = giftName;
return this;

View File

@ -217,7 +217,7 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
for (int i = 0; i < list.size(); i++) {
JSONObject data = list.getJSONObject(i);
GiftTopBean giftTopBean = new GiftTopBean();
giftTopBean.setName(WordUtil.isNewZh()?data.getString("name"):data.getString("en_name"));
giftTopBean.setName(WordUtil.isNewZh() ? data.getString("name") : data.getString("en_name"));
name.add(giftTopBean);
}
@ -265,17 +265,17 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
public void onClick(View view) {
int id = view.getId();
if (id == R.id.btn_send) {
DialogUitl.showSimpleInputDialog(mContext, WordUtil.isNewZh() ?"輸入數量":"Input quantity", DialogUitl.INPUT_TYPE_NUMBER, new DialogUitl.SimpleCallback() {
DialogUitl.showSimpleInputDialog(mContext, WordUtil.isNewZh() ? "輸入數量" : "Input quantity", DialogUitl.INPUT_TYPE_NUMBER, new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
try {
prangNum = Integer.parseInt(content);
if (prangNum <= 0) {
ToastUtil.show(WordUtil.isNewZh() ?"數量不能為0或負數":"The quantity cannot be zero or negative");
ToastUtil.show(WordUtil.isNewZh() ? "數量不能為0或負數" : "The quantity cannot be zero or negative");
return;
}
if (prangNum > 999) {
ToastUtil.show(WordUtil.isNewZh() ?"數量不能大於999":"The number cannot be greater than 999");
ToastUtil.show(WordUtil.isNewZh() ? "數量不能大於999" : "The number cannot be greater than 999");
return;
}
mBtnSend.setText(content);
@ -285,7 +285,7 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
dialog.dismiss();
} catch (Exception e) {
e.printStackTrace();
ToastUtil.show(WordUtil.isNewZh() ? "輸入錯誤":"Input error");
ToastUtil.show(WordUtil.isNewZh() ? "輸入錯誤" : "Input error");
}
}
});
@ -307,29 +307,29 @@ public class GiftPopDialog extends AbsDialogPopupWindow implements ActionListene
});
} else if (id == R.id.gift_btn) {
if (bean == null) {
ToastUtil.show(WordUtil.isNewZh() ? "整蠱禮物不能為空":"A trick gift can't be empty");
ToastUtil.show(WordUtil.isNewZh() ? "整蠱禮物不能為空" : "A trick gift can't be empty");
return;
}
if (StringUtil.isEmpty(prangContext) || prangNum == 0) {
ToastUtil.show(WordUtil.isNewZh() ?"整蠱內容或數量不能為空":"The content or number of pranks cannot be empty");
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容或數量不能為空" : "The content or number of pranks cannot be empty");
return;
}
if (prangNum >= 999) {
ToastUtil.show(WordUtil.isNewZh() ?"整蠱數量不能過大":"The number of pranks should not be too large");
ToastUtil.show(WordUtil.isNewZh() ? "整蠱數量不能過大" : "The number of pranks should not be too large");
return;
}
if (WordUtil.isSpecialChar(prangContext)) {
ToastUtil.show(WordUtil.isNewZh() ?"整蠱內容不能包含特殊字符":"The prank content must not contain special characters");
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容不能包含特殊字符" : "The prank content must not contain special characters");
return;
}
if (prangContext.length() > 6) {
ToastUtil.show(WordUtil.isNewZh() ?"整蠱內容過長":"The prank is too long");
ToastUtil.show(WordUtil.isNewZh() ? "整蠱內容過長" : "The prank is too long");
return;
}
if (giftBeans != null) {
for (PrankGiftBean giftBean : giftBeans) {
if (giftBean.getGiftId().equals(bean.getId() + "")) {
ToastUtil.show(WordUtil.isNewZh() ?"整蠱禮物已存在":"Prank gifts already exist");
ToastUtil.show(WordUtil.isNewZh() ? "整蠱禮物已存在" : "Prank gifts already exist");
return;
}
}

View File

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

View File

@ -58,7 +58,10 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
private String liveUid;
private TextView red_menu;
// boolean isRy = false;
private boolean isShowRed;
@Override
protected int getLayoutId() {
return R.layout.dialog_live_new_function;
@ -99,6 +102,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
// isRy = bundle.getBoolean("isRy", false);
mAnchorLiveTime = bundle.getLong("liveTime");
liveUid = bundle.getString("liveUid");
isShowRed = bundle.getBoolean("isShowZgRed");
}
mWishView = findViewById(R.id.live_tool_wish);
mPrankView = findViewById(R.id.live_tool_prank);
@ -111,6 +115,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mMicView = findViewById(R.id.live_tool_mic);
mRandomPk = findViewById(R.id.live_tool_random_pk);
mLiveTimeTextView = (TextView) findViewById(R.id.live_time);
red_menu = (TextView) findViewById(R.id.red_menu);
mWishView.setOnClickListener(this);
mPrankView.setOnClickListener(this);
mWksView.setOnClickListener(this);
@ -141,6 +146,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mLiveRoomHandler = new LiveRoomHandler();
mLiveTimeTextView.setText(StringUtil.getDurationText(mAnchorLiveTime));
startAnchorLiveTime();
red_menu.setVisibility(isShowRed?View.VISIBLE:View.GONE);
}
public void setFunctionClickListener(LiveFunctionClickListener functionClickListener) {
@ -169,6 +175,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mFunctionClickListener.onClick(LIVE_FUNC_WISHLIST);
} else if (id == R.id.live_tool_prank) {
mFunctionClickListener.onClick(LIVE_FUNC_ZG);
red_menu.setVisibility(View.GONE);
} else if (id == R.id.live_tool_wks) {
mFunctionClickListener.onClick(LIVE_FUNC_WKS);
} 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) {
}
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,137 @@
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.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, 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) {
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;
import static com.yunbao.live.adapter.LivePrankRecyclerAdapter.TYPE_TURNTABLE;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSONArray;
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.PrankGiftResultBean;
import com.yunbao.common.bean.PrankHttpTurntableBean;
import com.yunbao.common.bean.PrankTurntableBean;
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.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ViewUtils;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.R;
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.List;
@ -36,7 +53,7 @@ import java.util.Locale;
public class LivePrankDialogFragment extends AbsDialogFragment implements View.OnClickListener {
private TabLayout mTabLayout;
private View mTurntableConfigLayout;
private View mTurntableConfigLayout, mGiftConfigLayout;
private TextView mPrankBtn;
private ImageView mTurntableConfigImageView;
private TextView mCoinTextView;
@ -45,7 +62,22 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
private LivePrankRecyclerAdapter recyclerAdapter;
private String mLiveUid;
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) {
this.mLiveUid = mLiveUid;
@ -82,11 +114,14 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
initView();
initTab();
initTurntableData();
initGiftConfigLayoutView();
}
private void initView() {
help = (ImageView) findViewById(R.id.help);
mTabLayout = (TabLayout) findViewById(R.id.prank_tabLayout);
mTurntableConfigLayout = findViewById(R.id.turntable_layout);
mGiftConfigLayout = findViewById(R.id.gift_layout);
mTurntableConfigImageView = (ImageView) findViewById(R.id.switch1_btn);
mCoinTextView = (TextView) findViewById(R.id.switch2_btn);
mPrankRecyclerView = (RecyclerView) findViewById(R.id.prank_config);
@ -97,14 +132,19 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
mPrankRecyclerView.setAdapter(recyclerAdapter);
mCoinTextView.setOnClickListener(this);
mTurntableConfigImageView.setOnClickListener(this);
help.setOnClickListener(this);
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
mPrankBtn.setText("保存設置");
mPrankBtn.setText("發送圖標");
} else {
mPrankBtn.setText("Save Settings");
mPrankBtn.setText("send icon");
}
recyclerAdapter.setOnItemClickListener(new OnItemClickListener<String>() {
@Override
public void onItemClick(String bean, int position) {
if (position == -2) {
showGiftDialog();
return;
}
if (recyclerAdapter.getViewTypeOfList()) {
switch (position) {
case 1:
@ -127,21 +167,20 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
break;
}
} else {
LiveNetManager.get(mContext).deletePrankGift(mLiveUid, position + "", new HttpCallback<PrankHttpTurntableBean>() {
@Override
public void onSuccess(PrankHttpTurntableBean data) {
initGiftData();
}
@Override
public void onError(String error) {
initGiftData();
}
});
giftBeans.remove(position);
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);
}
}
}
});
mPrankBtn.setOnClickListener(view -> {
/* mPrankBtn.setOnClickListener(view -> {
if ((int) view.getTag() == 1) {
if (giftBeans != null && giftBeans.size() >= 20) {
@ -173,6 +212,46 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
} else {
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);
}
@ -183,15 +262,15 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
turntable.setText("轉盤整蠱");
gift.setText("禮物整蠱");
}else {
turntable.setText("Turntable prank");
gift.setText("Gift prank");
} else {
turntable.setText("Turntable");
gift.setText("Gift");
}
turntable.setTag(0);
gift.setTag(1);
mTabLayout.addTab(turntable);
mTabLayout.addTab(gift);
mPrankBtn.setTag(0);
mTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
@ -200,32 +279,39 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
}
if ((int) tab.getTag() == 0) {
mTurntableConfigLayout.setVisibility(View.VISIBLE);
mGiftConfigLayout.setVisibility(View.GONE);
mPrankRecyclerView.setVisibility(View.VISIBLE);
mBtnAddGift.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);
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
mPrankBtn.setText("保存設置");
mPrankBtn.setText("發送圖標");
} else {
mPrankBtn.setText("Save Settings");
mPrankBtn.setText("send icon");
}
mPrankBtn.setTag(0);
recyclerAdapter.clearList();
initTurntableData();
mPrankBtn.setVisibility(View.VISIBLE);
} else {
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("添加禮物");
} else {
mPrankBtn.setText("Add gift");
}
}*/
mPrankBtn.setTag(1);
recyclerAdapter.clearList();
mGiftNotDate.setVisibility(View.VISIBLE);
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() {
LiveNetManager.get(mContext).getAnchorPrankTurntable(mLiveUid, new HttpCallback<PrankHttpTurntableBean>() {
@Override
@ -256,11 +409,23 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
});
}
private void setGiftBean(PrankGiftBean bean) {
LiveNetManager.get(mContext).setPrankGift(mLiveUid, bean.getGiftId(), bean.getNum() + "", bean.getTitle(), new HttpCallback<PrankHttpTurntableBean>() {
private void setGiftBean(List<PrankGiftBean> prankGiftBeans,String is_cleared) {
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
public void onSuccess(PrankHttpTurntableBean data) {
initGiftData();
if(!is_cleared.equals("1")){
if (WordUtil.isNewZh()) {
ToastUtil.show("保存成功!");
} else {
ToastUtil.show("successful");
}
}
//通知主播刷新整蛊信息
if(onPrankResultListener!=null){
onPrankResultListener.OpenAndCloseListener();
}
}
@Override
@ -270,26 +435,58 @@ 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() {
LiveNetManager.get(mContext).getPrankGiftList(mLiveUid, new HttpCallback<List<PrankGiftBean>>() {
LiveNetManager.get(mContext).getPrankGiftList(mLiveUid, giftTypeNowText.getTag().toString(), new HttpCallback<PrankGiftResultBean>() {
@Override
public void onSuccess(List<PrankGiftBean> data) {
if (!data.isEmpty()) {
mGiftNotDate.setVisibility(View.GONE);
mPrankRecyclerView.setVisibility(View.VISIBLE);
recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_GIFT);
giftBeans = data;
recyclerAdapter.setList(data);
recyclerAdapter.notifyDataSetChanged();
public void onSuccess(PrankGiftResultBean data) {
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);
}
mPrankRecyclerView.setVisibility(View.VISIBLE);
recyclerAdapter.setViewType(LivePrankRecyclerAdapter.TYPE_GIFT);
giftBeans = data.getPrank_list();
recyclerAdapter.setList(giftBeans);
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 {
mPrankRecyclerView.setVisibility(View.GONE);
mGiftNotDate.setVisibility(View.VISIBLE);
}
}*/
}
@Override
public void onError(String error) {
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred");
}
});
}
@ -303,6 +500,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
list.add(buildBean(4, bean.getTurntable4()));
list.add(buildBean(5, bean.getTurntable5()));
list.add(buildBean(6, bean.getTurntable6()));
recyclerAdapter.setViewType(TYPE_TURNTABLE);
recyclerAdapter.setList(list);
recyclerAdapter.notifyDataSetChanged();
if (bean.getStatus() == 1) {
@ -324,47 +522,53 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
return bean;
}
private void setPrankConfig() {
if (StringUtil.isEmpty(bean.getTurntable1(), bean.getTurntable2(), bean.getTurntable3(), bean.getTurntable4(), bean.getTurntable5(), bean.getTurntable6())) {
private void clearPrankConfig() {
bean = new PrankHttpTurntableBean();
setCoin(1000);
setDate(bean);
}
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存失败:所有转盘位置必填");
} else {
ToastUtil.show("Save failed: all turntable positions must be filled in");
private void setPrankConfig(boolean isClear) {
if(!isClear){
if (StringUtil.isEmpty(bean.getTurntable1(), bean.getTurntable2(), bean.getTurntable3(), bean.getTurntable4(), bean.getTurntable5(), bean.getTurntable6())) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存失败:所有转盘位置必填");
} else {
ToastUtil.show("Save failed: all turntable positions must be filled in");
}
return;
}
return;
}
LiveNetManager.get(mContext).setAnchorPrankTurntable(
mLiveUid,
bean.getCoin() + "",
bean.getTurntable1(),
bean.getTurntable2(),
bean.getTurntable3(),
bean.getTurntable4(),
bean.getTurntable5(),
bean.getTurntable6(),
bean.getStatus() + "",
new HttpCallback<Object>() {
@Override
public void onSuccess(Object data) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存成功");
} else {
ToastUtil.show("Save success");
}
}
@Override
public void onError(String error) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存失败:" + error);
} else {
ToastUtil.show("Save failed" + error);
}
if(isClear){
bean.setTurntable1("");
bean.setTurntable2("");
bean.setTurntable3("");
bean.setTurntable4("");
bean.setTurntable5("");
bean.setTurntable6("");
}
LiveNetManager.get(mContext).setAnchorPrankTurntable(mLiveUid, bean.getCoin() + "", bean.getTurntable1(), bean.getTurntable2(), bean.getTurntable3(), bean.getTurntable4(), bean.getTurntable5(), bean.getTurntable6(), bean.getStatus() + "", new HttpCallback<Object>() {
@Override
public void onSuccess(Object data) {
if(!isClear){
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存成功");
} else {
ToastUtil.show("Save success");
}
}
);
}
@Override
public void onError(String error) {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
ToastUtil.show("保存失败:" + error);
} else {
ToastUtil.show("Save failed" + error);
}
}
});
}
@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 {
private LiveGiftBean liveGiftModel;
private int sendCount;
public int getSendCount() {
return sendCount;
}
public LiveParcelItemRefreshEvent setSendCount(int sendCount) {
this.sendCount = sendCount;
return this;
}
public LiveGiftBean getLiveGiftModel() {
return liveGiftModel;
}

View File

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

View File

@ -72,6 +72,7 @@ import com.yunbao.live.socket.SocketRyLinkMicPkUtil;
import com.yunbao.live.socket.SocketSendBean;
import com.yunbao.live.views.LiveLinkMicPkViewHolder;
import com.yunbao.live.views.LivePushRyViewHolder;
import com.yunbao.live.views.LiveRoomViewHolder;
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) {
super(false);
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);
//展示结束连麦按钮
mLiveAnchorViewHolder.showEndPkBt();
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
}
@ -831,9 +835,15 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
//设置多人PK 房主ROOM UID
mLiveAnchorViewHolder.setDrpkRoomId(mApplyUid);
mLiveAnchorViewHolder.showEndPkBt();
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
}
}
});
}
});
}

View File

@ -346,4 +346,9 @@ public interface SocketMessageListener {
*
*/
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.manager.IMLoginManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
@ -796,5 +797,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.yunbao.common.Constants.SOCKET_LIVE_MSG_TO_USER;
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 android.app.Activity;
@ -14,11 +15,15 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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.CommonAppContext;
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.L;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.ToastUtils;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAudienceActivity;
@ -192,7 +198,7 @@ public class SocketRyClient {
SocketReceiveBean received = JSON.parseObject(socketMsg, SocketReceiveBean.class);
JSONObject map = received.getMsg().getJSONObject(0);
// LogUtils.e("yqw=====>收到的socket:"+map.getString("_method_")+","+map.getString("ct"));
switch (map.getString("_method_")) {
//用户连麦
case Constants.LIAN_MAI:
@ -251,7 +257,7 @@ public class SocketRyClient {
// LiveLinkMicPresenter.setHD(map.getString("ct"));
break;
case Constants.SOCKET_SYSTEM://系统消息
if (map.getString("ct").contains("甜蜜不停")) {
if (map.getString("ct").contains("甜蜜不停")) {
break;
}
UserBean us = CommonAppConfig.getInstance().getUserBean();
@ -290,6 +296,45 @@ public class SocketRyClient {
}
}
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://踢人
systemChatMessage2(map.getString("ct"));
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.live.activity.LiveSwAnchorActivity.isDRPK;
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 android.app.Activity;
@ -14,12 +15,16 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
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.CommonAppContext;
import com.yunbao.common.Constants;
@ -280,6 +285,44 @@ public class SocketSwClient {
}
}
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://踢人
systemChatMessage2(map.getString("ct"));
mListener.onKick(map.getString("touid"));

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));
frameGiftAdapter = new FrameGiftAdapter(contextLayoutGiftHeight, giftJson, mStream, mLiveUid, wishGiftId);
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

View File

@ -77,6 +77,6 @@ public class LiveParcelItemFragment extends BaseFragment {
@Subscribe(threadMode = ThreadMode.MAIN)
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.JSONArray;
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.load.DataSource;
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.RequestOptions;
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.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView;
@ -62,6 +68,8 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.bean.PrankProgressBean;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
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.LiveSwAnchorActivity;
import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.adapter.ComboAdapter;
import com.yunbao.live.adapter.LiveChatAdapter;
import com.yunbao.live.adapter.LiveRoomFastMessageRecyclerViewAdapter;
import com.yunbao.live.adapter.LiveUserAdapter;
import com.yunbao.live.adapter.PrankAdapter;
import com.yunbao.live.bean.DrPkbean;
import com.yunbao.live.bean.LiveBuyGuardMsgBean;
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.LiveGameDialogFragment;
import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LivePrankDialogFragment;
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
import com.yunbao.live.dialog.LiveUserDialogFragment;
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.LiveTextRender;
import com.yunbao.live.utils.LoadDian9TuUtil;
import com.yunbao.live.utils.ZeusKt;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@ -199,6 +211,7 @@ import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -210,6 +223,7 @@ import io.rong.imkit.userinfo.RongUserInfoManager;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.UserInfo;
import com.bumptech.glide.load.resource.gif.GifDrawable;
import pl.droidsonroids.gif.GifImageView;
/**
@ -402,6 +416,24 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private View quick_gift_reminder;
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;
public LiveRoomViewHolder setGuardType(int guardType) {
@ -1340,19 +1372,46 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mLiveChatAdapter.removetItem(bean);
((LiveActivity) mContext).sendChatMessage("Hi~", null, null);
} else if (bean.getType() == -5) {
String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Turntable&a=tricky";
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0);
String url = CommonAppConfig.HOST + "/h5/activity/Turntable/index.html";
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() +
"&active_id=6";
Log.i("tag", url);
Bundle bundle1 = new Bundle();
bundle1.putString("url", url);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle1);
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
if(mContext instanceof LiveAudienceActivity){
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) {
gotoLive(bean.getMsgModel().getAnchorId());
} else if (bean.getType() == bean.STAR_CHALLENGE_UPGRADE_NOTIFY) {
gotoLive(bean.getMsgModel().getLiveUid());
} else {
} else if(bean.getType()==bean.TYPE_TO_ANCHOR_PRANK){
LivePrankDialogFragment fragment = new LivePrankDialogFragment();
fragment.setOnPrankResultListener(new LivePrankDialogFragment.onPrankResultListener() {
@Override
public void OpenAndCloseListener() {
initPrankProgress();
}
});
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{
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.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.btn_follow).setVisibility(View.GONE);
findViewById(R.id.live_rank_pk).setVisibility(View.GONE);
@ -1624,6 +1683,334 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
});
// 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.GONE);
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(){
// 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(true,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();
}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(false,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(boolean 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){
prank_group.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;
@ -1637,7 +2024,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private Runnable timeRunnable = new Runnable() {
@Override
public void run() {
Log.i("红包", "run: 红包倒计时 "+redTimeCountdown);
Log.i("红包", "run: 红包倒计时 " + redTimeCountdown);
if (redTimeCountdown > 1) {
timeHandler.postDelayed(timeRunnable, 1000);
redPacketCountdown.setText(String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(redTimeCountdown)));
@ -1661,7 +2048,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private Runnable anchorTimeRunnable = new Runnable() {
@Override
public void run() {
Log.i("红包", "anchorTimeRunnable run: "+mCountdown);
Log.i("红包", "anchorTimeRunnable run: " + mCountdown);
if (mCountdown > 0) {
mCountdown = mCountdown - 1;
anchorTimeHandler.postDelayed(anchorTimeRunnable, 1000);
@ -1685,10 +2072,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
layoutParams.topMargin = DpUtil.dp2px(110);
dragonImmediateParticipation.setLayoutParams(layoutParams);
} if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
layoutParams.topMargin = DpUtil.dp2px(110);
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
}
if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipation.getLayoutParams();
@ -1725,21 +2108,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
layoutParams.topMargin = DpUtil.dp2px(190);
dragonImmediateParticipation.setLayoutParams(layoutParams);
}
if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE&&mContext instanceof LiveRyAnchorActivity) {
RelativeLayout.LayoutParams layoutParamsredPacket = (RelativeLayout.LayoutParams) redPacket.getLayoutParams();
layoutParamsredPacket.topMargin = DpUtil.dp2px(110);
redPacket.setLayoutParams(layoutParamsredPacket);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) dragonImmediateParticipationTime.getLayoutParams();
layoutParams.topMargin = DpUtil.dp2px(190);
dragonImmediateParticipationTime.setLayoutParams(layoutParams);
}
if (dragonImmediateParticipationTime.getVisibility() == View.GONE&&mContext instanceof LiveRyAnchorActivity){
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) redPacket.getLayoutParams();
layoutParams.topMargin = DpUtil.dp2px(110);
redPacket.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();
layoutParamsredPacket.topMargin = DpUtil.dp2px(110);
redPacket.setLayoutParams(layoutParamsredPacket);
@ -2153,7 +2522,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void setLiveUid(String liveUid) {
mLiveUid = liveUid;
LiveHttpUtil.getAnchorActiveImgStatus(mLiveUid, new HttpCallback() {
/*LiveHttpUtil.getAnchorActiveImgStatus(mLiveUid, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && imgEvent != null) {
@ -2176,7 +2545,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
}
}
});
});*/
}
//获取心愿单列表
@ -4618,6 +4987,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
content = jsonObject.getString("content");
name = jsonObject.getString("user_nicename");
lt_trickery.setVisibility(View.VISIBLE);
prank_group_turntable_icon.setVisibility(View.GONE);
lt_trickery.setBackground(mContext.getResources().getDrawable(R.mipmap.img_buoy));
isClose = false;
starTimeloud(1, time);
@ -4661,6 +5031,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
countDownTimerTrickery.cancel();
countDownTimerTrickery = null;
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>() {
@Override
public void onSuccess(BaseModel data) {
@ -4695,6 +5068,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
starTimeloud(2, time);
} else {
lt_trickery.setVisibility(View.GONE);
if(!CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
prank_group_turntable_icon.setVisibility(View.VISIBLE);
}
timeOver();
}
}

View File

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

View File

@ -637,6 +637,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setVoteData(data.getEnterRoomInfo().getVoteModel());
mLiveRoomViewHolder.updateFansMessageRed();
mLiveRoomViewHolder.setFansGroup(data.getEnterRoomInfo().getIsFans());
//初始化整蛊进度列表
mLiveRoomViewHolder.initPrankProgress();
isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention());
if (isattention == 0) {
@ -723,6 +726,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLivePlayViewHolder.setPkView(connection_info.getPkuid());
}
}
//收起整蠱列表
mLiveRoomViewHolder.closePrankView();
}
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.pkHandler = false;
@ -773,6 +778,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.initPkRank(null);
}
}
//收起整蠱列表
mLiveRoomViewHolder.closePrankView();
//多人PK
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
if (mLiveRoomViewHolder != null) {
@ -805,6 +812,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time"));
//收起整蠱列表
mLiveRoomViewHolder.closePrankView();
}
if (data.getEnterRoomInfo().getGuard() != null) {
if (mLiveRoomViewHolder != null) {
@ -1945,6 +1954,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
}
//整蛊进度数据更新
@Override
public void onUpdatePrankProgress(String prankString) {
if (mLiveRoomViewHolder != null){
mLiveRoomViewHolder.refreshPrank(prankString);
}
}
private PagerAdapter pagerAdapter = new PagerAdapter() {
@Override
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">
<item android:width="68dp" android:height="23dp">
<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" />
</shape>
</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"?>
<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">
@ -12,9 +13,10 @@
android:layout_marginStart="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tabIndicatorColor="#F6F7FB"
app:tabIndicator="@drawable/random_pk_shape_tab_indicator"
app:tabIndicatorColor="#F6F7FB"
app:tabIndicatorFullWidth="false"
app:tabTextAppearance="@style/PrankTabLayoutTextStyle"
app:tabMaxWidth="100dp"
app:tabMode="scrollable"
app:tabSelectedTextColor="#F6F7FB"
@ -28,20 +30,67 @@
android:layout_width="67dp"
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginEnd="15dp"
android:background="@drawable/bg_live_prank_turntable_save"
android:gravity="center"
android:textColor="#FFF"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintEnd_toStartOf="@+id/help"
app:layout_constraintTop_toTopOf="parent" />
<include
layout="@layout/view_live_prank_turntable"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/button_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
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>

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,88 @@
<?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_constraintBottom_toTopOf="@+id/gift_add_btn"
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_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:background="@drawable/bg_live_prank_gift_add"
android:background="@drawable/bg_live_prank_turntable_save"
android:gravity="center"
android:text="@string/live_gift_dialog_select_add"
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
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
android:id="@+id/xyd_complete"
android:layout_width="wrap_content"

View File

@ -1,93 +1,49 @@
<?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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="40dp"
android:gravity="center_vertical"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_prank_gift_item">
<ImageView
android:id="@+id/gift_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="11dp"
android:layout_marginTop="11dp"
android:layout_marginBottom="11dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/gift_title"
android:id="@+id/gift_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="7dp"
android:gravity="top"
android:text="TextView"
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:textColor="#FFF69F"
android:textSize="12sp"
app:layout_constraintStart_toEndOf="@+id/gift_icon"
app:layout_constraintTop_toTopOf="parent" />
android:textSize="14sp" />
<ImageView
android:id="@+id/gift_close"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_live_prank_gift_item_close" />
<TextView
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>
</LinearLayout>

View File

@ -16,6 +16,7 @@
android:layout_marginTop="20dp"
android:gravity="top"
android:padding="5dp"
android:maxLength="200"
android:hint="@string/video_report_tip_2"
android:textColor="@color/textColor"
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,116 +1,241 @@
<?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_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/turntable_layout"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:visibility="visible">
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/turntable_config_layout"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/switch1_title_text"
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/turntable_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/prank_switch"
android:textColor="#A992FF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_marginTop="10dp"
android:orientation="vertical"
android:visibility="visible"
tools:visibility="visible">
<TextView
android:id="@+id/switch1_desc_text"
android:layout_width="300dp"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/turntable_config_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/switch1_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/prank_switch"
android:textColor="#FFFFFF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/switch1_desc_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:ellipsize="end"
android:layout_marginEnd="10dp"
android:maxLines="2"
android:text="@string/see_the_contents_of"
android:textColor="#B3B3B3"
android:textSize="10sp"
app:layout_constraintEnd_toStartOf="@+id/switch1_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch1_title_text" />
<ImageView
android:id="@+id/switch1_btn"
android:layout_width="47dp"
android:layout_height="23dp"
android:layout_marginEnd="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/special_icon_on" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/switch2_title_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:ellipsize="end"
android:layout_marginEnd="10dp"
android:maxLines="2"
android:text="@string/diamonds_every_time"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toStartOf="@+id/switch2_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/switch2_desc_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/diamonds_every_time_requirement_of"
android:textColor="#B3B3B3"
android:textSize="10sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch2_title_text" />
<TextView
android:id="@+id/switch2_btn"
android:layout_width="96dp"
android:layout_height="26dp"
android:layout_marginEnd="12dp"
android:background="@drawable/bg_prank_coin"
android:gravity="center"
android:text="1,000"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</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
android:id="@+id/prank_config"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/see_the_contents_of"
android:textColor="#B3B3B3"
android:textSize="10sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch1_title_text" />
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/switch1_btn"
android:layout_width="47dp"
android:layout_height="23dp"
android:layout_marginEnd="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/special_icon_on" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/switch2_title_text"
android:layout_width="270dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/diamonds_every_time"
android:textColor="#A992FF"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/switch2_desc_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/diamonds_every_time_requirement_of"
android:textColor="#B3B3B3"
android:textSize="10sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch2_title_text" />
<TextView
android:id="@+id/switch2_btn"
android:layout_width="96dp"
android:layout_height="26dp"
android:layout_marginEnd="12dp"
android:background="@drawable/bg_prank_coin"
android:gravity="center"
android:text="1,000"
<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"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:textSize="12sp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<TextView
android:id="@+id/gift_prank_not_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="@string/live_prank_gift_tips"
android:textColor="#747474"
android:visibility="visible" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/prank_config"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp" />
<TextView
android:id="@+id/gift_prank_not_date"
android:layout_width="match_parent"
android:layout_height="250dp"
android:gravity="center"
android:text="@string/prank_content_yet_hint"
android:textColor="#BFBFBF"
android:visibility="gone" />
</LinearLayout>

View File

@ -1472,14 +1472,6 @@
android:background="@color/white"
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
android:id="@+id/icon_pk_top"
android:layout_width="110dp"
@ -2365,6 +2357,34 @@
android:gravity="bottom"
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
android:id="@+id/sud_game_min"
android:layout_width="75dp"
@ -2549,6 +2569,15 @@
android:visibility="gone" />
</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
android:id="@+id/dr_pk_end_gif"
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_height="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>
</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: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -124,4 +124,34 @@
<string name="message_chat_msg_read_tip">[Read]</string>
<string name="message_chat_msg_unread_tip">[Unread]</string>
<string name="message_interactive_chat">發起聊天</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_number">highest combo</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>
<string name="live_prank_dialog_gift_type_todo">Switch to</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_dialog_gift_type_achieved">Quantity achieved</string>
</resources>

View File

@ -123,4 +123,32 @@
<string name="message_chat_msg_unread_tip">[未讀]</string>
<string name="message_interactive_chat">發起聊天</string>
<string name="prank_progress">整蠱進度</string>
<string name="turntable_prank">待完成整蠱</string>
<string name="details">詳情></string>
<string name="combo_vote">連擊投票</string>
<string name="combo_vote_more">連擊最多優先</string>
<string name="alive_prank_gift_dialog_explain">整蠱說明</string>
<string name="prank_open_live_msg">娛樂整蠱全新升級,快去設置整蠱内容,給直播間增加更多趣味吧!</string>
<string name="prank_im_immediately_go">立即前往</string>
<string name="live_prank_dialog_gift_type_todo"> </string>
<string name="live_prank_switch">禮物整蠱開關</string>
<string name="live_prank_switch_info">開閉後用戶無法看到禮物整蠱</string>
<string name="live_prank_add_gift">+ 添加禮物整蠱</string>
<string name="live_prank_gift_tips">最多可添加6個建議添加4個</string>
<string name="live_prank_gift_add_title">添加禮物</string>
<string name="live_prank_gift_add_gift">整蠱禮物</string>
<string name="live_prank_gift_add_gift_select">選擇禮物</string>
<string name="live_prank_gift_add_gift_number">禮物數量</string>
<string name="live_prank_gift_add_gift_number_select">填寫個數</string>
<string name="live_prank_gift_add_gift_content">整蠱內容</string>
<string name="live_prank_gift_add_gift_contnet_select">請輸入整蠱內容,例如一支舞蹈</string>
<string name="alive_prank_gift_add_gift_content_sub">確定</string>
<string name="alive_prank_gift_dialog_number_title">禮物數量</string>
<string name="live_prank_gift_dialog_number_btn">+ 設置其他數量(最多9999)</string>
<string name="live_prank_dialog_gift_type_achieved">連擊數最高</string>
<string name="live_prank_dialog_save">保存設置</string>
<string name="live_prank_dialog_clear">清除設置</string>
<string name="live_prank_dialog_gift_type_number">禮物數達成</string>
</resources>