1:添加背包一键全清功能
2:添加查看心动值列表 3:修改进入小黑屋出现不能收到消息的问题
This commit is contained in:
@@ -395,9 +395,7 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
SpUtil.saveUserId(-1);
|
||||
SpUtil.saveUserBean(new UserBean());
|
||||
SpUtil.putToken("");
|
||||
Intent intent = new Intent("com.xscm.action.LAUNCH_PAGE");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getApplicationContext().startActivity(intent);
|
||||
|
||||
// piaoPingManager.unsubscribe();
|
||||
FileUtils.deleteAllInDir(getCacheDir());
|
||||
FileUtils.deleteAllInDir(getExternalCacheDir());
|
||||
@@ -408,7 +406,9 @@ public class CommonAppContext extends MultiDexApplication {
|
||||
// 发送广播通知所有Activity刷新状态
|
||||
Intent refreshIntent = new Intent("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
sendBroadcast(refreshIntent);
|
||||
|
||||
Intent intent = new Intent("com.xscm.action.LAUNCH_PAGE");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getApplicationContext().startActivity(intent);
|
||||
}
|
||||
|
||||
public static boolean isAlipayInstalled(Context context) {
|
||||
|
||||
@@ -100,6 +100,10 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
public static final int QXRoomMessageTypeMangH = 1056;
|
||||
///巡乐会
|
||||
public static final int QXRoomMessageTypeXlh = 1057;
|
||||
///在离线
|
||||
public static final int QXRoomMessageTypezailx = 1058;
|
||||
///清除个人魅力值
|
||||
public static final int QXRoomMessageTypeQingGRMl = 1059;
|
||||
|
||||
///房间内换麦
|
||||
public static final int QXRoomMessageTypehm = 1039;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class GiftLotteryContacts {
|
||||
public interface IRoomPre extends IPresenter {
|
||||
void getGiftList(String giftBagId,String roomId);
|
||||
|
||||
void drawGiftList(String giftBagId,String gift_user_ids,String roomId,String num);
|
||||
void drawGiftList(String giftBagId,String gift_user_ids,String roomId,String num,String heart_id);
|
||||
|
||||
void getMyRecord(String giftBagId,String page,String pageSize,int type);//我的抽奖记录 type: 1:我的抽奖 2:全服抽奖
|
||||
|
||||
|
||||
@@ -90,18 +90,20 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
private String blind_box_turntable_id = "";//本次抽奖标识id
|
||||
private BlindBoxBean.XlhData xlhData;
|
||||
private int icon;//金币金额
|
||||
private String heart_id="";
|
||||
|
||||
@Override
|
||||
protected GiftLotteryPresenter bindPresenter() {
|
||||
return new GiftLotteryPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
public static GiftLotteryDialog newInstance(String giftBagId, String roomId, String userIds) {
|
||||
public static GiftLotteryDialog newInstance(String giftBagId, String roomId, String userIds,String heart_id) {
|
||||
GiftLotteryDialog dialog = new GiftLotteryDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putString("giftBagId", giftBagId);
|
||||
args.putString("roomId", roomId);
|
||||
args.putString("userIds", userIds);
|
||||
args.putString("heart_id", heart_id);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
@@ -126,6 +128,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
userIds = getArguments().getString("userIds");
|
||||
// 根据userIds确定类型
|
||||
userIdType = LotteryEvent.fromLotteryEvent(giftBagId);
|
||||
heart_id=getArguments().getString("heart_id");
|
||||
|
||||
|
||||
}
|
||||
@@ -309,7 +312,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
isDrawing = true;
|
||||
// init(1);
|
||||
startType = 1;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "1");
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "1",heart_id);
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
return;
|
||||
@@ -319,7 +322,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
isDrawing = true;
|
||||
// init(2);
|
||||
startType = 2;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "10");
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "10",heart_id);
|
||||
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
@@ -329,7 +332,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
isDrawing = true;
|
||||
// init(3);
|
||||
startType = 3;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "100");
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "100",heart_id);
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
@@ -811,7 +814,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
GiftBean giftBean = giftLists.get(j);
|
||||
giftBean.setCount(reslutList.getCount());
|
||||
|
||||
if (!isOpenSpecial) {
|
||||
if (!isOpenSpecial || !isOpenSound) {
|
||||
giftCardView.setVisibilitymResultTextView(true);
|
||||
giftCardView.setSelected(true);
|
||||
playSound("xuanz.mp3");
|
||||
@@ -883,25 +886,25 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
releaseResources();
|
||||
// releaseResources();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
releaseResources();
|
||||
// releaseResources();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(@NonNull DialogInterface dialog) {
|
||||
super.onCancel(dialog);
|
||||
releaseResources();
|
||||
// releaseResources();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
releaseResources();
|
||||
// releaseResources();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,8 +41,8 @@ public class GiftLotteryPresenter extends BasePresenter<GiftLotteryContacts.View
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num) {
|
||||
api.drawGiftList(giftBagId, gift_user_ids, roomId, num, new BaseObserver<BlindReslutBean>() {
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num,String heart_id) {
|
||||
api.drawGiftList(giftBagId, gift_user_ids, roomId, num,heart_id, new BaseObserver<BlindReslutBean>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.xscm.moduleutil.bean.RoomSearchResp;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidy;
|
||||
import com.xscm.moduleutil.bean.RoomTime;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.bean.SongMusicBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
@@ -738,7 +739,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_DRAW_GIFT_LIST)
|
||||
Call<BaseModel<BlindReslutBean>> drawGiftList(@Field("gift_bag_id") String gift_bag_id, @Field("gift_user_ids") String gift_user_ids,@Field("room_id")String room_id,@Field("num")String num);
|
||||
Call<BaseModel<BlindReslutBean>> drawGiftList(@Field("gift_bag_id") String gift_bag_id, @Field("gift_user_ids") String gift_user_ids,@Field("room_id")String room_id,@Field("num")String num,@Field("heart_id") String heart_id);
|
||||
|
||||
@GET(Constants.GET_MY_RECORD)
|
||||
Call<BaseModel<List<GiftBean>>> getMyRecord(@Query("gift_bag_id")String gift_bag_id,@Query("page")String page,@Query("page_size")String page_size);
|
||||
@@ -766,6 +767,10 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_GIFT_ALL_CLEAR)
|
||||
Call<BaseModel<String>> getGiftPack(@Field("room_id") String roomId,@Field("to_uid") String user_id);
|
||||
Call<BaseModel<String>> getGiftPack(@Field("room_id") String roomId,@Field("to_uid") String user_id,@Field("heart_id") String heart_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_ROOM_USER_CHARM_LIST)
|
||||
Call<BaseModel<List<RoomUserCharmListBean>>> roomUserCharmList(@Field("room_id") String roomId,@Field("user_id") String user_id);
|
||||
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ import com.xscm.moduleutil.bean.RoomSubsidy;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidyDetails;
|
||||
import com.xscm.moduleutil.bean.RoomTime;
|
||||
import com.xscm.moduleutil.bean.RoomTypeModel;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.bean.SongMusicBean;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
@@ -457,8 +458,8 @@ public class RetrofitClient {
|
||||
sApiServer.giftPack().compose(new DefaultTransformer<>()).subscribe(observer);
|
||||
}
|
||||
|
||||
public void getGiftPack(String roomId, String userId,BaseObserver<String> observer){
|
||||
sApiServer.getGiftPack(roomId,userId).enqueue(new Callback<BaseModel<String>>() {
|
||||
public void getGiftPack(String roomId, String userId, String heart_id,BaseObserver<String> observer){
|
||||
sApiServer.getGiftPack(roomId,userId,heart_id).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200){
|
||||
@@ -2334,8 +2335,8 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
///盲盒转盘抽奖
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num,BaseObserver<BlindReslutBean> observer){
|
||||
sApiServer.drawGiftList(giftBagId, gift_user_ids, roomId, num).enqueue(new Callback<BaseModel<BlindReslutBean>>() {
|
||||
public void drawGiftList(String giftBagId, String gift_user_ids, String roomId, String num,String heart_id,BaseObserver<BlindReslutBean> observer){
|
||||
sApiServer.drawGiftList(giftBagId, gift_user_ids, roomId, num,heart_id).enqueue(new Callback<BaseModel<BlindReslutBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<BlindReslutBean>> call, Response<BaseModel<BlindReslutBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
@@ -2441,4 +2442,25 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void roomUserCharmList(String room_id, String user_id, BaseObserver<List<RoomUserCharmListBean>> observer){
|
||||
sApiServer.roomUserCharmList(room_id,user_id).enqueue(new Callback<BaseModel<List<RoomUserCharmListBean>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<RoomUserCharmListBean>>> call, Response<BaseModel<List<RoomUserCharmListBean>>> response) {
|
||||
if (response.code()==200){
|
||||
BaseModel<List<RoomUserCharmListBean>> baseModel = response.body();
|
||||
if (baseModel.getCode()==1){
|
||||
observer.onNext(baseModel.getData());
|
||||
}else if (baseModel.getCode()==0){
|
||||
observer.onNext(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<RoomUserCharmListBean>>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -293,13 +293,13 @@ public class MessageListenerSingleton {
|
||||
V2TIMManager.getInstance().quitGroup("room" + mRoomId, new V2TIMCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
LogUtils.d("退出群组成功");
|
||||
LogUtils.d("@@@","退出群组成功"+mRoomId);
|
||||
// removeAllListeners(); // 移除所有监听器
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String desc) {
|
||||
LogUtils.d("退出群组失败", code, desc);
|
||||
LogUtils.d("@@@","退出群组失败"+mRoomId, code, desc);
|
||||
// removeAllListeners(); // 即使失败也移除监听器
|
||||
}
|
||||
});
|
||||
@@ -313,6 +313,7 @@ public class MessageListenerSingleton {
|
||||
isInitialized = false;
|
||||
// instance = null;
|
||||
quitGroup(roomId);
|
||||
LogUtils.e("@@@","重置成功");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,6 @@ public class RewardGiftContacts {
|
||||
void roomAuctionJoin(String auction_id,String user_id, String gift_id, String num,String type);
|
||||
void giftPack();
|
||||
|
||||
void getGiftPack(String roomId,String userId);
|
||||
void getGiftPack(String roomId,String userId,String heart_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,8 +210,8 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getGiftPack(String roomId,String userId) {
|
||||
api.getGiftPack(roomId,userId, new BaseObserver<String>() {
|
||||
public void getGiftPack(String roomId,String userId,String heart_id) {
|
||||
api.getGiftPack(roomId,userId,heart_id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
|
||||
@@ -411,17 +411,19 @@ public class AgoraManager {
|
||||
@SuppressLint("SuspiciousIndentation")
|
||||
public void setLocalAudioEnabled(boolean enabled, String userId) {
|
||||
if (rtcEngine != null) {
|
||||
if (userId.equals(SpUtil.getUserId()+"")) {
|
||||
rtcEngine.enableLocalAudio(enabled); // 启用/禁用音频采集
|
||||
}
|
||||
this.isLocalAudioEnabled = enabled;
|
||||
if (!enabled) {
|
||||
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
||||
if (listener != null) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
// 远程用户音量变化
|
||||
listener.onRemoteSoundLevelUpdate(userId, 0);
|
||||
});
|
||||
if (userId != null) {
|
||||
if (userId.equals(SpUtil.getUserId() + "")) {
|
||||
rtcEngine.enableLocalAudio(enabled); // 启用/禁用音频采集
|
||||
}
|
||||
this.isLocalAudioEnabled = enabled;
|
||||
if (!enabled) {
|
||||
for (SoundLevelUpdateListener listener : soundLevelUpdateListeners) {
|
||||
if (listener != null) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
// 远程用户音量变化
|
||||
listener.onRemoteSoundLevelUpdate(userId, 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -466,6 +468,7 @@ public class AgoraManager {
|
||||
if (rtcEngine == null) {
|
||||
init(CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId());
|
||||
}
|
||||
// 正确做法
|
||||
rtcEngine.muteLocalAudioStreamEx(enabled, connection);
|
||||
}
|
||||
|
||||
|
||||
@@ -248,16 +248,11 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
|
||||
private void playNextFromQueue() {
|
||||
// if (isDestroyed) return;
|
||||
// 确保在主线程中执行
|
||||
if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
mainHandler.post(this::playNextFromQueue);
|
||||
return;
|
||||
}
|
||||
// 再次检查内存状态
|
||||
// if (isMemoryLow()) {
|
||||
// LogUtils.w(TAG, "Low memory, clearing queue");
|
||||
// clearQueue();
|
||||
// if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
// mainHandler.post(this::playNextFromQueue);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 检查特效是否开启
|
||||
if (SpUtil.getOpenEffect() != 1) {
|
||||
clearQueue();
|
||||
@@ -986,16 +981,14 @@ public class AvatarFrameView extends FrameLayout implements IAnimListener {
|
||||
// }
|
||||
|
||||
private void clearPrevious() {
|
||||
// if (isDestroyed) return;
|
||||
// 确保在主线程中执行
|
||||
if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
mainHandler.post(() -> {
|
||||
// if (!isDestroyed) {
|
||||
clearPrevious();
|
||||
// }
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (Looper.myLooper() != Looper.getMainLooper()) {
|
||||
// mainHandler.post(() -> {
|
||||
// clearPrevious();
|
||||
//// }
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
try {
|
||||
// 停止并清理 ExoPlayer
|
||||
// if (exoPlayer != null) {
|
||||
|
||||
@@ -385,6 +385,7 @@ public class Constants {
|
||||
public static final String POST_XLH_ALL_RECORD = "/api/BlindBoxTurntable/get_xlh_all_record";///巡乐会榜单
|
||||
public static final String GET_XLH_MY_RECORD = "/api/BlindBoxTurntable/get_xlh_my_record";///巡乐会记录
|
||||
public static final String POST_GIFT_ALL_CLEAR = "/api/Room/room_gift_all_clear";///背包礼物全清
|
||||
public static final String POST_ROOM_USER_CHARM_LIST = "/api/Room/room_user_charm_list";///房间用户当前魅力值列表
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -68,6 +68,16 @@ public class RoomFriendshipWheatView extends BaseWheatView {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
mCharmView.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnCharmClickListener != null && pitBean != null){
|
||||
mOnCharmClickListener.onCharmClick(RoomFriendshipWheatView.this, pitBean);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -303,6 +313,12 @@ public class RoomFriendshipWheatView extends BaseWheatView {
|
||||
this.mOnZhulClickListener = listener;
|
||||
}
|
||||
|
||||
private onCharmClickListener mOnCharmClickListener;
|
||||
|
||||
public void setmOnCharmClickListener(onCharmClickListener mOnCharmClickListener) {
|
||||
this.mOnCharmClickListener = mOnCharmClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unRegister(Object obj) {
|
||||
|
||||
@@ -311,4 +327,8 @@ public class RoomFriendshipWheatView extends BaseWheatView {
|
||||
public interface OnZhulClickListener {
|
||||
void onZhulClick(RoomFriendshipWheatView view, RoomPitBean pitBean);
|
||||
}
|
||||
|
||||
public interface onCharmClickListener{
|
||||
void onCharmClick(RoomFriendshipWheatView view, RoomPitBean pitBean);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,14 @@ public class RoomKtvWheatView extends BaseWheatView {
|
||||
public RoomKtvWheatView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
private onCharmClickListener mOnCharmClickListener;
|
||||
|
||||
public void setmOnCharmClickListener(onCharmClickListener mOnCharmClickListener) {
|
||||
this.mOnCharmClickListener = mOnCharmClickListener;
|
||||
}
|
||||
public interface onCharmClickListener{
|
||||
void onCharmClick(RoomKtvWheatView view, RoomPitBean pitBean);
|
||||
}
|
||||
@Override
|
||||
protected void initPit(Context context, AttributeSet attrs) {
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoomDefaultWheatView);
|
||||
@@ -45,6 +52,16 @@ public class RoomKtvWheatView extends BaseWheatView {
|
||||
mIvTagBoss = findViewById(R.id.iv_tag_boos);
|
||||
mTvTime = findViewById(R.id.tv_time);
|
||||
tv_time_pk = findViewById(R.id.tv_time_pk);
|
||||
|
||||
mCharmView.setOnClickListener(new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnCharmClickListener != null && pitBean != null){
|
||||
mOnCharmClickListener.onCharmClick(RoomKtvWheatView.this, pitBean);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,8 +51,38 @@ public class RoomMakeWheatView extends BaseWheatView {
|
||||
iv_tag_type=findViewById(R.id.iv_tag_type);
|
||||
mCharmView = findViewById(R.id.charm_view);
|
||||
mRiv.setImageResource(pitImageVId);
|
||||
|
||||
if (mTvTime != null) {
|
||||
mTvTime.setOnClickListener(v -> {
|
||||
// 处理魅力值点击
|
||||
if (mOnCharmClickListener != null && pitBean != null) {
|
||||
mOnCharmClickListener.onCharmClick(this, pitBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void setOnClickListener(OnClickListener l) {
|
||||
// // 保存外部设置的点击监听器
|
||||
// this.onWholeViewClickListener = l;
|
||||
// super.setOnClickListener(l);
|
||||
// }
|
||||
|
||||
// 为子组件设置点击监听器时,确保不会拦截父容器的点击事件
|
||||
public void setupChildClickListeners() {
|
||||
if (mRiv != null) {
|
||||
mRiv.setOnClickListener(v -> {
|
||||
// 处理头像点击
|
||||
if (onWholeViewClickListener != null) {
|
||||
onWholeViewClickListener.onClick(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
private OnClickListener onWholeViewClickListener;
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_view_make_wheat;
|
||||
@@ -130,8 +160,27 @@ public class RoomMakeWheatView extends BaseWheatView {
|
||||
iv_tag_type.setVisibility(GONE);
|
||||
mCharmView.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
// mCharmView.setOnClickListener(new OnClickListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// if (mOnCharmClickListener != null && pitBean != null){
|
||||
// mOnCharmClickListener.onCharmClick(RoomMakeWheatView.this, pitBean);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
private onCharmClickListener mOnCharmClickListener;
|
||||
//
|
||||
public void setmOnCharmClickListener(onCharmClickListener mOnCharmClickListener) {
|
||||
this.mOnCharmClickListener = mOnCharmClickListener;
|
||||
}
|
||||
//
|
||||
public interface onCharmClickListener{
|
||||
void onCharmClick(RoomMakeWheatView view, RoomPitBean pitBean);
|
||||
}
|
||||
public void setChe(String che){
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
@@ -36,6 +37,8 @@ public class WheatLayoutSingManager {
|
||||
|
||||
void onMakeWheatClick(RoomSingSongWheatView view, int pitNumber);
|
||||
|
||||
void onMeilingClick(RoomSingSongWheatView view, int pitNumber);
|
||||
|
||||
}
|
||||
|
||||
private @Nullable OnWheatClickListener wheatClickListener;
|
||||
@@ -101,14 +104,28 @@ public class WheatLayoutSingManager {
|
||||
params.setMargins(20, 20, 20, 20);
|
||||
singleWheatView.setLayoutParams(params);
|
||||
|
||||
// 添加点击事件
|
||||
singleWheatView.setOnClickListener(v -> {
|
||||
GifAvatarOvalView avatarView = (GifAvatarOvalView) singleWheatView.mRiv;
|
||||
avatarView.setOnClickListener(v -> {
|
||||
if (wheatClickListener != null) {
|
||||
wheatClickListener.onWheatClick(singleWheatView, pitNumber);
|
||||
}
|
||||
restoreMultiWheat();
|
||||
});
|
||||
|
||||
WheatCharmView charmView = singleWheatView.mCharmView;
|
||||
charmView.setOnClickListener(v -> {
|
||||
if (wheatClickListener != null) {
|
||||
wheatClickListener.onMeilingClick(singleWheatView, Integer.parseInt(singleWheatView.pitNumber));
|
||||
}
|
||||
});
|
||||
// // 添加点击事件
|
||||
singleWheatView.setOnClickListener(v -> {
|
||||
if (wheatClickListener != null) {
|
||||
wheatClickListener.onMakeWheatClick(singleWheatView, pitNumber);
|
||||
}
|
||||
restoreMultiWheat();
|
||||
});
|
||||
|
||||
container.addView(singleWheatView);
|
||||
isSingleMode = true;
|
||||
currentSinglePit = pitNumber;
|
||||
@@ -168,9 +185,26 @@ public class WheatLayoutSingManager {
|
||||
}
|
||||
|
||||
wheatView.setLayoutParams(params);
|
||||
|
||||
|
||||
GifAvatarOvalView avatarView = (GifAvatarOvalView) wheatView.mRiv;
|
||||
avatarView.setOnClickListener(v -> {
|
||||
if (wheatClickListener != null) {
|
||||
wheatClickListener.onWheatClick(wheatView, pitNumber);
|
||||
}
|
||||
});
|
||||
|
||||
WheatCharmView charmView = wheatView.mCharmView;
|
||||
charmView.setOnClickListener(v -> {
|
||||
if (wheatClickListener != null) {
|
||||
ToastUtils.show("点击了麦位");
|
||||
wheatClickListener.onMeilingClick(wheatView, pitNumber);
|
||||
}
|
||||
});
|
||||
|
||||
wheatView.setOnClickListener(v -> {
|
||||
if (wheatClickListener != null) {
|
||||
wheatClickListener.onWheatClick(wheatView, Integer.parseInt(wheatView.pitNumber));
|
||||
wheatClickListener.onMeilingClick(wheatView, Integer.parseInt(wheatView.pitNumber));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -27,6 +27,13 @@
|
||||
<!-- app:layout_constraintHeight_percent="0.5"-->
|
||||
<!-- />-->
|
||||
<!--头像 - 占整体高度的一半-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!--头像框 - 比头像大2dp-->
|
||||
|
||||
|
||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||
android:id="@+id/riv"
|
||||
android:layout_width="0dp"
|
||||
@@ -41,7 +48,22 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintHeight_default="percent"
|
||||
app:layout_constraintHeight_percent="0.5" />
|
||||
app:layout_constraintHeight_percent="0.52" />
|
||||
|
||||
<com.xscm.moduleutil.widget.AvatarFrameView
|
||||
android:id="@+id/iv_frame"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitXY"
|
||||
app:autoPlay="true"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/riv"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:loopCount="0"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_ripple"
|
||||
@@ -57,25 +79,6 @@
|
||||
app:loopCount="0"
|
||||
app:source="ripple3695.svga" />
|
||||
|
||||
<!--头像框 - 比头像大2dp-->
|
||||
<com.xscm.moduleutil.widget.AvatarFrameView
|
||||
android:id="@+id/iv_frame"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintTop_toTopOf="@id/riv"
|
||||
app:layout_constraintStart_toStartOf="@id/riv"
|
||||
app:layout_constraintEnd_toEndOf="@id/riv"
|
||||
app:layout_constraintBottom_toBottomOf="@id/riv"
|
||||
android:layout_marginTop="-1dp"
|
||||
android:layout_marginStart="-1dp"
|
||||
android:layout_marginEnd="-1dp"
|
||||
android:layout_marginBottom="-1dp" />
|
||||
|
||||
|
||||
|
||||
<!--离线状态 - 和头像框一样大,在标签下面-->
|
||||
<ImageView
|
||||
|
||||
Reference in New Issue
Block a user