1:修改K歌房
2:修改房间展示每日任务 3:修改页面跳转 4:遗留问题在进入首页的时候出现首页刷新
This commit is contained in:
@@ -17,9 +17,10 @@
|
||||
android:name=".activity.RoomActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true"
|
||||
android:excludeFromRecents="false"
|
||||
android:exported="false"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:alwaysRetainTaskState="true"
|
||||
android:enableOnBackInvokedCallback="false"
|
||||
android:theme="@style/TransparentActivityTheme"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
|
||||
@@ -125,7 +125,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
var roomId: String? = null
|
||||
|
||||
var mRoomInfoResp: RoomInfoResp? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired
|
||||
var taskId: String? = null
|
||||
|
||||
var likeUserAdapter: LikeUserAdapter<RoomOnlineBean>? = null
|
||||
@@ -179,6 +180,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
roomId = intent.getStringExtra("roomId")
|
||||
mRoomInfoResp = intent.getSerializableExtra("roomInfo") as RoomInfoResp?
|
||||
LogUtils.dTag("RoomActivity", "doDone" + mRoomInfoResp.toString())
|
||||
taskId = intent.getStringExtra("taskId")
|
||||
}
|
||||
|
||||
|
||||
@@ -482,6 +484,20 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
private val testHandler = Handler()
|
||||
private var testRunnable: Runnable? = null
|
||||
|
||||
// override fun onNewIntent(intent: Intent?) {
|
||||
// super.onNewIntent(intent)
|
||||
// setIntent( intent)
|
||||
// Log.d("TAG", "=== onNewIntent called ===");
|
||||
// if (intent != null) {
|
||||
// val roomId = intent.getStringExtra("roomId")
|
||||
// redPacketInfo = intent.getSerializableExtra("redPacketInfo") as RedPacketInfo?
|
||||
// }
|
||||
// }
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
Log.d("TAG", "=== onDestroy called ===");
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
// 在super.onCreate之前设置主题以避免闪白屏
|
||||
@@ -489,7 +505,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
super.onCreate(savedInstanceState)
|
||||
// // 进入房间10s后检查是否显示提示上麦对话框
|
||||
LogUtils.e("RoomActivity", "onCreate")
|
||||
|
||||
isSave = false
|
||||
sDestroied = false
|
||||
isMinimized = false
|
||||
@@ -862,6 +877,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
val fragment = HourlyChartDialog.newInstance()
|
||||
fragment.show(supportFragmentManager, "HourlyChartDialog")
|
||||
}
|
||||
mBinding!!.clDayTask.visibility = View.VISIBLE
|
||||
mBinding!!.imDayTask.setOnClickListener {
|
||||
ARouter.getInstance().build(ARouteConstants.DailyTasksActivity).navigation()
|
||||
}
|
||||
|
||||
mBinding!!.drvRed.visibility = View.GONE
|
||||
mBinding!!.redBj.setOnClickListener {
|
||||
@@ -3508,8 +3527,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.ivQuanC.setOnClickListener { v: View? ->
|
||||
if (mRoomInfoResp!!.room_info.head_line.room_id != null && mRoomInfoResp!!.room_info.head_line.room_id.isNotEmpty()) {
|
||||
if (mRoomInfoResp!!.room_info.head_line.room_id != roomId) {
|
||||
RoomManager.getInstance()
|
||||
.fetchRoomDataAndEnter(applicationContext, mRoomInfoResp!!.room_info.head_line.room_id, "")
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(applicationContext, mRoomInfoResp!!.room_info.head_line.room_id, "",null)
|
||||
} else {
|
||||
com.blankj.utilcode.util.ToastUtils.showLong("您就在当前房间")
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
super(null);
|
||||
addItemType(1, com.xscm.moduleutil.R.layout.ease_row_received_message_system);//系统消息、官方公告
|
||||
addItemType(2, com.xscm.moduleutil.R.layout.ease_row_received_message_user_send);//用户发送的消息
|
||||
addItemType(3, com.xscm.moduleutil.R.layout.ease_row_received_message_giftr_send);//加入房间 、赠送礼物、上下麦、禁言 2025年6月12日15:42:08,让和聊天显示的是同一个额布局,后面需要修改
|
||||
addItemType(3, com.xscm.moduleutil.R.layout.ease_row_received_message_system);//加入房间 、赠送礼物、上下麦、禁言 2025年6月12日15:42:08,让和聊天显示的是同一个额布局,后面需要修改
|
||||
// addItemType(3, com.qxcm.moduleutil.R.layout.ease_row_received_message_join_room);//加入房间 、赠送礼物、上下麦、禁言
|
||||
addItemType(4, com.xscm.moduleutil.R.layout.ease_row_received_message_new_user);//新用户注册
|
||||
addItemType(5, com.xscm.moduleutil.R.layout.ease_row_received_message_wagging);//摇签
|
||||
@@ -350,14 +350,15 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
helper.getView(com.xscm.moduleutil.R.id.bubble1).setBackgroundResource(com.xscm.moduleutil.R.drawable.ease_row_pubilc_user_bg);
|
||||
// helper.getView(com.xscm.moduleutil.R.id.bubble1).setBackgroundResource(com.xscm.moduleutil.R.drawable.ease_row_pubilc_user_bg);
|
||||
// }
|
||||
// if (emMessage.getText().getFromUserInfo() != null && emMessage.getText().getFromUserInfo().getAvatar() != null) {
|
||||
// ImageUtils.loadHeadCC(emMessage.getText().getFromUserInfo().getAvatar(), helper.getView(com.xscm.moduleutil.R.id.avatar));
|
||||
// }
|
||||
// helper.setText(com.xscm.moduleutil.R.id.tv_name, emMessage.getText().getFromUserInfo().getNickname());
|
||||
// helper.setText(com.xscm.moduleutil.R.id.tv_content, emMessage.getText().getText());
|
||||
helper.setText(com.xscm.moduleutil.R.id.tv_content, getSpannable(emMessage));
|
||||
helper.getView(R.id.tv_content).setVisibility(View.VISIBLE);
|
||||
helper.setText(R.id.tv_content, getSpannable(emMessage));
|
||||
// List<String> images1 = emMessage.getText().getFromUserInfo().getIcon();
|
||||
// LinearLayout ll_images1 = helper.getView(com.xscm.moduleutil.R.id.line);
|
||||
// ll_images1.removeAllViews();
|
||||
|
||||
@@ -131,7 +131,7 @@ public class HourlyChartDialog extends BaseMvpDialogFragment<HourlyChartPresente
|
||||
|
||||
@Override
|
||||
public void onItemClick(RoomHourBean.RoomListBean item, int position) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), item.getRoom_id(),"");
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), item.getRoom_id(),"",null);
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -635,6 +635,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void roomInfoEvent(MusicFileBean messageEvent) {
|
||||
LogUtils.e("roomInfoEvent", messageEvent.getFileData());
|
||||
LyricsModel mLyricsModel = KaraokeView.parseLyricsData(messageEvent.getFileData());
|
||||
if (mLyricsModel != null) {
|
||||
mKaraokeView.setLyricsData(mLyricsModel);
|
||||
|
||||
@@ -33,6 +33,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.ObjectUtils;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.activity.RoomActivity;
|
||||
@@ -143,12 +144,12 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
Observable.timer(20, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> {
|
||||
upDtaView(true);
|
||||
});
|
||||
Observable.timer(500, TimeUnit.MILLISECONDS)
|
||||
// Observable.timer(20, TimeUnit.MILLISECONDS)
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(aLong -> {
|
||||
// upDtaView(true);
|
||||
// });
|
||||
Observable.timer(10, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> {
|
||||
upDtaView(false);
|
||||
@@ -165,7 +166,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
((RoomActivity) getActivity()).setvisibTop(true);
|
||||
}
|
||||
// 初始化 PopupWindow
|
||||
initPopupWindow();
|
||||
|
||||
isWhether2(isFirst);
|
||||
parentFragment = (RoomFragment) getParentFragment();
|
||||
|
||||
@@ -183,7 +184,8 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
// roomInfoUpdate(data);
|
||||
// }
|
||||
// });
|
||||
roomId = roomInfoResp.getRoom_info().getRoom_id();
|
||||
roomId = roomInfoResp.getRoom_info().getRoom_id(); initPopupWindow();
|
||||
|
||||
return super.onCreateView(inflater, container, savedInstanceState);
|
||||
}
|
||||
|
||||
@@ -229,35 +231,34 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
|
||||
/// 抱麦、锁麦
|
||||
private void initPopupWindow() {
|
||||
if (requireContext() == null) return;
|
||||
// 加载弹出视图布局
|
||||
View popupView = LayoutInflater.from(requireContext()).inflate(R.layout.popup_menu, null, false);
|
||||
// 加载弹出视图布局
|
||||
View popupView = LayoutInflater.from(getContext()).inflate(R.layout.popup_menu, null, false);
|
||||
|
||||
// 创建 PopupWindow
|
||||
// 创建 PopupWindow
|
||||
// popupWindow = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
|
||||
// 设置固定宽高(单位是像素)
|
||||
int screenWidth = displayMetrics.widthPixels;
|
||||
int screenHeight = displayMetrics.heightPixels;
|
||||
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
|
||||
// 设置固定宽高(单位是像素)
|
||||
int screenWidth = displayMetrics.widthPixels;
|
||||
int screenHeight = displayMetrics.heightPixels;
|
||||
|
||||
int popupWidth = (int) (screenWidth * 0.35); // 屏幕宽度的 60%
|
||||
int popupHeight = (int) (screenHeight * 0.13); // 屏幕高度的 40%
|
||||
int popupWidth = (int) (screenWidth * 0.35); // 屏幕宽度的 60%
|
||||
int popupHeight = (int) (screenHeight * 0.13); // 屏幕高度的 40%
|
||||
|
||||
|
||||
popupWindow = new PopupWindow(popupView, popupWidth, popupHeight, true);
|
||||
popupWindow = new PopupWindow(popupView, popupWidth, popupHeight, true);
|
||||
|
||||
// 必须设置背景,否则布局会压缩
|
||||
popupWindow.setBackgroundDrawable(getResources().getDrawable(com.xscm.moduleutil.R.drawable.bg_r16_fff));
|
||||
// 必须设置背景,否则布局会压缩
|
||||
popupWindow.setBackgroundDrawable(getResources().getDrawable(com.xscm.moduleutil.R.drawable.bg_r16_fff));
|
||||
|
||||
// 设置动画效果(可选)
|
||||
popupWindow.setAnimationStyle(com.xscm.moduleutil.R.style.PopupAnimation);
|
||||
// 设置动画效果(可选)
|
||||
popupWindow.setAnimationStyle(com.xscm.moduleutil.R.style.PopupAnimation);
|
||||
|
||||
// 设置点击外部区域时自动关闭
|
||||
popupWindow.setOutsideTouchable(true);
|
||||
popupWindow.setFocusable(true);
|
||||
// 设置点击外部区域时自动关闭
|
||||
popupWindow.setOutsideTouchable(true);
|
||||
popupWindow.setFocusable(true);
|
||||
|
||||
// 设置弹出视图中的点击事件
|
||||
setPopupMenuClickListener(popupView, null);
|
||||
// 设置弹出视图中的点击事件
|
||||
setPopupMenuClickListener(popupView, null);
|
||||
}
|
||||
|
||||
private void setPopupMenuClickListener(View popupView, View view) {
|
||||
@@ -410,7 +411,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
|
||||
|
||||
FlexboxLayout flexboxLayout = mBinding.flexboxLayout;
|
||||
wheatLayoutSingManager = new WheatLayoutSingManager(requireContext(), flexboxLayout);
|
||||
wheatLayoutSingManager = new WheatLayoutSingManager(CommonAppContext.getInstance(), flexboxLayout);
|
||||
if (!isFirst) {
|
||||
wheatLayoutSingManager.setOnWheatClickListener(new WheatLayoutSingManager.OnWheatClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
|
||||
import com.example.moduleroom.contacts.RoomBackgroundContacts;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.RoomBgBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
@@ -38,7 +39,7 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
|
||||
@Override
|
||||
public void uploadFile(File file, int type, int index, int size) {
|
||||
String url = OSSOperUtils.getPath(file, type);
|
||||
CosUploadManager.getInstance().upParameters(url,file.getPath(), new CosUploadManager.UploadCallback() {
|
||||
CosUploadManager.getInstance(CommonAppContext.getInstance()).upParameters(url,file.getPath(), new CosUploadManager.UploadCallback() {
|
||||
@Override
|
||||
public void onSuccess(String url) {
|
||||
if (isViewAttach()) {
|
||||
@@ -51,6 +52,12 @@ public class RoomBackgroundPresenter extends BasePresenter<RoomBackgroundContact
|
||||
public void onFailure(Exception e) {
|
||||
ToastUtils.show("上传失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure1(IllegalStateException e) {
|
||||
ToastUtils.show("上传失败");
|
||||
MvpRef.get().disLoadings();
|
||||
}
|
||||
});
|
||||
// OSSOperUtils.newInstance().putObjectMethod(url, file.getPath(), new OSSOperUtils.OssCallback() {
|
||||
// @Override
|
||||
|
||||
@@ -84,6 +84,29 @@
|
||||
|
||||
</com.xscm.moduleutil.widget.DropRedView>
|
||||
|
||||
<com.xscm.moduleutil.widget.DropDayTaskView
|
||||
android:id="@+id/cl_day_task"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:gravity="right"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible"
|
||||
android:elevation="4dp"
|
||||
android:visibility="invisible">
|
||||
<!-- android:background="@mipmap/room_xsb"-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_day_task"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:src="@mipmap/day_task"
|
||||
android:scaleType="fitCenter"/>
|
||||
|
||||
|
||||
</com.xscm.moduleutil.widget.DropDayTaskView>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_bg"
|
||||
@@ -146,7 +169,7 @@
|
||||
android:id="@+id/vp_room_pager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -157,7 +180,7 @@
|
||||
android:id="@+id/ease_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -496,8 +519,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_sound_effects"
|
||||
android:layout_width="@dimen/dp_46"
|
||||
android:layout_height="@dimen/dp_78"
|
||||
android:layout_width="@dimen/dp_56"
|
||||
android:layout_height="@dimen/dp_27"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_14"
|
||||
android:src="@mipmap/room_sound_effects"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3"
|
||||
android:background="#40000000"
|
||||
android:background="#4d000000"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
Reference in New Issue
Block a user