feat:完成房间部分UI改版:标题栏新增头像、新增在线列表展示、去掉游戏房小麦位、调整小时榜、房间榜、音乐入口的UI位置
This commit is contained in:
@@ -60,6 +60,7 @@ import com.chwl.app.music.widget.MusicPlayerView
|
||||
import com.chwl.app.public_chat.ui.message.HeadlineViewModel
|
||||
import com.chwl.app.room_chat.activity.RoomMsgActivity
|
||||
import com.chwl.app.ui.pay.ChargeActivity
|
||||
import com.chwl.app.ui.webview.DialogWebViewActivity
|
||||
import com.chwl.app.ui.widget.ButtonItem
|
||||
import com.chwl.app.ui.widget.GiftDialog
|
||||
import com.chwl.app.ui.widget.GiftDialog.OnGiftDialogBtnClickListener
|
||||
@@ -76,6 +77,7 @@ import com.chwl.app.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||
import com.chwl.app.utils.KeyBoardUtils
|
||||
import com.chwl.app.vip.dialog.SelectPayTypeDialog
|
||||
import com.chwl.core.Constants
|
||||
import com.chwl.core.UriProvider
|
||||
import com.chwl.core.auth.AuthModel
|
||||
import com.chwl.core.bean.RoomMicInfo
|
||||
import com.chwl.core.gift.GiftModel
|
||||
@@ -790,6 +792,9 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
R.id.input_headline_send -> {
|
||||
sendHeadline()
|
||||
}
|
||||
R.id.layout_room_rank -> {
|
||||
DialogWebViewActivity.start(mContext, UriProvider.getRoomRanking())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,6 @@ import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.View.OnTouchListener
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@@ -16,8 +15,8 @@ import com.chwl.app.avroom.adapter.GameMiniMicroViewAdapter
|
||||
import com.chwl.app.avroom.adapter.OnMicroItemClickListener
|
||||
import com.chwl.app.avroom.game.GameDelegate
|
||||
import com.chwl.app.avroom.game.OnGameStatusChangeListener
|
||||
import com.chwl.app.avroom.online.RoomOnlineWidget
|
||||
import com.chwl.app.avroom.presenter.GameRoomPresenter
|
||||
import com.chwl.app.avroom.rank.RoomRankWidget
|
||||
import com.chwl.app.avroom.view.IGameRoomView
|
||||
import com.chwl.app.databinding.FragmentGameRoomBinding
|
||||
import com.chwl.app.ui.widget.GiftDialog.OnGiftDialogBtnClickListener
|
||||
@@ -70,7 +69,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.mgId
|
||||
)
|
||||
gameDelegate.setOnGameStatusChangeListener(this)
|
||||
gameBinding.rankWidget.setContentBackgroundResource(R.drawable.room_rank_widget_bg_game)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -143,14 +141,14 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
super.updateView()
|
||||
gameDelegate.updateGame(AvRoomDataManager.get().mCurrentRoomInfo?.mgId)
|
||||
gameBinding.roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
if (isSixMic()) {
|
||||
gameBinding.tvShowMiniMic.isVisible = !isShowMiniMic
|
||||
gameBinding.ivShowMic.isVisible = isShowMiniMic
|
||||
} else {
|
||||
showMic()
|
||||
gameBinding.tvShowMiniMic.isInvisible = true
|
||||
gameBinding.ivShowMic.isVisible = false
|
||||
}
|
||||
// if (isSixMic()) {
|
||||
// gameBinding.tvShowMiniMic.isVisible = !isShowMiniMic
|
||||
// gameBinding.ivShowMic.isVisible = isShowMiniMic
|
||||
// } else {
|
||||
// showMic()
|
||||
// gameBinding.tvShowMiniMic.isInvisible = true
|
||||
// gameBinding.ivShowMic.isVisible = false
|
||||
// }
|
||||
gameBinding.microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
@@ -212,6 +210,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
registerWidget(RoomOnlineWidget::class.java.simpleName, gameBinding.onlineWidget)
|
||||
}
|
||||
}
|
@@ -20,6 +20,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.chwl.app.avroom.adapter.SelectGameAdapter;
|
||||
import com.chwl.app.home.helper.OpenRoomHelper;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtilsV2;
|
||||
import com.chwl.app.ui.widget.GiftDialog;
|
||||
import com.chwl.app.ui.widget.UserInfoDialog;
|
||||
import com.chwl.core.room.bean.RoomModeType;
|
||||
@@ -35,7 +37,6 @@ import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.avroom.activity.AVRoomActivity;
|
||||
import com.chwl.app.avroom.activity.RoomOnlineUserActivity;
|
||||
import com.chwl.app.avroom.dialog.ExitRoomPopupWindow;
|
||||
import com.chwl.app.avroom.widget.GiftV2View;
|
||||
import com.chwl.app.avroom.widget.RoomEffectView;
|
||||
@@ -118,6 +119,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
super.onNewIntent(intent);
|
||||
// clear views
|
||||
roomTitle.setText("");
|
||||
gameMainBinding.ivRoomCover.setImageResource(R.drawable.default_cover);
|
||||
setRoomId(0, 0);
|
||||
updateOnlineNumberView(0);
|
||||
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||
@@ -202,7 +204,6 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
roomMore.setOnClickListener(this);
|
||||
ivFollowRoom.setOnClickListener(this);
|
||||
// ivRoomShare.setOnClickListener(this);
|
||||
gameMainBinding.llRoomInfo.setOnClickListener(this);
|
||||
gameMainBinding.ivBack.setOnClickListener(this);
|
||||
|
||||
mRoomEffectView.setOnPlayAnimCallback(new Function0<Boolean>() {
|
||||
@@ -452,6 +453,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
gameMainBinding.setRoomInfo(currentRoomInfo);
|
||||
updateHasAnimationEffect();
|
||||
roomTitle.setText(RegexUtil.getPrintableString(currentRoomInfo.getTitle()));
|
||||
ImageLoadUtilsV2.loadImage(gameMainBinding.ivRoomCover, currentRoomInfo.getAvatar());
|
||||
if (!StringUtil.isEmpty(currentRoomInfo.getRoomPwd())) {
|
||||
roomTitle.setCompoundDrawablesWithIntrinsicBounds(null, null,
|
||||
getResources().getDrawable(R.drawable.icon_room_lock), null);
|
||||
@@ -524,9 +526,6 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
ExitRoomPopupWindow.newInstance((AVRoomActivity) requireActivity())
|
||||
.showAtLocation(gameMainBinding.getRoot(), gravity, 0, 0);
|
||||
break;
|
||||
case R.id.ll_room_info:
|
||||
RoomOnlineUserActivity.start(getActivity());
|
||||
break;
|
||||
case R.id.iv_follow_room:
|
||||
followRoom();
|
||||
break;
|
||||
@@ -661,7 +660,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
||||
onlineNumber = 1;
|
||||
}
|
||||
}
|
||||
gameMainBinding.roomNums.setText(ResUtil.getString(R.string.avroom_fragment_homepartyfragment_013) + onlineNumber);
|
||||
// gameMainBinding.roomNums.setText(ResUtil.getString(R.string.avroom_fragment_homepartyfragment_013) + onlineNumber);
|
||||
}
|
||||
|
||||
public void showUserCardDialog(String uid){
|
||||
|
@@ -8,9 +8,7 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.chwl.app.avroom.gameplay.RoomGameplayListWidget;
|
||||
import com.chwl.app.avroom.gameplay.RoomGameplayWidget;
|
||||
import com.chwl.app.avroom.rank.RoomRankWidget;
|
||||
import com.chwl.app.avroom.online.RoomOnlineWidget;
|
||||
import com.chwl.app.music.widget.MusicPlayerView;
|
||||
import com.chwl.app.ui.webview.DialogWebViewActivity;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
@@ -135,7 +133,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
@Override
|
||||
public void initWidget() {
|
||||
super.initWidget();
|
||||
registerWidget(RoomRankWidget.class.getSimpleName(), gameBinding.rankWidget);
|
||||
registerWidget(RoomOnlineWidget.class.getSimpleName(), gameBinding.onlineWidget);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
|
@@ -13,10 +13,8 @@ import com.chwl.app.avroom.adapter.OnMicroItemClickListener
|
||||
import com.chwl.app.avroom.adapter.SingleAnchorMicroViewAdapter
|
||||
import com.chwl.app.avroom.adapter.SingleRoomPKMicroViewAdapter
|
||||
import com.chwl.app.avroom.dialog.RequestUpMicDialog
|
||||
import com.chwl.app.avroom.gameplay.RoomGameplayListWidget
|
||||
import com.chwl.app.avroom.gameplay.RoomGameplayWidget
|
||||
import com.chwl.app.avroom.online.RoomOnlineWidget
|
||||
import com.chwl.app.avroom.presenter.SingleRoomPresenter
|
||||
import com.chwl.app.avroom.rank.RoomRankWidget
|
||||
import com.chwl.app.avroom.singleroompk.SingleRoomPkFinishDialog
|
||||
import com.chwl.app.avroom.singleroompk.SingleRoomPkForceFinishDialog
|
||||
import com.chwl.app.avroom.singleroompk.SingleRoomPkReceivedDialog
|
||||
@@ -237,7 +235,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
|
||||
override fun initWidget() {
|
||||
super.initWidget()
|
||||
registerWidget(RoomRankWidget::class.java.simpleName, gameBinding.rankWidget)
|
||||
registerWidget(RoomOnlineWidget::class.java.simpleName, gameBinding.onlineWidget)
|
||||
}
|
||||
|
||||
override fun onInitMusicPlayerView(view: MusicPlayerView) {
|
||||
|
@@ -0,0 +1,39 @@
|
||||
package com.chwl.app.avroom.online
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.chad.library.adapter.base.diff.BaseQuickDiffCallback
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.ui.utils.loadAvatar
|
||||
|
||||
class RoomOnlineAvatarAdapter :
|
||||
BaseQuickAdapter<Pair<String, String?>, BaseViewHolder>(R.layout.room_online_widget_item_avatar) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: Pair<String, String?>?) {
|
||||
val avatarView = helper.getView<ImageView>(R.id.iv_avatar)
|
||||
avatarView.loadAvatar(item?.second)
|
||||
}
|
||||
|
||||
fun updateData(list: List<Pair<String, String?>>?) {
|
||||
val newList = ArrayList<Pair<String, String?>>()
|
||||
if (list != null) {
|
||||
newList.addAll(list)
|
||||
}
|
||||
setNewDiffData(object : BaseQuickDiffCallback<Pair<String, String?>>(newList) {
|
||||
override fun areItemsTheSame(
|
||||
oldItem: Pair<String, String?>,
|
||||
newItem: Pair<String, String?>
|
||||
): Boolean {
|
||||
return newItem.first == oldItem.first
|
||||
}
|
||||
|
||||
override fun areContentsTheSame(
|
||||
oldItem: Pair<String, String?>,
|
||||
newItem: Pair<String, String?>
|
||||
): Boolean {
|
||||
return newItem.second == oldItem.second
|
||||
}
|
||||
}, true)
|
||||
}
|
||||
}
|
208
app/src/main/java/com/chwl/app/avroom/online/RoomOnlineWidget.kt
Normal file
208
app/src/main/java/com/chwl/app/avroom/online/RoomOnlineWidget.kt
Normal file
@@ -0,0 +1,208 @@
|
||||
package com.chwl.app.avroom.online
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Outline
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewOutlineProvider
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.avroom.activity.RoomOnlineUserActivity
|
||||
import com.chwl.app.databinding.RoomOnlineWidgetBinding
|
||||
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil
|
||||
import com.chwl.app.ui.widget.recyclerview.decoration.VerticalDecoration
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.manager.IMNetEaseManager
|
||||
import com.chwl.core.manager.RoomEvent
|
||||
import com.chwl.core.room.core.RoomDataService
|
||||
import com.chwl.core.room.model.AvRoomModel
|
||||
import com.chwl.core.support.room.FrameLayoutRoomWidget
|
||||
import com.chwl.core.support.room.RoomContext
|
||||
import com.chwl.core.support.room.RoomView
|
||||
import com.chwl.core.support.room.RoomWidget
|
||||
import com.example.lib_utils.UiUtils
|
||||
import com.example.lib_utils.ktx.singleClick
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessageExtension
|
||||
import io.reactivex.Observable
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class RoomOnlineWidget : FrameLayoutRoomWidget, RoomWidget {
|
||||
|
||||
companion object {
|
||||
const val MAX_DISPLAY_COUNT = 3
|
||||
private const val ONLINE_DISPLAY_LIST = "online_display_list"
|
||||
private const val ONLINE_NUMBER = "online_number"
|
||||
}
|
||||
|
||||
private val binding: RoomOnlineWidgetBinding =
|
||||
DataBindingUtil.inflate(
|
||||
LayoutInflater.from(
|
||||
context
|
||||
), R.layout.room_online_widget, this, true
|
||||
)
|
||||
|
||||
private val adapter = RoomOnlineAvatarAdapter()
|
||||
|
||||
private var dataList: MutableList<Pair<String, String?>>? = null
|
||||
|
||||
private val dataService: RoomDataService?
|
||||
get() = roomContext?.findAbility<RoomDataService>(
|
||||
RoomDataService::class.java.simpleName
|
||||
)
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes)
|
||||
|
||||
init {
|
||||
this.singleClick {
|
||||
RoomOnlineUserActivity.start(context)
|
||||
}
|
||||
adapter.setOnItemClickListener { adapter, view, position ->
|
||||
RoomOnlineUserActivity.start(context)
|
||||
}
|
||||
binding.recyclerView.adapter = adapter
|
||||
binding.recyclerView.addItemDecoration(
|
||||
VerticalDecoration(
|
||||
UIUtil.dip2px(context, 4.5),
|
||||
false,
|
||||
false
|
||||
)
|
||||
)
|
||||
binding.recyclerView.outlineProvider = object : ViewOutlineProvider() {
|
||||
override fun getOutline(view: View?, outline: Outline?) {
|
||||
outline?.setRect(
|
||||
0,
|
||||
0,
|
||||
(view?.width ?: 0) - UiUtils.dip2px(9f),
|
||||
(view?.height ?: 0),
|
||||
)
|
||||
}
|
||||
}
|
||||
binding.recyclerView.clipToOutline = true
|
||||
}
|
||||
|
||||
override fun onInitialize(roomView: RoomView, roomContext: RoomContext) {
|
||||
super.onInitialize(roomView, roomContext)
|
||||
(dataService?.getData(ONLINE_NUMBER) as? Int)?.let {
|
||||
updateCount(it)
|
||||
}
|
||||
(dataService?.getData(ONLINE_DISPLAY_LIST) as? MutableList<Pair<String, String?>>)?.let {
|
||||
updateList(it)
|
||||
}
|
||||
startUpdateOnlineTask()
|
||||
registerMemberChangedListener()
|
||||
}
|
||||
|
||||
override fun onUnbindContext() {
|
||||
super.onUnbindContext()
|
||||
updateList(null)
|
||||
updateCount(0)
|
||||
}
|
||||
|
||||
private fun refreshData() {
|
||||
val disposable = AvRoomModel.get()
|
||||
.getRoomOnlineList(AvRoomDataManager.get().roomUid)
|
||||
.subscribe({
|
||||
updateList(it.take(MAX_DISPLAY_COUNT).map {
|
||||
Pair<String, String?>(it.uid.toString(), it.avatar)
|
||||
}.toMutableList())
|
||||
updateCount(it.size)
|
||||
}, {
|
||||
it.printStackTrace()
|
||||
})
|
||||
getCompositeDisposable().add(disposable)
|
||||
}
|
||||
|
||||
private fun updateCount(count: Int) {
|
||||
dataService?.putData(ONLINE_NUMBER, count)
|
||||
binding.tvNumber.text = count.toString()
|
||||
}
|
||||
|
||||
private fun updateList(list: MutableList<Pair<String, String?>>?) {
|
||||
dataService?.putData(ONLINE_DISPLAY_LIST, list)
|
||||
this.dataList = list
|
||||
adapter.updateData(list)
|
||||
}
|
||||
|
||||
private fun startUpdateOnlineTask() {
|
||||
getCompositeDisposable().add(Observable.interval(
|
||||
0, 10, TimeUnit.SECONDS
|
||||
).subscribe {
|
||||
refreshData()
|
||||
})
|
||||
}
|
||||
|
||||
private fun registerMemberChangedListener() {
|
||||
getCompositeDisposable().add(IMNetEaseManager.get().chatRoomEventObservable.subscribe {
|
||||
when (it.event) {
|
||||
RoomEvent.ROOM_MEMBER_IN -> {
|
||||
updateOnlineCount(1)
|
||||
toItem(it.account, it.chatRoomMessage)?.let {
|
||||
tryUpdateList(it, true)
|
||||
}
|
||||
}
|
||||
|
||||
RoomEvent.ROOM_MEMBER_EXIT -> {
|
||||
updateOnlineCount(-1)
|
||||
toItem(it.account, it.chatRoomMessage)?.let {
|
||||
tryUpdateList(it, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun toItem(account: String?, message: ChatRoomMessage?): Pair<String, String?>? {
|
||||
if (account == null) {
|
||||
return null
|
||||
}
|
||||
if (message == null) {
|
||||
return Pair(account, null)
|
||||
}
|
||||
val messageExtension: ChatRoomMessageExtension = message.chatRoomMessageExtension
|
||||
var avatar = messageExtension.senderAvatar
|
||||
val extensionData = messageExtension.senderExtension.get(account) as? Map<String, Any>
|
||||
avatar = (extensionData?.getOrElse("avatar") {
|
||||
avatar
|
||||
} as? String) ?: avatar
|
||||
return Pair(account, avatar)
|
||||
}
|
||||
|
||||
private fun tryUpdateList(item: Pair<String, String?>, enterOrExit: Boolean) {
|
||||
val index = dataList?.indexOfFirst {
|
||||
it.first == item.first
|
||||
} ?: -1
|
||||
if (enterOrExit) {
|
||||
if (index < 0 && (dataList?.size ?: 0) < MAX_DISPLAY_COUNT) {
|
||||
dataList?.add(item)
|
||||
updateList(dataList)
|
||||
}
|
||||
} else {
|
||||
if (index >= 0) {
|
||||
dataList?.removeAt(index)
|
||||
updateList(dataList)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateOnlineCount(addCount: Int) {
|
||||
val number = binding.tvNumber.text.toString().toIntOrNull()
|
||||
if (number != null) {
|
||||
binding.tvNumber.text = (number + addCount).toString()
|
||||
}
|
||||
}
|
||||
}
|
@@ -4,7 +4,7 @@ import android.annotation.SuppressLint;
|
||||
|
||||
import com.chwl.app.avroom.view.IHomePartyUserListView;
|
||||
import com.chwl.app.base.BaseMvpPresenter;
|
||||
import com.chwl.core.room.model.HomePartyUserListModel;
|
||||
import com.chwl.core.room.model.AvRoomModel;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
@@ -14,15 +14,12 @@ import com.chwl.core.room.model.HomePartyUserListModel;
|
||||
*/
|
||||
public class HomePartyUserListPresenter extends BaseMvpPresenter<IHomePartyUserListView> {
|
||||
|
||||
private final HomePartyUserListModel mHomePartyUserListMode;
|
||||
|
||||
public HomePartyUserListPresenter() {
|
||||
mHomePartyUserListMode = new HomePartyUserListModel();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void requestRoomOnlineList(long roomUid){
|
||||
mHomePartyUserListMode.getRoomOnlineList(roomUid).compose(bindToLifecycle()).subscribe((data, throwable) -> {
|
||||
AvRoomModel.get().getRoomOnlineList(roomUid).compose(bindToLifecycle()).subscribe((data, throwable) -> {
|
||||
if (getMvpView() != null) {
|
||||
if (data != null) {
|
||||
getMvpView().onRequestRoomOnlineListSuccess(data);
|
||||
|
BIN
app/src/main/res/drawable-xxhdpi/room_bg_online_user_border.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/room_bg_online_user_border.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/room_ic_online_number.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/room_ic_online_number.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 974 B |
BIN
app/src/main/res/drawable-xxhdpi/room_ic_rank.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/room_ic_rank.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#33170ACD"
|
||||
android:startColor="#8C2B00CA" />
|
||||
<solid android:color="#33FFFFFF"/>
|
||||
<corners android:radius="11dp" />
|
||||
</shape>
|
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<size android:width="@dimen/dp_5"/>
|
||||
</shape>
|
@@ -68,53 +68,85 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:divider="@drawable/room_divider_left_top_panel"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_hour_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:background="@drawable/room_bg_hour_rank"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="@dimen/dp_6"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_hour_rank" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:text="@string/hour_rank"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_room_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:background="@drawable/room_bg_hour_rank"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_rank" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:text="@string/room_rank"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_music"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:src="@drawable/room_ic_music"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.chwl.app.avroom.rank.RoomRankWidget
|
||||
android:id="@+id/rank_widget"
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.chwl.app.avroom.online.RoomOnlineWidget
|
||||
android:id="@+id/online_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/layout_left_top_menu"
|
||||
android:layout_alignParentEnd="true" />
|
||||
tools:layout_width="10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dating_step"
|
||||
@@ -152,10 +184,10 @@
|
||||
|
||||
<com.chwl.app.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/message_indicator"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_below="@id/micro_view"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginTop="@dimen/dp_5" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
@@ -194,9 +226,9 @@
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/bottom_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_dating_queuing_micro"
|
||||
@@ -320,13 +352,13 @@
|
||||
android:src="@android:drawable/ic_menu_send" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:id="@+id/input_headline_send"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_headline_send" />
|
||||
android:src="@drawable/room_ic_headline_send"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@@ -50,37 +50,35 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:scaleType="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="@dimen/dp_14"
|
||||
android:paddingEnd="@dimen/dp_5"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/arrow_left_white"
|
||||
app:layout_constraintBottom_toBottomOf="@id/space_title_bar"
|
||||
app:layout_constraintStart_toStartOf="@id/space_title_bar"
|
||||
app:layout_constraintTop_toTopOf="@id/space_title_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_room_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:orientation="vertical"
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/iv_room_cover"
|
||||
android:layout_width="@dimen/dp_31"
|
||||
android:layout_height="@dimen/dp_31"
|
||||
app:layout_constraintBottom_toBottomOf="@id/space_title_bar"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_back"
|
||||
app:layout_constraintTop_toTopOf="@id/space_title_bar">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
app:layout_constraintTop_toTopOf="@id/space_title_bar"
|
||||
android:padding="@dimen/dp_0_5"
|
||||
app:shapeAppearance="@style/shape_circle"
|
||||
android:src="@drawable/default_cover"
|
||||
app:strokeColor="@color/white"
|
||||
app:strokeWidth="@dimen/dp_1" />
|
||||
|
||||
<com.chwl.app.avroom.widget.FixRoomTitleTextView
|
||||
android:id="@+id/room_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:drawablePadding="5dp"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
@@ -88,52 +86,35 @@
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:maxWidth="200dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_15"
|
||||
android:textColor="#EFEBF3"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_room_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_room_cover"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="@string/layout_fragment_chatroom_game_main_02" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_close_gift"
|
||||
android:visibility="@{hasAnimationEffect?View.GONE:View.VISIBLE}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.chwl.app.common.widget.CircleImageView
|
||||
android:layout_width="@dimen/dp_3"
|
||||
android:layout_height="@dimen/dp_3"
|
||||
android:src="#3EFED7" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_nums"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/sp_10"
|
||||
tools:text="@string/layout_fragment_chatroom_game_main_03" />
|
||||
|
||||
<com.chwl.app.avroom.widget.FixRoomTitleTextView
|
||||
android:id="@+id/room_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textSize="@dimen/dp_9"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_room_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/room_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/room_title"
|
||||
tools:text="ID:8888" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/iv_close_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:src="@drawable/ic_close_gift"
|
||||
android:visibility="@{hasAnimationEffect?View.GONE:View.VISIBLE}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/room_title"
|
||||
app:layout_constraintStart_toEndOf="@id/room_title"
|
||||
app:layout_constraintTop_toTopOf="@id/room_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_change_game"
|
||||
|
@@ -30,11 +30,55 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.chwl.app.avroom.rank.RoomRankWidget
|
||||
android:id="@+id/rank_widget"
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_left_top_menu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="80dp" />
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:divider="@drawable/room_divider_left_top_panel"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_room_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:background="@drawable/room_bg_hour_rank"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_rank" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:text="@string/room_rank"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.chwl.app.avroom.online.RoomOnlineWidget
|
||||
android:id="@+id/online_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout_width="10dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -44,6 +88,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:visibility="invisible"
|
||||
android:id="@+id/tv_show_mini_mic"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="23dp"
|
||||
|
@@ -44,18 +44,18 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_hour_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_95"
|
||||
android:background="@drawable/room_bg_hour_rank"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="@dimen/dp_6"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_width="@dimen/dp_15"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_hour_rank" />
|
||||
@@ -63,31 +63,64 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/hour_rank"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_room_rank"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:background="@drawable/room_bg_hour_rank"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_hour_rank"
|
||||
app:layout_constraintStart_toEndOf="@id/layout_hour_rank"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_hour_rank">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/room_ic_rank" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:text="@string/room_rank"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_10" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_hour_rank"
|
||||
app:layout_constraintStart_toEndOf="@id/layout_hour_rank"
|
||||
app:layout_constraintStart_toEndOf="@id/layout_room_rank"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_hour_rank"
|
||||
android:id="@+id/iv_music"
|
||||
android:layout_width="@dimen/dp_22"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:src="@drawable/room_ic_music"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.chwl.app.avroom.rank.RoomRankWidget
|
||||
android:id="@+id/rank_widget"
|
||||
<com.chwl.app.avroom.online.RoomOnlineWidget
|
||||
android:id="@+id/online_widget"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_hour_rank"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_hour_rank"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/layout_hour_rank"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/layout_hour_rank" />
|
||||
tools:layout_width="10dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_fans_team"
|
||||
|
55
app/src/main/res/layout/room_online_widget.xml
Normal file
55
app/src/main/res/layout/room_online_widget.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/layout_root"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_25"
|
||||
android:paddingEnd="@dimen/dp_6"
|
||||
tools:background="@color/black">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_marginEnd="@dimen/dp_22"
|
||||
android:orientation="horizontal"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="2"
|
||||
tools:listitem="@layout/room_online_widget_item_avatar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:background="@drawable/shape_circle_white33"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_10"
|
||||
android:layout_height="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:src="@drawable/room_ic_online_number" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_9"
|
||||
app:autoSizeMaxTextSize="@dimen/dp_9"
|
||||
app:autoSizeMinTextSize="@dimen/dp_6"
|
||||
app:autoSizeStepGranularity="1px"
|
||||
app:autoSizeTextType="uniform" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</layout>
|
26
app/src/main/res/layout/room_online_widget_item_avatar.xml
Normal file
26
app/src/main/res/layout/room_online_widget_item_avatar.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/room_bg_online_user_border"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_avatar"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_avatar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -674,7 +674,7 @@ public final class IMNetEaseManager {
|
||||
if (ListUtils.isListEmpty(targets)) {
|
||||
return;
|
||||
}
|
||||
chatRoomMemberExit(targets.get(0));
|
||||
chatRoomMemberExit(targets.get(0), msg);
|
||||
SuperAdminDataMrg.get().handleMemberOutRoom(targets.get(0));
|
||||
|
||||
} else if (attachment.getType() == NotificationType.ChatRoomManagerAdd) {
|
||||
@@ -1629,7 +1629,7 @@ public final class IMNetEaseManager {
|
||||
private void chatRoomMemberIn(final String account, ChatRoomMessage msg) {
|
||||
List<String> list = new ArrayList<>(1);
|
||||
list.add(account);
|
||||
noticeRoomMemberChange(true, account);
|
||||
noticeRoomMemberChange(true, account, msg);
|
||||
ChatRoomMessageExtension messageExtension = msg.getChatRoomMessageExtension();
|
||||
ChatRoomMember chatRoomMember = new ChatRoomMember();
|
||||
Map<String, Object> extensionMap = null;
|
||||
@@ -1721,8 +1721,8 @@ public final class IMNetEaseManager {
|
||||
/**
|
||||
* 退出房間處理
|
||||
*/
|
||||
private void chatRoomMemberExit(String account) {
|
||||
noticeRoomMemberChange(false, account);
|
||||
private void chatRoomMemberExit(String account, ChatRoomMessage message) {
|
||||
noticeRoomMemberChange(false, account, message);
|
||||
RoomInfo mCurrentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (mCurrentRoomInfo == null) return;
|
||||
|
||||
@@ -3328,9 +3328,10 @@ public final class IMNetEaseManager {
|
||||
.setRoomQueueInfo(roomQueueInfo));
|
||||
}
|
||||
|
||||
private void noticeRoomMemberChange(boolean isMemberIn, String account) {
|
||||
private void noticeRoomMemberChange(boolean isMemberIn, String account, ChatRoomMessage msg) {
|
||||
getChatRoomEventObservable().onNext(new RoomEvent()
|
||||
.setAccount(account)
|
||||
.setChatRoomMessage(msg)
|
||||
.setEvent(isMemberIn ? RoomEvent.ROOM_MEMBER_IN : RoomEvent.ROOM_MEMBER_EXIT));
|
||||
}
|
||||
|
||||
|
@@ -40,8 +40,6 @@ import retrofit2.http.Query;
|
||||
*/
|
||||
public class HomePartyUserListModel extends RoomBaseModel implements IHomePartyUserListModel {
|
||||
|
||||
private HomePartyUserListModel.Api api = RxNet.create(HomePartyUserListModel.Api.class);
|
||||
|
||||
/**
|
||||
* 分页获取房间成员:第一页包含队列成员,固定成员,游客50人,之后每一页获取游客50人
|
||||
*
|
||||
@@ -227,21 +225,4 @@ public class HomePartyUserListModel extends RoomBaseModel implements IHomePartyU
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Single<List<RoomOnlineUserBean>> getRoomOnlineList(long roomUid) {
|
||||
return api.getRoomOnlineList(roomUid)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
private interface Api {
|
||||
/**
|
||||
* 房间在线列表
|
||||
* @return
|
||||
*/
|
||||
@GET("/room/v2/online")
|
||||
Single<ServiceResult<List<RoomOnlineUserBean>>> getRoomOnlineList(@Query("roomUid") long roomUid);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import android.util.SparseArray;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chwl.core.room.bean.RoomIcon;
|
||||
import com.chwl.core.room.bean.RoomOnlineUserBean;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -797,6 +798,12 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
.compose(RxHelper.singleMainResult());
|
||||
}
|
||||
|
||||
public Single<List<RoomOnlineUserBean>> getRoomOnlineList(long roomUid) {
|
||||
return mRoomService.getRoomOnlineList(roomUid)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
public interface Api {
|
||||
|
||||
/**
|
||||
@@ -1217,6 +1224,12 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
@GET("/resource/gamePlay")
|
||||
Single<ServiceResult<List<RoomIcon>>> getRoomGamePlay(@Query("roomUid") long roomUid);
|
||||
|
||||
/**
|
||||
* 房间在线列表
|
||||
* @return
|
||||
*/
|
||||
@GET("/room/v2/online")
|
||||
Single<ServiceResult<List<RoomOnlineUserBean>>> getRoomOnlineList(@Query("roomUid") long roomUid);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ abstract class FrameLayoutRoomWidget : FrameLayout, RoomWidget {
|
||||
|
||||
protected val widgetScope = MainScope()
|
||||
protected var roomView: RoomView? = null
|
||||
protected var roomContext: RoomContext? = null
|
||||
|
||||
// 当前房间UID
|
||||
private var roomId: Long? = null
|
||||
@@ -78,7 +79,9 @@ abstract class FrameLayoutRoomWidget : FrameLayout, RoomWidget {
|
||||
/**
|
||||
* 绑定房间上下文:建立数据连接
|
||||
*/
|
||||
open fun onBindContext(roomContext: RoomContext) {}
|
||||
open fun onBindContext(roomContext: RoomContext) {
|
||||
this.roomContext = roomContext
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑上下文:重置View状态
|
||||
@@ -91,6 +94,7 @@ abstract class FrameLayoutRoomWidget : FrameLayout, RoomWidget {
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
this.roomContext = null
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user