fix bugs.
This commit is contained in:
@@ -161,7 +161,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
|||||||
//设置mqtt环境 false 测试环境 true 正式环境
|
//设置mqtt环境 false 测试环境 true 正式环境
|
||||||
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
|
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
|
||||||
//设置http环境 false 测试环境 true 正式环境
|
//设置http环境 false 测试环境 true 正式环境
|
||||||
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(true);
|
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(false);
|
||||||
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
|
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class UserInfo extends BaseEvent implements Serializable {
|
|||||||
public static final String FEMALE = "2";
|
public static final String FEMALE = "2";
|
||||||
public static final String MALE = "1";
|
public static final String MALE = "1";
|
||||||
private int id;
|
private int id;
|
||||||
private int user_id; //用户id
|
private int user_id = 0; //用户id
|
||||||
private String user_code;//用户id码
|
private String user_code;//用户id码
|
||||||
private String avatar;//头像
|
private String avatar;//头像
|
||||||
private String nickname;//昵称
|
private String nickname;//昵称
|
||||||
|
|||||||
@@ -28,13 +28,21 @@ public class RoomPitBean implements Serializable {
|
|||||||
* dress_picture :
|
* dress_picture :
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
public RoomPitBean(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoomPitBean(String pit_number){
|
||||||
|
this.pit_number = pit_number;
|
||||||
|
}
|
||||||
|
|
||||||
private String id;//id
|
private String id;//id
|
||||||
private String pit_number = "";//麦位号
|
private String pit_number = "";//麦位号
|
||||||
private String state;//麦位状态 正常 ,1封麦;3禁麦
|
private String state;//麦位状态 正常 ,1封麦;3禁麦
|
||||||
private int is_lock;//0未锁麦 1锁麦
|
private int is_lock;//0未锁麦 1锁麦
|
||||||
private int is_mute;//0未禁麦 1禁麦
|
private int is_mute;//0未禁麦 1禁麦
|
||||||
private int count_down;//麦位倒计时
|
private int count_down;//麦位倒计时
|
||||||
private String user_id="";//麦位上用户id
|
private String user_id="0";//麦位上用户id
|
||||||
private String nickname;//麦位上用户昵称
|
private String nickname;//麦位上用户昵称
|
||||||
private String avatar;//用户头像
|
private String avatar;//用户头像
|
||||||
private String sex;//性别
|
private String sex;//性别
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import android.os.Looper;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.xscm.moduleutil.bean.GiftBean;
|
import com.xscm.moduleutil.bean.GiftBean;
|
||||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||||
|
|
||||||
@@ -66,14 +68,14 @@ public class GiftDisplayManager {
|
|||||||
|
|
||||||
final int finalI = i;
|
final int finalI = i;
|
||||||
displayView.setGiftAnimationListener(view -> {
|
displayView.setGiftAnimationListener(view -> {
|
||||||
Log.d("GiftDisplayManager", "Gift animation ended on view: " + finalI);
|
LogUtils.e("GiftDisplayManager", "Gift animation ended on view: " + finalI);
|
||||||
onGiftAnimationEnd(view);
|
onGiftAnimationEnd(view);
|
||||||
});
|
});
|
||||||
|
|
||||||
container.addView(displayView);
|
container.addView(displayView);
|
||||||
displayViews.add(displayView);
|
displayViews.add(displayView);
|
||||||
|
|
||||||
Log.d("GiftDisplayManager", "Created display view " + i);
|
LogUtils.e("GiftDisplayManager", "Created display view " + i +"____"+displayViews.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +85,7 @@ public class GiftDisplayManager {
|
|||||||
}
|
}
|
||||||
if (gift == null) return;
|
if (gift == null) return;
|
||||||
|
|
||||||
Log.d("GiftDisplayManager", "Received gift: " + gift.getSenderName() +
|
LogUtils.e("GiftDisplayManager", "Received gift: " + gift.getSenderName() +
|
||||||
" - " + gift.getGift_name() + " x" + gift.getNumber());
|
" - " + gift.getGift_name() + " x" + gift.getNumber());
|
||||||
|
|
||||||
mainHandler.post(() -> internalReceiveGift(gift));
|
mainHandler.post(() -> internalReceiveGift(gift));
|
||||||
@@ -99,8 +101,8 @@ public class GiftDisplayManager {
|
|||||||
GiftBean accumulatedGift = accumulatedGifts.get(key);
|
GiftBean accumulatedGift = accumulatedGifts.get(key);
|
||||||
if (accumulatedGift != null) {
|
if (accumulatedGift != null) {
|
||||||
accumulatedGift.setNumber(accumulatedGift.getNumber() + gift.getNumber());
|
accumulatedGift.setNumber(accumulatedGift.getNumber() + gift.getNumber());
|
||||||
displayingView.updateGiftCount(accumulatedGift.getNumber());
|
displayingView.updateGiftCount(accumulatedGift);
|
||||||
Log.d("GiftDisplayManager", "Gift accumulated: " + gift.getGift_name() +
|
LogUtils.e("GiftDisplayManager", "Gift accumulated: " + gift +
|
||||||
" x" + accumulatedGift.getNumber());
|
" x" + accumulatedGift.getNumber());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -111,11 +113,11 @@ public class GiftDisplayManager {
|
|||||||
String key = gift.getGiftKey();
|
String key = gift.getGiftKey();
|
||||||
accumulatedGifts.put(key, gift.clone());
|
accumulatedGifts.put(key, gift.clone());
|
||||||
availableView.showGift(gift);
|
availableView.showGift(gift);
|
||||||
Log.d("GiftDisplayManager", "Immediately display gift on view: " + availableView.getTag());
|
LogUtils.e("GiftDisplayManager", "Immediately display gift on view: " + gift);
|
||||||
} else {
|
} else {
|
||||||
// 没有可用视图,加入队列
|
// 没有可用视图,加入队列
|
||||||
giftQueue.offer(gift);
|
giftQueue.offer(gift);
|
||||||
Log.d("GiftDisplayManager", "Added to queue, current queue size: " + giftQueue.size());
|
LogUtils.e("GiftDisplayManager", gift+" Added to queue, current queue size: " + giftQueue.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,12 +148,12 @@ public class GiftDisplayManager {
|
|||||||
|
|
||||||
private void processGiftQueue() {
|
private void processGiftQueue() {
|
||||||
if (isProcessingQueue) {
|
if (isProcessingQueue) {
|
||||||
Log.d("GiftDisplayManager", "Already processing queue, skip");
|
LogUtils.e("GiftDisplayManager", "Already processing queue, skip");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
isProcessingQueue = true;
|
isProcessingQueue = true;
|
||||||
Log.d("GiftDisplayManager", "Start processing queue, size: " + giftQueue.size());
|
LogUtils.e("GiftDisplayManager", "Start processing queue, size: " + giftQueue.size());
|
||||||
// 循环处理队列直到队列为空或没有可用视图
|
// 循环处理队列直到队列为空或没有可用视图
|
||||||
while (!giftQueue.isEmpty()) {
|
while (!giftQueue.isEmpty()) {
|
||||||
GiftDisplayView availableView = findAvailableDisplayView();
|
GiftDisplayView availableView = findAvailableDisplayView();
|
||||||
@@ -168,16 +170,16 @@ public class GiftDisplayManager {
|
|||||||
String key = gift.getGiftKey();
|
String key = gift.getGiftKey();
|
||||||
accumulatedGifts.put(key, gift.clone());
|
accumulatedGifts.put(key, gift.clone());
|
||||||
availableView.showGift(gift);
|
availableView.showGift(gift);
|
||||||
Log.d("GiftDisplayManager", "Display gift from queue: " + gift.getGift_name());
|
LogUtils.e("GiftDisplayManager", "Display gift from queue: " + gift);
|
||||||
} else {
|
} else {
|
||||||
// 如果已经在显示,累加到现有视图
|
// 如果已经在显示,累加到现有视图
|
||||||
String key = gift.getGiftKey();
|
String key = gift.getGiftKey();
|
||||||
GiftBean accumulatedGift = accumulatedGifts.get(key);
|
GiftBean accumulatedGift = accumulatedGifts.get(key);
|
||||||
if (accumulatedGift != null) {
|
if (accumulatedGift != null) {
|
||||||
accumulatedGift.setNumber(accumulatedGift.getNumber() + gift.getNumber());
|
accumulatedGift.setNumber(accumulatedGift.getNumber() + gift.getNumber());
|
||||||
displayingView.updateGiftCount(accumulatedGift.getNumber());
|
displayingView.updateGiftCount(accumulatedGift);
|
||||||
Log.d("GiftDisplayManager", "Queue gift accumulated to existing: " +
|
LogUtils.e("GiftDisplayManager", "Queue gift accumulated to existing: " +
|
||||||
gift.getNickname() + " x" + accumulatedGift.getNumber());
|
gift + " x" + accumulatedGift.getNumber());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,18 +188,18 @@ public class GiftDisplayManager {
|
|||||||
|
|
||||||
// 打印队列状态
|
// 打印队列状态
|
||||||
if (!giftQueue.isEmpty()) {
|
if (!giftQueue.isEmpty()) {
|
||||||
Log.d("GiftDisplayManager", "Still " + giftQueue.size() + " gifts waiting in queue");
|
LogUtils.e("GiftDisplayManager", "Still " + giftQueue.size() + " gifts waiting in queue");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onGiftAnimationEnd(GiftDisplayView view) {
|
private void onGiftAnimationEnd(GiftDisplayView view) {
|
||||||
Log.d("GiftDisplayManager", "Gift animation end on view: " + view.getTag());
|
LogUtils.e("GiftDisplayManager", "Gift animation end on view: " + view.getTag());
|
||||||
|
|
||||||
// 从累加记录中移除
|
// 从累加记录中移除
|
||||||
if (view.getCurrentGift() != null) {
|
if (view.getCurrentGift() != null) {
|
||||||
String key = view.getCurrentGift().getGiftKey();
|
String key = view.getCurrentGift().getGiftKey();
|
||||||
accumulatedGifts.remove(key);
|
accumulatedGifts.remove(key);
|
||||||
Log.d("GiftDisplayManager", "Removed accumulated record: " + key);
|
LogUtils.e("GiftDisplayManager", "Removed accumulated record: " + key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 延迟一下再处理队列,确保视图状态完全重置
|
// 延迟一下再处理队列,确保视图状态完全重置
|
||||||
@@ -220,7 +222,7 @@ public class GiftDisplayManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clearAll() {
|
public void clearAll() {
|
||||||
Log.d("GiftDisplayManager", "Clear all gifts and queue");
|
LogUtils.e("GiftDisplayManager", "Clear all gifts and queue");
|
||||||
|
|
||||||
for (GiftDisplayView view : displayViews) {
|
for (GiftDisplayView view : displayViews) {
|
||||||
view.finishAnimationImmediately();
|
view.finishAnimationImmediately();
|
||||||
@@ -234,16 +236,16 @@ public class GiftDisplayManager {
|
|||||||
|
|
||||||
// 调试方法
|
// 调试方法
|
||||||
public void printDebugInfo() {
|
public void printDebugInfo() {
|
||||||
Log.d("GiftDisplayManager", "=== Gift Display Manager Status ===");
|
LogUtils.e("GiftDisplayManager", "=== Gift Display Manager Status ===");
|
||||||
Log.d("GiftDisplayManager", "Queue size: " + giftQueue.size());
|
LogUtils.e("GiftDisplayManager", "Queue size: " + giftQueue.size());
|
||||||
Log.d("GiftDisplayManager", "Accumulated records: " + accumulatedGifts.size());
|
LogUtils.e("GiftDisplayManager", "Accumulated records: " + accumulatedGifts.size());
|
||||||
|
|
||||||
for (int i = 0; i < displayViews.size(); i++) {
|
for (int i = 0; i < displayViews.size(); i++) {
|
||||||
GiftDisplayView view = displayViews.get(i);
|
GiftDisplayView view = displayViews.get(i);
|
||||||
Log.d("GiftDisplayManager", "View " + i + ": Animating=" + view.isAnimating() +
|
LogUtils.e("GiftDisplayManager", "View " + i + ": Animating=" + view.isAnimating() +
|
||||||
", Gift=" + (view.getCurrentGift() != null ? view.getCurrentGift().getGift_name() : "None"));
|
", Gift=" + (view.getCurrentGift() != null ? view.getCurrentGift().getGift_name() : "None"));
|
||||||
}
|
}
|
||||||
Log.d("GiftDisplayManager", "===================================");
|
LogUtils.e("GiftDisplayManager", "===================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
private int dpToPx(int dp) {
|
private int dpToPx(int dp) {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import android.widget.FrameLayout;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.xscm.moduleutil.R;
|
import com.xscm.moduleutil.R;
|
||||||
import com.xscm.moduleutil.bean.GiftBean;
|
import com.xscm.moduleutil.bean.GiftBean;
|
||||||
import com.xscm.moduleutil.utils.ImageUtils;
|
import com.xscm.moduleutil.utils.ImageUtils;
|
||||||
@@ -63,14 +65,14 @@ public class GiftDisplayView extends FrameLayout {
|
|||||||
|
|
||||||
public void showGift(GiftBean gift) {
|
public void showGift(GiftBean gift) {
|
||||||
if (isAnimating) {
|
if (isAnimating) {
|
||||||
Log.w("GiftDisplayView", "View is animating, cannot show new gift");
|
LogUtils.e("GiftDisplayView", "View is animating, cannot show new gift");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.currentGift = gift;
|
this.currentGift = gift;
|
||||||
this.isAnimating = true;
|
this.isAnimating = true;
|
||||||
|
|
||||||
Log.d("GiftDisplayView", "Start showing gift: " + gift.getGift_name());
|
LogUtils.e("GiftDisplayView", "Start showing gift: " + gift.getGift_name());
|
||||||
|
|
||||||
// 更新UI
|
// 更新UI
|
||||||
updateUIWithGift(gift);
|
updateUIWithGift(gift);
|
||||||
@@ -87,7 +89,7 @@ public class GiftDisplayView extends FrameLayout {
|
|||||||
.setListener(new AnimatorListenerAdapter() {
|
.setListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
Log.d("GiftDisplayView", "Enter animation completed: " + gift.getGift_name());
|
LogUtils.e("GiftDisplayView", "Enter animation completed: " + gift.getGift_name());
|
||||||
startHideTimer();
|
startHideTimer();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -113,7 +115,7 @@ public class GiftDisplayView extends FrameLayout {
|
|||||||
// 加载礼物图片
|
// 加载礼物图片
|
||||||
loadGiftImage(gift.getBase_image());
|
loadGiftImage(gift.getBase_image());
|
||||||
|
|
||||||
Log.d("GiftDisplayView", "Update UI: " + gift.getSenderName() + " - " +
|
LogUtils.e("GiftDisplayView", "Update UI: " + gift.getSenderName() + " - " +
|
||||||
gift.getGift_name() + " x" + gift.getNumber());
|
gift.getGift_name() + " x" + gift.getNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,16 +152,25 @@ public class GiftDisplayView extends FrameLayout {
|
|||||||
return Color.argb(255, random.nextInt(256), random.nextInt(256), random.nextInt(256));
|
return Color.argb(255, random.nextInt(256), random.nextInt(256), random.nextInt(256));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateGiftCount(int count) {
|
public void updateGiftCount(GiftBean gift) {
|
||||||
if (!isAnimating) {
|
if (!isAnimating) {
|
||||||
Log.w("GiftDisplayView", "View is not animating, cannot update count");
|
LogUtils.e("GiftDisplayView", "View is not animating, cannot update count");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("GiftDisplayView", "Update gift count: " + count);
|
LogUtils.e("GiftDisplayView", "Update gift count: " + gift);
|
||||||
|
|
||||||
// 更新数量显示
|
// 更新数量显示
|
||||||
countTextView.setText("x" + count);
|
countTextView.setText("x" + gift.getNumber());
|
||||||
|
|
||||||
|
if (senderTextView.getText().toString().isEmpty()){
|
||||||
|
senderTextView.setText(gift.getNickname()!=null ? gift.getNickname() : "未知用户");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (giftTextView.getText().toString().isEmpty()){
|
||||||
|
giftTextView.setText("送给 "+(gift.getSenderName() != null ? gift.getSenderName() : "未知用户") + (gift.getGift_name() != null ? gift.getGift_name() : "礼物"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 数量更新动画
|
// 数量更新动画
|
||||||
countTextView.animate()
|
countTextView.animate()
|
||||||
@@ -201,7 +212,7 @@ public class GiftDisplayView extends FrameLayout {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("GiftDisplayView", "Start hide animation: " + currentGift.getGift_name());
|
LogUtils.e("GiftDisplayView", "Start hide animation: " + currentGift.getGift_name());
|
||||||
|
|
||||||
// 从右往左消失动画
|
// 从右往左消失动画
|
||||||
animate()
|
animate()
|
||||||
@@ -211,7 +222,7 @@ public class GiftDisplayView extends FrameLayout {
|
|||||||
.setListener(new AnimatorListenerAdapter() {
|
.setListener(new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
Log.d("GiftDisplayView", "Hide animation completed: " + currentGift.getGift_name());
|
LogUtils.e("GiftDisplayView", "Hide animation completed: " + currentGift.getGift_name());
|
||||||
isAnimating = false;
|
isAnimating = false;
|
||||||
|
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
@@ -225,7 +236,7 @@ public class GiftDisplayView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void finishAnimationImmediately() {
|
public void finishAnimationImmediately() {
|
||||||
Log.d("GiftDisplayView", "Finish animation immediately");
|
LogUtils.e("GiftDisplayView", "Finish animation immediately");
|
||||||
|
|
||||||
// 移除计时任务
|
// 移除计时任务
|
||||||
if (hideRunnable != null) {
|
if (hideRunnable != null) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingVertical="@dimen/dp_5"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||||
|
|||||||
@@ -504,11 +504,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
mBinding?.roomTop?.userRecyclerView?.adapter = likeUserAdapter
|
mBinding?.roomTop?.userRecyclerView?.adapter = likeUserAdapter
|
||||||
likeUserAdapter!!.onItemClickListener =
|
likeUserAdapter!!.onItemClickListener =
|
||||||
BaseQuickAdapter.OnItemClickListener { adapter, view, position ->
|
BaseQuickAdapter.OnItemClickListener { adapter, view, position ->
|
||||||
// RoomOnlineDialogFragment.show(roomId, "", mRoomUserBean, mRoomInfoResp, getSupportFragmentManager());
|
|
||||||
val fragment = RoomOnlineDialogFragment.show(
|
val fragment = RoomOnlineDialogFragment.show(
|
||||||
roomId, "", mRoomUserBean, mRoomInfoResp,
|
roomId, "", mRoomUserBean, mRoomInfoResp,
|
||||||
supportFragmentManager
|
supportFragmentManager
|
||||||
)
|
)
|
||||||
|
|
||||||
|
LogUtils.e("fragment: ${(fragment != null)}")
|
||||||
if (fragment != null) {
|
if (fragment != null) {
|
||||||
addActiveDialogFragment(fragment) // 添加到管理列表
|
addActiveDialogFragment(fragment) // 添加到管理列表
|
||||||
}
|
}
|
||||||
@@ -1560,7 +1561,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
messageEvent: RoomMessageEvent
|
messageEvent: RoomMessageEvent
|
||||||
) {
|
) {
|
||||||
mRoomInfoResp!!.room_info.pit_list[toPitNumber.toInt() - 1] = getPitBean(messageEvent, 2)
|
mRoomInfoResp!!.room_info.pit_list[toPitNumber.toInt() - 1] = getPitBean(messageEvent, 2)
|
||||||
mRoomInfoResp?.room_info?.pit_list!![fromPitNumber.toInt() - 1] = RoomPitBean()
|
mRoomInfoResp?.room_info?.pit_list!![fromPitNumber.toInt() - 1] = RoomPitBean(fromPitNumber)
|
||||||
|
|
||||||
if ("9" == toPitNumber && messageEvent.text.fromUserInfo.user_id == SpUtil.getUserId()) {
|
if ("9" == toPitNumber && messageEvent.text.fromUserInfo.user_id == SpUtil.getUserId()) {
|
||||||
mRoomInfoResp!!.user_info.pit_number = Integer.parseInt(toPitNumber)
|
mRoomInfoResp!!.user_info.pit_number = Integer.parseInt(toPitNumber)
|
||||||
@@ -1673,8 +1674,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
val userId = fromUserInfo.user_id
|
val userId = fromUserInfo.user_id
|
||||||
val currentUserId = SpUtil.getUserId()
|
val currentUserId = SpUtil.getUserId()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ("9" == pitNumber && userId == currentUserId) {
|
if ("9" == pitNumber && userId == currentUserId) {
|
||||||
// mBinding!!.roomTop.rl.visibility = View.VISIBLE
|
|
||||||
ivSoundEffects(true)
|
ivSoundEffects(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1720,6 +1722,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
mBinding!!.rlMore.visibility = View.GONE
|
mBinding!!.rlMore.visibility = View.GONE
|
||||||
mBinding!!.rlMisc.visibility = View.GONE
|
mBinding!!.rlMisc.visibility = View.GONE
|
||||||
|
|
||||||
|
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = getPitBean(messageEvent, 1)
|
||||||
|
|
||||||
|
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||||
roomFragment!!.handleRoomMessage(messageEvent)
|
roomFragment!!.handleRoomMessage(messageEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1765,15 +1770,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
val roomType = RoomType.fromTypeId(typeId)
|
val roomType = RoomType.fromTypeId(typeId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
when (roomType) {
|
when (roomType) {
|
||||||
RoomType.AUCTION -> {
|
RoomType.AUCTION -> {
|
||||||
if ("9" == pitNumber) {
|
if ("9" == pitNumber) {
|
||||||
|
mRoomInfoResp!!.room_info.pit_list[0] = RoomPitBean(pitNumber)
|
||||||
if (userId == currentUserId) {
|
if (userId == currentUserId) {
|
||||||
if (mRoomInfoResp!!.user_info != null) {
|
if (mRoomInfoResp!!.user_info != null) {
|
||||||
mRoomInfoResp!!.user_info.pit_number = 0
|
mRoomInfoResp!!.user_info.pit_number = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ("888" == pitNumber) {
|
} else if ("888" == pitNumber) {//被拍者
|
||||||
mRoomInfoResp!!.room_auction = null
|
mRoomInfoResp!!.room_auction = null
|
||||||
if (userId == currentUserId) {
|
if (userId == currentUserId) {
|
||||||
setRoleType(0, 0)
|
setRoleType(0, 0)
|
||||||
@@ -1784,16 +1791,26 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
RoomType.DATING -> {
|
RoomType.DATING -> {
|
||||||
|
//TODO 下麦更换数据
|
||||||
val labelId = mRoomInfoResp!!.room_info.label_id
|
val labelId = mRoomInfoResp!!.room_info.label_id
|
||||||
if ("1" == labelId) {
|
if ("1" == labelId) {
|
||||||
|
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
|
||||||
|
|
||||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||||
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()) {
|
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()) {
|
||||||
ivSoundEffects(false)
|
ivSoundEffects(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RoomType.MUTUAL_ENTERTAINMENT -> {
|
||||||
|
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
|
||||||
|
|
||||||
else -> {}
|
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||||
|
roomFragment!!.handleRoomMessage(messageEvent)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
roomFragment!!.handleRoomMessage(messageEvent)
|
roomFragment!!.handleRoomMessage(messageEvent)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -239,13 +239,10 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
roomId = roomInfoResp.getRoom_info().getRoom_id();
|
roomId = roomInfoResp.getRoom_info().getRoom_id();
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
||||||
if (roomPitBean.getPit_number().equals("7") || roomPitBean.getPit_number().equals("8")) {
|
if (i == 6 || i == 7) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (Integer.parseInt(!roomPitBean.getPit_number().isEmpty() ? roomPitBean.getPit_number() : "0") > 10) {
|
RoomFriendshipWheatView object = mWheatViews.get(i);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
RoomFriendshipWheatView object = mWheatViews.get(Integer.parseInt(roomPitBean.getPit_number()) - 1);
|
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
object.setData(roomPitBean);
|
object.setData(roomPitBean);
|
||||||
}
|
}
|
||||||
@@ -492,21 +489,15 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void event1035(RoomMessageEvent message) {
|
public void event1035(RoomMessageEvent message) {
|
||||||
|
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
|
if (i == 6 || i == 7)
|
||||||
|
continue;
|
||||||
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
||||||
if (roomPitBean.getPit_number().equals("7") || roomPitBean.getPit_number().equals("8")) {
|
if (Integer.parseInt(roomPitBean.getUser_id()) == message.getText().getFromUserInfo().getUser_id()){
|
||||||
continue;
|
RoomFriendshipWheatView object = mWheatViews.get(i);
|
||||||
}
|
if (object != null) {
|
||||||
if (Integer.parseInt(!roomPitBean.getPit_number().isEmpty() ? roomPitBean.getPit_number() : "0") > 10) {
|
object.setData(roomPitBean);
|
||||||
continue;
|
}
|
||||||
}
|
|
||||||
RoomFriendshipWheatView object = mWheatViews.get(Integer.parseInt(roomPitBean.getPit_number()) - 1);
|
|
||||||
if (object != null) {
|
|
||||||
object.setData(roomPitBean);
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -931,14 +922,11 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
|||||||
roomInfoResp = resp;
|
roomInfoResp = resp;
|
||||||
roomId = roomInfoResp.getRoom_info().getRoom_id();
|
roomId = roomInfoResp.getRoom_info().getRoom_id();
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||||
|
if (i == 6 || i == 7) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
||||||
if (roomPitBean.getPit_number().equals("7") || roomPitBean.getPit_number().equals("8")) {
|
RoomFriendshipWheatView object = mWheatViews.get(i);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (Integer.parseInt(!roomPitBean.getPit_number().isEmpty() ? roomPitBean.getPit_number() : "0") > 10) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
RoomFriendshipWheatView object = mWheatViews.get(Integer.parseInt(roomPitBean.getPit_number()) - 1);
|
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
object.setData(roomPitBean);
|
object.setData(roomPitBean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,7 +230,6 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
|||||||
startActivity(new Intent(getContext(), DailyTasksActivity.class));
|
startActivity(new Intent(getContext(), DailyTasksActivity.class));
|
||||||
}
|
}
|
||||||
else if (id == R.id.iv_sz) {//设置
|
else if (id == R.id.iv_sz) {//设置
|
||||||
// startActivity(new Intent(getContext(), SettingActivity.class));
|
|
||||||
Intent intent = new Intent(getContext(), SettingActivity.class);
|
Intent intent = new Intent(getContext(), SettingActivity.class);
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable("userInfo", userInfo);
|
bundle.putSerializable("userInfo", userInfo);
|
||||||
@@ -258,8 +257,7 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
|||||||
}else if (id==R.id.ll_me_income){
|
}else if (id==R.id.ll_me_income){
|
||||||
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId(); // 填移动应用(App)的 AppId
|
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId(); // 填移动应用(App)的 AppId
|
||||||
IWXAPI api = WXAPIFactory.createWXAPI(getContext(), appId);
|
IWXAPI api = WXAPIFactory.createWXAPI(getContext(), appId);
|
||||||
|
// 判断当前版本是否支持拉起客服会话
|
||||||
// 判断当前版本是否支持拉起客服会话
|
|
||||||
WXOpenCustomerServiceChat.Req req = new WXOpenCustomerServiceChat.Req();
|
WXOpenCustomerServiceChat.Req req = new WXOpenCustomerServiceChat.Req();
|
||||||
req.corpId = "ww1de4300858c0b461"; // 企业ID
|
req.corpId = "ww1de4300858c0b461"; // 企业ID
|
||||||
req.url = "https://work.weixin.qq.com/kfid/kfcb3d23a59c188a0e7"; // 客服URL
|
req.url = "https://work.weixin.qq.com/kfid/kfcb3d23a59c188a0e7"; // 客服URL
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
List<RoomPitBean> pitList2 = new ArrayList<>();
|
List<RoomPitBean> pitList2 = new ArrayList<>();
|
||||||
List<RoomPitBean> pitList3 = new ArrayList<>();
|
List<RoomPitBean> pitList3 = new ArrayList<>();
|
||||||
List<String> added = new ArrayList<>();
|
List<String> added = new ArrayList<>();
|
||||||
if (roomInfoResp.getSong_pit_list() != null && roomInfoResp.getSong_pit_list().size() > 0) {
|
if (roomInfoResp.getSong_pit_list() != null && !roomInfoResp.getSong_pit_list().isEmpty()) {
|
||||||
pitList2.addAll(roomInfoResp.getSong_pit_list());
|
pitList2.addAll(roomInfoResp.getSong_pit_list());
|
||||||
// 使用 HashSet 进行去重
|
// 使用 HashSet 进行去重
|
||||||
Set<RoomPitBean> uniquePitSet = new HashSet<>(pitList);
|
Set<RoomPitBean> uniquePitSet = new HashSet<>(pitList);
|
||||||
@@ -253,7 +253,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (roomInfoResp.getRoom_auction() != null) {
|
if (roomInfoResp.getRoom_auction() != null) {
|
||||||
if (roomInfoResp.getRoom_auction().getAuction_list() != null && roomInfoResp.getRoom_auction().getAuction_list().size() > 0) {
|
if (roomInfoResp.getRoom_auction().getAuction_list() != null && !roomInfoResp.getRoom_auction().getAuction_list().isEmpty()) {
|
||||||
for (int i = 0; i < roomInfoResp.getRoom_auction().getAuction_list().size(); i++) {
|
for (int i = 0; i < roomInfoResp.getRoom_auction().getAuction_list().size(); i++) {
|
||||||
RoomAuction.AuctionListBean auctionListBean = roomInfoResp.getRoom_auction().getAuction_list().get(i);
|
RoomAuction.AuctionListBean auctionListBean = roomInfoResp.getRoom_auction().getAuction_list().get(i);
|
||||||
RoomPitBean pitBean = new RoomPitBean();
|
RoomPitBean pitBean = new RoomPitBean();
|
||||||
@@ -287,9 +287,10 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
// 优先添加指定麦位
|
// 优先添加指定麦位
|
||||||
for (String targetPit : priorityPits) {
|
for (String targetPit : priorityPits) {
|
||||||
for (RoomPitBean bean : pitList) {
|
for (RoomPitBean bean : pitList) {
|
||||||
if (bean.getPit_number().equals(targetPit) &&
|
if (bean.getPit_number().equals(targetPit)
|
||||||
!bean.getUser_id().equals("0") && !bean.getUser_id().equals("") &&
|
&& !bean.getUser_id().isEmpty()
|
||||||
!bean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
&& !bean.getUser_id().equals("0")
|
||||||
|
&& !bean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||||
|
|
||||||
RewardUserBean rewardUserBean = new RewardUserBean();
|
RewardUserBean rewardUserBean = new RewardUserBean();
|
||||||
rewardUserBean.setUser_id(bean.getUser_id());
|
rewardUserBean.setUser_id(bean.getUser_id());
|
||||||
@@ -306,9 +307,10 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
|||||||
// 添加剩余的
|
// 添加剩余的
|
||||||
for (RoomPitBean bean : pitList) {
|
for (RoomPitBean bean : pitList) {
|
||||||
String pitNumber = bean.getPit_number();
|
String pitNumber = bean.getPit_number();
|
||||||
if (!added.contains(pitNumber) &&
|
if (!added.contains(pitNumber)
|
||||||
!bean.getUser_id().equals("0") && !bean.getUser_id().equals("") &&
|
&& !bean.getUser_id().isEmpty()
|
||||||
!bean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
&&!bean.getUser_id().equals("0")
|
||||||
|
&&!bean.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||||
|
|
||||||
RewardUserBean rewardUserBean = new RewardUserBean();
|
RewardUserBean rewardUserBean = new RewardUserBean();
|
||||||
rewardUserBean.setUser_id(bean.getUser_id());
|
rewardUserBean.setUser_id(bean.getUser_id());
|
||||||
|
|||||||
@@ -77,10 +77,7 @@ public class RoomOnlineDialogFragment extends BaseMvpDialogFragment<RoomPresente
|
|||||||
// 设置固定高度为 500dp
|
// 设置固定高度为 500dp
|
||||||
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||||
int heightInDp = (int) (screenHeight * 0.6f);
|
int heightInDp = (int) (screenHeight * 0.6f);
|
||||||
;
|
|
||||||
// int heightInPx = (int) (heightInDp * getResources().getDisplayMetrics().density);
|
|
||||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, heightInDp);
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, heightInDp);
|
||||||
|
|
||||||
// 可选:设置动画样式(从底部弹出)
|
// 可选:设置动画样式(从底部弹出)
|
||||||
window.setWindowAnimations(com.xscm.moduleutil.R.style.CommonShowDialogBottom);
|
window.setWindowAnimations(com.xscm.moduleutil.R.style.CommonShowDialogBottom);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,10 +92,9 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/user_recyclerView"
|
android:id="@+id/user_recyclerView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_27"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
android:layout_marginTop="@dimen/dp_5"
|
|
||||||
tools:listitem="@layout/item_like_user"/>
|
tools:listitem="@layout/item_like_user"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -114,10 +113,11 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/btn_close_live"
|
android:id="@+id/btn_close_live"
|
||||||
android:layout_width="@dimen/dp_24"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_24"
|
android:padding="@dimen/dp_4"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginStart="@dimen/dp_5"
|
||||||
android:src="@mipmap/room_colse" />
|
android:src="@mipmap/room_colse" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user