Compare commits

...

28 Commits

Author SHA1 Message Date
max
e26d548515 version_code update 2024-07-29 10:24:14 +08:00
eggmanQQQ
539be23e47 feat:调整配置入口按钮间距 2024-07-26 16:56:52 +08:00
eggmanQQQ
dcafb35e24 feat:调整配置入口按钮显示逻辑 2024-07-26 15:35:02 +08:00
eggmanQQQ
8fa429aca6 feat:更新数据的获取逻辑,接入配置按钮的跳转行为 2024-07-26 11:31:15 +08:00
max
f08b6d4577 新增 model 2024-07-25 22:28:54 +08:00
max
3ea7aecd5c feat:處理底部按鈕顯示邏輯 2024-07-25 18:31:50 +08:00
eggmanQQQ
178f4e24ef 更换资源 2024-07-25 16:12:07 +08:00
max
e2861459fb feat:玩法列表支持最多 3 行並滾動 2024-07-25 15:14:08 +08:00
eggmanQQQ
d704a44106 feat:更新玩法按鈕以及顯示內容 2024-07-24 20:08:03 +08:00
max
da81a4e905 feat:更新房間底部 layout 2024-07-24 14:54:41 +08:00
max
6c081d9a38 fix:修正英語翻譯 2024-07-24 12:13:56 +08:00
max
37d897035f feat:固化混淆配置 2024-07-12 19:07:32 +08:00
max
cea25c7497 feat:调整重名类命名 2024-07-12 14:25:32 +08:00
max
47d2bfd145 feat:替换登录页-logo图片 2024-07-12 11:21:44 +08:00
max
047e1454bd feat:适配Android14 2024-07-12 09:55:16 +08:00
max
714d5baec6 fix:修复个播粉丝团RTL适配问题 2024-07-11 18:56:09 +08:00
max
b20ee8064c fix:修复房间音乐音量无法调节bug 2024-07-11 18:24:50 +08:00
max
711135ae90 feat:移除不必要的debug-toast 2024-07-11 17:21:32 +08:00
max
ecf42e368e feat:完成游戏开黑翻译
fix:UI问题修复
2024-07-11 16:06:05 +08:00
max
205e1180e7 feat:首页-房间列表 麦位头像改为动态数据 2024-07-11 15:41:02 +08:00
max
bc48cc86a9 fix:礼物名称 动态适配多语言 2024-07-11 11:24:18 +08:00
max
e7b73a2961 feat:完成游戏开黑功能 2024-07-10 19:57:20 +08:00
max
5070e21d16 feat:【开黑】完成部分UI 2024-07-10 19:57:19 +08:00
max
049006aa8b feat:补充异常信息展示 2024-07-10 19:56:04 +08:00
max
86b498c00e feat:删除测试代码,删除不必要的log
fix:完善销毁逻辑
2024-07-09 15:57:11 +08:00
max
6df95cf11f feat:适配BillingService2,完善支付回调 2024-07-09 15:57:10 +08:00
max
3b407c0bd6 feat:初步实现H5唤起支付逻辑(不完善,用于打内测包验证) 2024-07-09 15:57:10 +08:00
max
83af08076a fix:头条UI微调 2024-07-09 15:56:20 +08:00
150 changed files with 3193 additions and 326 deletions

View File

@@ -82,7 +82,8 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- 对于 Android 12.0 及以上设备,还需要添加如下权限: -->
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
<application
android:name=".application.App"
android:allowBackup="false"
@@ -876,17 +877,22 @@
<service
android:name="com.netease.nimlib.service.NimService"
android:foregroundServiceType="remoteMessaging"
android:process=":core" />
<service
android:name="com.netease.nimlib.service.NimService$Aux"
android:foregroundServiceType="remoteMessaging"
android:process=":core" />
<service
android:name="com.netease.nimlib.job.NIMJobService"
android:foregroundServiceType="remoteMessaging"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":core" />
<service android:name="com.netease.nimlib.service.ResponseService" />
<service android:name="com.netease.nimlib.service.ResponseService"
android:foregroundServiceType="remoteMessaging"/>
<service
android:name=".service.DaemonService"
android:foregroundServiceType="mediaPlayback"
android:enabled="true" />
<activity android:name=".avroom.room_album.RoomAlbumActivity" />
@@ -949,6 +955,8 @@
android:screenOrientation="portrait" />
<activity android:name=".ui.debug.DebugActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.game_team.record.GameTeamRecordActivity"
android:screenOrientation="portrait"/>
</application>
</manifest>

View File

@@ -84,7 +84,6 @@ import com.chwl.library.common.file.FileHelper;
import com.chwl.library.net.rxnet.RxNet;
import com.chwl.library.net.rxnet.converter.GsonConverterPlugins;
import com.chwl.library.utils.AppMetaDataUtil;
import com.chwl.library.utils.AppUtils;
import com.chwl.library.utils.DeviceUuidFactory;
import com.chwl.library.utils.ResUtil;
import com.chwl.library.utils.SingleToastUtil;
@@ -417,7 +416,7 @@ public class App extends BaseApp {
httpParams.put("netType", String.valueOf(SystemUtils.getNetworkType(context)));
httpParams.put("model", SystemUtils.getPhoneModel());
httpParams.put("appVersion", VersionUtil.getLocalName(context));
httpParams.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context)));
httpParams.put("appVersionCode", String.valueOf(VersionUtil.getVersionCode(context)));
httpParams.put("deviceId", DeviceUuidFactory.getDeviceId(context));
httpParams.put("androidId", MD5Utils.getMD5String(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID)));
httpParams.put("channel", AppMetaDataUtil.getChannelID());

View File

@@ -47,8 +47,7 @@ public abstract class BottomViewListenerWrapper {
}
public void onRoomGameplayClick(){
public void onRoomGameplayClick(boolean isOnlyPK){
}
}

View File

@@ -4,13 +4,13 @@ import android.annotation.SuppressLint
import android.os.Bundle
import android.view.WindowManager
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogRoomPkFinishBinding
import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.core.im.custom.bean.RoomPkBean
import com.chwl.core.utils.extension.subAndReplaceDot
class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
class RoomPkFinishDialog : BaseDialogFragment<DialogRoomPkFinishBinding>() {
companion object {
@JvmStatic

View File

@@ -4,13 +4,13 @@ import android.annotation.SuppressLint
import android.os.Bundle
import android.view.WindowManager
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogRoomPkForceFinishBinding
import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.core.im.custom.bean.RoomPkBean
import com.chwl.core.utils.extension.subAndReplaceDot
class RoomPkForceFinishDialog : BaseDialog<DialogRoomPkForceFinishBinding>() {
class RoomPkForceFinishDialog : BaseDialogFragment<DialogRoomPkForceFinishBinding>() {
companion object {
@JvmStatic

View File

@@ -4,7 +4,7 @@ import android.annotation.SuppressLint
import android.os.Bundle
import androidx.core.view.isVisible
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogRoomPkReceivedBinding
import com.chwl.core.im.custom.bean.RoomPkBean
import com.chwl.core.manager.AvRoomDataManager
@@ -16,7 +16,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit
class RoomPkReceivedDialog : BaseDialog<DialogRoomPkReceivedBinding>() {
class RoomPkReceivedDialog : BaseDialogFragment<DialogRoomPkReceivedBinding>() {
companion object {

View File

@@ -1,9 +1,9 @@
package com.chwl.app.avroom.anotherroompk
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogRoomPkRuleBinding
class RoomPkRuleDialog : BaseDialog<DialogRoomPkRuleBinding>() {
class RoomPkRuleDialog : BaseDialogFragment<DialogRoomPkRuleBinding>() {
companion object {

View File

@@ -6,7 +6,7 @@ import android.view.WindowManager
import androidx.recyclerview.widget.GridLayoutManager
import com.chwl.app.avroom.adapter.CreateRoomGameGuideAdapter
import com.chwl.app.base.BaseActivity
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogCreateGameRoomBinding
import com.chwl.app.home.helper.OpenRoomHelper
import com.chwl.app.ui.utils.RVDelegate
@@ -14,7 +14,7 @@ import com.chwl.core.room.bean.RoomInfo
import com.chwl.core.room.game.bean.GameInfo
import com.chwl.core.room.game.GameModel
class CreateGameRoomDialog : BaseDialog<DialogCreateGameRoomBinding>() {
class CreateGameRoomDialog : BaseDialogFragment<DialogCreateGameRoomBinding>() {
private lateinit var rvDelegate: RVDelegate<GameInfo>
private val gameAdapter = CreateRoomGameGuideAdapter()

View File

@@ -9,7 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.chwl.app.R
import com.chwl.app.avroom.adapter.CreateRoomGameAdapter
import com.chwl.app.base.BaseActivity
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogCreateRoomBinding
import com.chwl.app.home.helper.OpenRoomHelper
import com.chwl.app.ui.utils.RVDelegate
@@ -19,7 +19,7 @@ import com.chwl.core.room.game.GameModel
import com.chwl.core.utils.extension.toast
import com.chwl.library.utils.ResUtil
class CreateRoomDialog : BaseDialog<DialogCreateRoomBinding>() {
class CreateRoomDialog : BaseDialogFragment<DialogCreateRoomBinding>() {
private lateinit var rvDelegate: RVDelegate<GameInfo>
private val gameAdapter = CreateRoomGameAdapter()

View File

@@ -1,12 +1,12 @@
package com.chwl.app.avroom.dialog
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogNewUserGiftBinding
import com.chwl.app.ui.utils.load
import com.chwl.core.gift.bean.GiftInfo
class NewUserGiftDialog(val giftInfo: GiftInfo) :
BaseDialog<DialogNewUserGiftBinding>() {
BaseDialogFragment<DialogNewUserGiftBinding>() {
override fun init() {
binding?.ivClose?.setOnClickListener {

View File

@@ -11,6 +11,7 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.recyclerview.widget.RecyclerView
import com.chwl.app.R
import com.chwl.app.avroom.adapter.RoomGameListAdapter
import com.chwl.app.base.BaseActivity
@@ -38,7 +39,7 @@ class RoomGameListDialog :
private var compositeDisposable: CompositeDisposable? = null
private val adapter = RoomGameListAdapter()
private var dialogManager: DialogManager? = null
private lateinit var recycleView: RecyclerView
override fun getTheme(): Int {
return R.style.ErbanBottomSheetDialogDimFalse
}
@@ -61,6 +62,8 @@ class RoomGameListDialog :
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initView()
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
recycleView = recyclerView
switchStatus(0)
requestData()
}
@@ -89,6 +92,14 @@ class RoomGameListDialog :
binding?.recyclerView?.adapter = adapter
}
private fun updateDialogHeight(count: Int) {
if (count > 10) {
val layoutParams = recycleView.layoutParams
layoutParams.height = 600
recycleView.layoutParams = layoutParams
}
}
private fun requestData() {
val dataService =
AudioRoomContext.get()
@@ -96,6 +107,7 @@ class RoomGameListDialog :
val cacheKey = "game_list#${parentFragment.hashCode()}"
val list = dataService?.getData(cacheKey) as? List<GameInfo>
if (!list.isNullOrEmpty()) {
updateDialogHeight(list.size)
loadData(list)
return
}
@@ -106,6 +118,7 @@ class RoomGameListDialog :
}
.subscribe { it: List<GameInfo> ->
dataService?.putData(cacheKey, it)
updateDialogHeight(it.size)
loadData(it)
}
getCompositeDisposable().add(disposable)

View File

@@ -10,6 +10,8 @@ import androidx.core.view.isVisible
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chwl.app.R
import com.chwl.app.avroom.activity.CreatePKActivity
import com.chwl.app.avroom.adapter.RoomGameplayAdapter
@@ -39,8 +41,11 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.google.gson.Gson
import io.reactivex.disposables.CompositeDisposable
class RoomGameplayDialog :
BottomSheetDialogFragment() {
class RoomGameplayDialog : BottomSheetDialogFragment() {
var isOnlyPK = false
private lateinit var recycleView: RecyclerView
private var binding: RoomGameplayDialogBinding? = null
private var compositeDisposable: CompositeDisposable? = null
private val adapter = RoomGameplayAdapter()
@@ -69,6 +74,10 @@ class RoomGameplayDialog :
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initView()
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
recycleView = recyclerView
switchStatus(0)
requestData()
}
@@ -97,28 +106,46 @@ class RoomGameplayDialog :
}
private fun requestData() {
val dataService =
AudioRoomContext.get()
?.findAbility<RoomDataService>(RoomDataService::class.java.simpleName)
val cacheKey = "gameplay_list#${parentFragment.hashCode()}"
val list = dataService?.getData(cacheKey) as? List<RoomIcon>
if (!list.isNullOrEmpty()) {
loadSuccess(list)
return
if (isOnlyPK) {
loadSuccess(arrayListOf())
} else {
val dataService =
AudioRoomContext.get()
?.findAbility<RoomDataService>(RoomDataService::class.java.simpleName)
val cacheKey = "gameplay_list#${parentFragment.hashCode()}"
val list = dataService?.getData(cacheKey) as? List<RoomIcon>
if (!list.isNullOrEmpty()) {
updateDialogHeight(list.size)
loadSuccess(list)
return
}
val disposable = AvRoomModel.get().roomGamePlayList
.doOnError {
loadFail(it)
}
.subscribe { it: List<RoomIcon> ->
dataService?.putData(cacheKey, it)
updateDialogHeight(it.size)
loadSuccess(it)
}
getCompositeDisposable().add(disposable)
}
}
private fun updateDialogHeight(count: Int) {
if (count > 10) {
val layoutParams = recycleView.layoutParams
layoutParams.height = 600
recycleView.layoutParams = layoutParams
}
val disposable = AvRoomModel.get().roomGamePlayList
.doOnError {
loadFail(it)
}
.subscribe { it: List<RoomIcon> ->
dataService?.putData(cacheKey, it)
loadSuccess(it)
}
getCompositeDisposable().add(disposable)
}
private fun loadSuccess(list: List<RoomIcon>?) {
val finalList = getLocalList()
var finalList = mutableListOf<RoomGameplayItem>()
if (isOnlyPK) {
finalList = getLocalList()
}
list?.let {
finalList.addAll(list.map {
RoomGameplayItem.RoomIconItem(it) { dialog, item ->

View File

@@ -5,7 +5,7 @@ import android.view.WindowManager
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.RoomTeamPkDialogBinding
import com.chwl.app.ui.utils.loadAvatar
import com.chwl.app.ui.widget.dialog.CommonTipDialog
@@ -28,7 +28,7 @@ import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
import java.util.Locale
class RoomTeamPkDialog : BaseDialog<RoomTeamPkDialogBinding>() {
class RoomTeamPkDialog : BaseDialogFragment<RoomTeamPkDialogBinding>() {
private var compositeDisposable: CompositeDisposable? = null

View File

@@ -9,7 +9,7 @@ import android.view.WindowManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.chwl.app.avroom.adapter.SendBroadcastAdapter
import com.chwl.app.base.BaseActivity
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogSendBroadcastBinding
import com.chwl.app.ui.utils.RVDelegate
import com.chwl.app.utils.SpannableBuilder
@@ -24,7 +24,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit
class SendBroadcastDialog : BaseDialog<DialogSendBroadcastBinding>() {
class SendBroadcastDialog : BaseDialogFragment<DialogSendBroadcastBinding>() {
private lateinit var rvDelegate: RVDelegate<String>
private lateinit var adapter: SendBroadcastAdapter

View File

@@ -2,11 +2,11 @@ package com.chwl.app.avroom.dialog
import android.annotation.SuppressLint
import android.view.WindowManager
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogSingleRoomTipBinding
class SingleRoomTipDialog :
BaseDialog<DialogSingleRoomTipBinding>() {
BaseDialogFragment<DialogSingleRoomTipBinding>() {
@SuppressLint("ClickableViewAccessibility")
override fun init() {
binding?.root?.setOnClickListener {

View File

@@ -63,6 +63,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.CommonWebViewActivity
import com.chwl.app.ui.webview.DialogWebViewActivity
import com.chwl.app.ui.widget.ButtonItem
import com.chwl.app.ui.widget.GiftDialog
@@ -98,6 +99,8 @@ import com.chwl.core.manager.RoomEvent
import com.chwl.core.mentoring_relationship.event.MentoringStopCountingEvent
import com.chwl.core.room.anotherroompk.ShowGiftDialogEvent
import com.chwl.core.room.anotherroompk.ShowUserInfoDialogEvent
import com.chwl.core.room.bean.RightBottomIconConfig
import com.chwl.core.room.bean.RoomIcon
import com.chwl.core.room.bean.RoomInfo
import com.chwl.core.room.event.RoomAtEvent
import com.chwl.core.room.event.RoomClearScreenEvent
@@ -122,6 +125,7 @@ import com.chwl.library.common.util.LimitClickUtils
import com.chwl.library.net.rxnet.utils.RxNetWorkUtils
import com.chwl.library.rxbus.RxBus
import com.chwl.library.utils.*
import com.google.gson.Gson
import com.netease.nim.uikit.common.antispam.AntiSpamEvent
import com.netease.nimlib.sdk.StatusCode
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder
@@ -665,6 +669,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
bottomView.showHomePartyDownMicBottom()
}
bottomView.showInputOrIcon(isOnMic)
bottomView.updateGameEntrance()
// 更新聽筒消息
bottomView.setRemoteMuteOpen(!AudioEngineManager.get().isRemoteMute)
if (isOnMic) {
@@ -792,8 +797,24 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
override fun onClick(v: View) {
if (mClickLimit.checkForTime(500)) return
when (v.id) {
R.id.iv_config_entrance -> {
val roomInfo = AvRoomDataManager.get().mCurrentRoomInfo ?: return
val configInfo = AvRoomDataManager.get().rightBottomIconConfig ?: return
if (configInfo.skipType == 1) {
playConfigWeb(configInfo.skipUrl)
} else if (configInfo.skipType == 2) {
playConfigBaishunGame(configInfo)
}
}
R.id.iv_game -> {
RoomGameListDialog().show(childFragmentManager, "GAME_LIST")
val dialog = RoomGameplayDialog()
dialog.isOnlyPK = false
dialog.listener = object : RoomGameplayDialog.GameplayDialogListener {
override fun onShowBaiShunGame(url: String, config: BaiShunGameConfig) {
(activity as? AVRoomActivity)?.showBaiShunGame(url, config)
}
}
dialog.show(childFragmentManager, "ROOM_GAME_PLAY")
}
R.id.input_send -> {
sendMsg()
@@ -807,6 +828,38 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
}
}
private fun playConfigWeb(url: String) {
CommonWebViewActivity.start(mContext, url)
}
private fun playConfigBaishunGame(configInfo: RightBottomIconConfig) {
val roomIcon: RoomIcon = RoomIcon(
skipContent = configInfo.skipUrl,
skipType = 3,
showType = 1,
code = "BAISHUN",
ruleValue = configInfo.reserve)
try {
val url = roomIcon.skipContent
val ruleValue = Gson().fromJson<RoomIcon.RuleValueBean>(
roomIcon.ruleValue,
RoomIcon.RuleValueBean::class.java
)
val config = Gson().fromJson<BaiShunGameConfig>(
ruleValue.RESERVE,
BaiShunGameConfig::class.java
)
if (config != null && url != null) {
config.reloadDynamicParams()
(activity as? AVRoomActivity)?.showBaiShunGame(url, config)
} else {
SingleToastUtil.showToast(R.string.manager_trtc_trtcengineadapter_042)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
private fun sendMsg() {
val message = inputEdit.text.toString().trim()
if (isPublicMessageTab()) {
@@ -1434,14 +1487,19 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
RoomMsgActivity.start(mContext)
}
override fun onRoomGameplayClick() {
val dialog = RoomGameplayDialog()
dialog.listener = object : RoomGameplayDialog.GameplayDialogListener {
override fun onShowBaiShunGame(url: String, config: BaiShunGameConfig) {
(activity as? AVRoomActivity)?.showBaiShunGame(url, config)
override fun onRoomGameplayClick(isOnlyPK: Boolean) {
if (isOnlyPK) {
val dialog = RoomGameplayDialog()
dialog.isOnlyPK = isOnlyPK
dialog.listener = object : RoomGameplayDialog.GameplayDialogListener {
override fun onShowBaiShunGame(url: String, config: BaiShunGameConfig) {
(activity as? AVRoomActivity)?.showBaiShunGame(url, config)
}
}
dialog.show(childFragmentManager, "ROOM_GAME_PLAY")
} else {
RoomGameListDialog().show(childFragmentManager, "GAME_LIST")
}
dialog.show(childFragmentManager, "ROOM_GAME_PLAY")
}
}

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
@@ -14,8 +15,13 @@ import com.chwl.app.avroom.headline.RoomHeadlineWidget;
import com.chwl.app.avroom.online.RoomOnlineWidget;
import com.chwl.app.avroom.rank.RoomRankNumberWidget;
import com.chwl.app.music.widget.MusicPlayerView;
import com.chwl.app.ui.utils.ImageLoadUtils;
import com.chwl.app.ui.webview.DialogWebViewActivity;
import com.chwl.core.room.bean.RightBottomIconConfig;
import com.chwl.core.room.bean.RoomIcon;
import com.chwl.core.room.core.RoomDataService;
import com.chwl.core.room.pk.event.PKDataUpdateEvent;
import com.chwl.core.support.room.AudioRoomContext;
import com.netease.nim.uikit.common.util.log.LogUtil;
import com.trello.rxlifecycle3.android.FragmentEvent;
import com.chwl.app.R;
@@ -79,6 +85,7 @@ import io.reactivex.Single;
import io.reactivex.SingleObserver;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
/**
* 轰趴房间
@@ -101,6 +108,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
private PKMicQueueDialog pkMicQueueDialog;
private Disposable roomPkOrderDisposable;
private boolean hasBaishunGames;
public static HomePartyRoomFragment newInstance() {
HomePartyRoomFragment roomFragment = new HomePartyRoomFragment();
Bundle bundle = new Bundle();
@@ -149,6 +158,28 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
updateQueuingMicBtn();
updatePkScoreBoard();
initRoomPkOrder(AvRoomDataManager.get().showPkBeginTime, AvRoomDataManager.get().pkBeginTime);
requestData();
}
private void requestData() {
RoomDataService dataService = (RoomDataService) AudioRoomContext.Companion.get().findAbility(RoomDataService.class.getSimpleName());
String cacheKey = "gameplay_list#" + hashCode();
Disposable disposable = AvRoomModel.get().getRoomGamePlayList().doOnError(new Consumer<Throwable>() {
@Override
public void accept(Throwable throwable) throws Exception {
hasBaishunGames = false;
updateConfigButtonArea();
}
}).subscribe(new Consumer<List<RoomIcon>>() {
@Override
public void accept(List<RoomIcon> roomIcons) throws Exception {
if (dataService != null) {
dataService.putData(cacheKey, roomIcons);
}
hasBaishunGames = roomIcons.size() > 0;
updateConfigButtonArea();
}
});
}
@Override
@@ -197,6 +228,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
gameBinding.setRoomInfo(AvRoomDataManager.get().mCurrentRoomInfo);
updateQueuingMicBtn();
updatePkScoreBoard();
updateConfigButtonArea();
getMvpPresenter().updateLeaveMode();
break;
case RoomEvent.ENTER_ROOM:
@@ -470,11 +502,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
updateMicroView();
changeModelShowView();
refreshDatingNextStatus();
if (AvRoomDataManager.get().isDatingMode()) {
gameBinding.ivGame.setVisibility(View.GONE);
} else {
gameBinding.ivGame.setVisibility(View.VISIBLE);
}
// updateConfigButtonArea();
}
protected void updateMicroView(){
@@ -502,6 +530,34 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
refreshDatingNextStatus();
}
public void updateConfigButtonArea() {
RightBottomIconConfig configModel = AvRoomDataManager.get().rightBottomIconConfig;
if (configModel == null) {
gameBinding.ivConfigEntrance.setVisibility(View.GONE);
} else {
if (configModel.getIcon1Url() == null) {
gameBinding.ivConfigEntrance.setVisibility(View.GONE);
} else {
ImageLoadUtils.loadAvatar(configModel.getIcon1Url(), gameBinding.ivConfigEntrance);
gameBinding.ivConfigEntrance.setVisibility(View.VISIBLE);
}
if (configModel.getIcon2Url() != null) {
ImageLoadUtils.loadAvatar(configModel.getIcon2Url(), gameBinding.ivGame);
}
}
if (AvRoomDataManager.get().isDatingMode()) {
gameBinding.ivGame.setVisibility(View.GONE);
} else {
if (hasBaishunGames) {
gameBinding.ivGame.setVisibility(View.VISIBLE);
}else {
gameBinding.ivGame.setVisibility(View.GONE);
}
}
}
private void updateQueuingMicBtn() {
if (AvRoomDataManager.get().mCurrentRoomInfo != null) {
bottomView.updateQueuingMicButton();
@@ -564,7 +620,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
super.onDestroy();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onDatingSelectUserEvent(DatingSelectUserEvent event) {
if (getMvpPresenter() != null) {

View File

@@ -3,13 +3,13 @@ package com.chwl.app.avroom.room_album
import android.annotation.SuppressLint
import android.os.Bundle
import com.hjq.toast.ToastUtils
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogLockRoomAlbumPhotoBinding
import com.chwl.app.ui.utils.ImageLoadUtilsV2
import com.chwl.core.gift.bean.GiftReceiveInfo
import com.chwl.core.manager.AvRoomDataManager
class UnlockRoomAlbumPhotoDialog : BaseDialog<DialogLockRoomAlbumPhotoBinding>(){
class UnlockRoomAlbumPhotoDialog : BaseDialogFragment<DialogLockRoomAlbumPhotoBinding>(){
var onUnlockRoomPhotoListener: OnUnlockRoomPhotoListener? = null

View File

@@ -5,7 +5,7 @@ import android.os.Bundle
import android.view.WindowManager
import androidx.core.view.isVisible
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogSingleRoomPkFinishBinding
import com.chwl.app.ui.utils.load
import com.chwl.core.im.custom.bean.RoomPkBean
@@ -14,7 +14,7 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import java.util.concurrent.TimeUnit
class SingleRoomPkFinishDialog : BaseDialog<DialogSingleRoomPkFinishBinding>() {
class SingleRoomPkFinishDialog : BaseDialogFragment<DialogSingleRoomPkFinishBinding>() {
companion object {
@JvmStatic

View File

@@ -4,13 +4,13 @@ import android.annotation.SuppressLint
import android.os.Bundle
import android.view.WindowManager
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogSingleRoomPkForceFinishBinding
import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.core.im.custom.bean.RoomPkBean
import com.chwl.core.utils.extension.subAndReplaceDot
class SingleRoomPkForceFinishDialog : BaseDialog<DialogSingleRoomPkForceFinishBinding>() {
class SingleRoomPkForceFinishDialog : BaseDialogFragment<DialogSingleRoomPkForceFinishBinding>() {
companion object {
@JvmStatic

View File

@@ -4,7 +4,7 @@ import android.annotation.SuppressLint
import android.os.Bundle
import androidx.core.view.isVisible
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogSingleRoomPkReceivedBinding
import com.chwl.core.im.custom.bean.RoomPkBean
import com.chwl.core.manager.AvRoomDataManager
@@ -17,7 +17,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit
class SingleRoomPkReceivedDialog : BaseDialog<DialogSingleRoomPkReceivedBinding>() {
class SingleRoomPkReceivedDialog : BaseDialogFragment<DialogSingleRoomPkReceivedBinding>() {
companion object {

View File

@@ -1,12 +1,12 @@
package com.chwl.app.avroom.singleroompk
import android.text.method.ScrollingMovementMethod
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogSingleRoomPkRuleBinding
import com.chwl.core.room.anotherroompk.SingleRoomPKModel
import com.chwl.core.utils.extension.toast
class SingleRoomPkRuleDialog : BaseDialog<DialogSingleRoomPkRuleBinding>() {
class SingleRoomPkRuleDialog : BaseDialogFragment<DialogSingleRoomPkRuleBinding>() {
companion object {

View File

@@ -16,12 +16,11 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
import com.chwl.core.manager.AvRoomDataManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.chwl.app.avroom.activity.RoomTypeSwitchActivity;
import com.chwl.app.avroom.dialog.RoomGameplayDialog;
import com.chwl.core.utils.extension.StringExtensionKt;
import com.netease.nim.uikit.api.NimUIKit;
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
@@ -30,7 +29,6 @@ import com.netease.nimlib.sdk.uinfo.model.UserInfo;
import com.chwl.app.R;
import com.chwl.app.avroom.BottomViewListenerWrapper;
import com.chwl.app.ui.utils.ImageLoadUtils;
import com.chwl.app.vip.VipMainActivity;
import com.chwl.app.room_chat.activity.RoomMsgActivity;
import com.chwl.core.helper.ImHelperUtils;
import com.chwl.core.manager.AvRoomDataManager;
@@ -75,6 +73,10 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
private ImageView iconMicQueue;
private ImageView iconRoomMsg;
private ImageView iconRoomBaiShunGame;
private ImageView pkGameView;
@Nullable
private PopupWindow msgTipPopupWindow;
@NonNull
@@ -106,11 +108,12 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
remoteMute = findViewById(R.id.icon_room_open_remote_mic);
faceLayout = findViewById(R.id.room_face_layout);
micLayout = findViewById(R.id.room_mic_layout);
iconRoomBaiShunGame = findViewById(R.id.icon_room_baishun_game);
iconMicQueue = (ImageView) findViewById(R.id.icon_mic_queue);
iconRoomMsg = findViewById(R.id.iv_room_message);
ImageView gameView = findViewById(R.id.icon_room_game);
pkGameView = findViewById(R.id.icon_room_PK_game);
openMic.setOnClickListener(this);
sendMsgInput.setOnClickListener(this);
sendFace.setOnClickListener(this);
@@ -119,7 +122,8 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
sendMagic.setOnClickListener(this);
iconMicQueue.setOnClickListener(this);
iconRoomMsg.setOnClickListener(this);
gameView.setOnClickListener(this);
pkGameView.setOnClickListener(this);
iconRoomBaiShunGame.setOnClickListener(this);
setMicBtnEnable(false);
setMicBtnOpen(false);
@@ -243,6 +247,10 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
}
}
public void setBaiShunBtnOpen(boolean isOpen) {
iconRoomBaiShunGame.setVisibility(isOpen ? VISIBLE : GONE);
}
public void notifyStateChanged() {
setMagicBtnEnable(true);
}
@@ -252,6 +260,18 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
micLayout.setVisibility(VISIBLE);
}
public void updateGameEntrance() {
if (AvRoomDataManager.get().isManager() || SuperAdminUtil.isSuperAdmin()) {
if (!AvRoomDataManager.get().isCpRoom()) {
pkGameView.setVisibility(VISIBLE);
iconRoomBaiShunGame.setVisibility(VISIBLE);
}
} else {
pkGameView.setVisibility(GONE);
iconRoomBaiShunGame.setVisibility(GONE);
}
}
public void showHomePartyDownMicBottom() {
faceLayout.setVisibility(GONE);
micLayout.setVisibility(GONE);
@@ -351,9 +371,14 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
wrapper.onRoomMessageClick();
}
break;
case R.id.icon_room_game:
case R.id.icon_room_PK_game:
if (wrapper != null) {
wrapper.onRoomGameplayClick();
wrapper.onRoomGameplayClick(true);
}
break;
case R.id.icon_room_baishun_game:
if (wrapper != null) {
wrapper.onRoomGameplayClick(false);
}
break;
default:

View File

@@ -2286,7 +2286,7 @@ public class MessageView extends FrameLayout {
})
.append(ResUtil.getString(R.string.gift_message_01), new ForegroundColorSpan(getResources().getColor(R.color.white)));
text.append(luckyGiftInfo.getGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
text.append(luckyGiftInfo.getFirstGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
.append(luckyGiftInfo.getUser().getNick(), new ForegroundColorSpan(roomTipNickColor), new OriginalDrawStatusClickSpan() {
@Override
public void onClick(@NonNull View widget) {
@@ -2341,7 +2341,7 @@ public class MessageView extends FrameLayout {
})
.append(ResUtil.getString(R.string.gift_message_01), new ForegroundColorSpan(getResources().getColor(R.color.white)));
text.append(luckyGiftInfo.getGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
text.append(luckyGiftInfo.getFirstGiftName() + ResUtil.getString(R.string.gift_message_02), new ForegroundColorSpan(getResources().getColor(R.color.white)))
.append(luckyGiftInfo.getUser().getNick(), new ForegroundColorSpan(roomTipNickColor), new OriginalDrawStatusClickSpan() {
@Override
public void onClick(@NonNull View widget) {

View File

@@ -17,7 +17,7 @@ import com.trello.rxlifecycle3.components.support.RxDialogFragment
import kotlinx.coroutines.launch
import java.lang.reflect.ParameterizedType
abstract class BaseDialog<T : ViewBinding> : RxDialogFragment() {
abstract class BaseDialogFragment<T : ViewBinding> : RxDialogFragment() {
val isViewLoaded: Boolean get() = _binding != null
protected var _binding: T? = null

View File

@@ -1,9 +1,13 @@
package com.chwl.app.home.adapter
import android.graphics.Rect
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.RecycledViewPool
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
@@ -11,14 +15,54 @@ import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.app.ui.utils.load
import com.chwl.app.ui.utils.loadFromAssets
import com.chwl.core.home.bean.HomeRoomInfo
import com.example.lib_utils.AppUtils
import com.example.lib_utils.UiUtils
import com.opensource.svgaplayer.SVGADrawable
import com.opensource.svgaplayer.SVGAImageView
/**
* create by lvzebiao @2019/11/13
*/
class HomeRoomAdapter :
BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.home_item_room) {
class HomeRoomAdapter : BaseQuickAdapter<HomeRoomInfo, BaseViewHolder>(R.layout.home_item_room) {
private var micUserItemViewPool = RecycledViewPool().apply {
setMaxRecycledViews(0, 50)
}
private val isRTL = UiUtils.isRtl(AppUtils.getApp())
override fun onCreateDefViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
return super.onCreateDefViewHolder(parent, viewType).apply {
val micUserRecyclerView = this.getView<RecyclerView>(R.id.recycler_view_users)
micUserRecyclerView.setOnTouchListener { v, event -> true }
micUserRecyclerView.setRecycledViewPool(micUserItemViewPool)
micUserRecyclerView.setHasFixedSize(true)
micUserRecyclerView.layoutManager =
LinearLayoutManager(parent.context, RecyclerView.HORIZONTAL, false).apply {
this.recycleChildrenOnDetach = true
this.isSmoothScrollbarEnabled
}
micUserRecyclerView.addItemDecoration(object : RecyclerView.ItemDecoration() {
val offset = AppUtils.getApp().resources.getDimensionPixelOffset(R.dimen.dp_4) * -1
override fun getItemOffsets(
outRect: Rect,
view: View,
parent: RecyclerView,
state: RecyclerView.State
) {
super.getItemOffsets(outRect, view, parent, state)
val position = parent.getChildAdapterPosition(view)
if (position != 0) {
if (isRTL) {
outRect.right = offset
} else {
outRect.left = offset
}
}
}
})
micUserRecyclerView.adapter = HomeRoomUserAdapter()
}
}
override fun convert(helper: BaseViewHolder, item: HomeRoomInfo) {
helper.apply {
@@ -28,18 +72,10 @@ class HomeRoomAdapter :
setText(R.id.tv_desc, item.roomDesc)
}
val avatars: Array<ImageView> = arrayOf(
helper.getView(R.id.iv_avatar_0),
helper.getView(R.id.iv_avatar_1),
helper.getView(R.id.iv_avatar_2),
helper.getView(R.id.iv_avatar_3),
helper.getView(R.id.iv_avatar_4)
)
for (i in avatars.indices) {
val avatarUrl = item.micUsers?.getOrNull(i)?.avatar
avatars[i].isInvisible = avatarUrl.isNullOrBlank()
avatars[i].load(avatarUrl)
}
val micUserRecyclerView = helper.getView<RecyclerView>(R.id.recycler_view_users)
val userAdapter = micUserRecyclerView.adapter as HomeRoomUserAdapter
userAdapter.setNewData(item.micUsers)
val topView = helper.getView<ImageView>(R.id.iv_top)
if (item.isHourTop1 == 1) {
topView.setImageResource(R.drawable.home_room_bg_hour_top)

View File

@@ -0,0 +1,16 @@
package com.chwl.app.home.adapter
import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
import com.chwl.app.ui.utils.loadAvatar
import com.chwl.core.home.bean.MicUsersBean
class HomeRoomUserAdapter :
BaseQuickAdapter<MicUsersBean, BaseViewHolder>(R.layout.home_item_room_user) {
override fun convert(helper: BaseViewHolder, item: MicUsersBean?) {
val avatarView = helper.getView<ImageView>(R.id.iv_avatar)
avatarView.loadAvatar(item?.avatar)
}
}

View File

@@ -7,14 +7,14 @@ import android.view.WindowManager
import android.widget.ImageView
import androidx.core.view.isGone
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogHelloMessageBinding
import com.chwl.app.ui.utils.load
import com.chwl.app.room_chat.activity.RoomMsgActivity
import com.chwl.core.channel_page.bean.HelloMessageInfo
import com.chwl.library.utils.ResUtil
class HelloMessageDialog : BaseDialog<DialogHelloMessageBinding>() {
class HelloMessageDialog : BaseDialogFragment<DialogHelloMessageBinding>() {
companion object {

View File

@@ -4,13 +4,13 @@ import android.annotation.SuppressLint
import android.os.Bundle
import android.view.WindowManager
import com.chwl.app.avroom.activity.AVRoomActivity
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogNewUserHelloBinding
import com.chwl.app.ui.utils.load
import com.chwl.core.channel_page.bean.NewUserHelloInfo
import com.chwl.core.utils.extension.subAndReplaceDot
class NewUserHelloDialog : BaseDialog<DialogNewUserHelloBinding>() {
class NewUserHelloDialog : BaseDialogFragment<DialogNewUserHelloBinding>() {
companion object {

View File

@@ -3,12 +3,12 @@ package com.chwl.app.home.dialog
import android.annotation.SuppressLint
import android.os.Bundle
import com.chwl.app.avroom.activity.AVRoomActivity
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogRecommendRoomBinding
import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.core.home.bean.HomeRoomInfo
class RecommendRoomDialog : BaseDialog<DialogRecommendRoomBinding>() {
class RecommendRoomDialog : BaseDialogFragment<DialogRecommendRoomBinding>() {
companion object {

View File

@@ -139,7 +139,7 @@ class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>
}
override fun onScroll(
e1: MotionEvent,
e1: MotionEvent?,
e2: MotionEvent,
distanceX: Float,
distanceY: Float
@@ -151,7 +151,7 @@ class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>
}
override fun onFling(
e1: MotionEvent,
e1: MotionEvent?,
e2: MotionEvent,
velocityX: Float,
velocityY: Float

View File

@@ -198,7 +198,7 @@ class HomeRecommendFragment : BaseViewBindingFragment<FragmentHomeRecommendBindi
override fun createFragment(position: Int): Fragment {
val itemId = getItemId(position)
return HomeTabRoomFragment.newInstance(itemId.toInt()).apply {
autoRefreshOnVisible = true
this.autoRefreshOnVisible = true
}
}

View File

@@ -1,7 +1,6 @@
package com.chwl.app.home.fragment
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.fragment.app.viewModels
import androidx.recyclerview.widget.LinearLayoutManager

View File

@@ -0,0 +1,202 @@
package com.chwl.app.ui.game_team.invite
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import androidx.fragment.app.viewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import com.chwl.app.R
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.common.widget.dialog.DialogManager
import com.chwl.app.databinding.GameTeamInviteDialogBinding
import com.chwl.app.ui.pay.ChargeActivity
import com.chwl.app.ui.utils.load
import com.chwl.core.game_team.UserGameTeamInfo
import com.chwl.core.pay.PayModel
import com.chwl.core.pay.bean.WalletInfo
import com.chwl.core.utils.net.BalanceNotEnoughExeption
import com.chwl.library.utils.ResUtil
import com.chwl.library.utils.SingleToastUtil
import com.example.lib_utils.ktx.singleClick
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
import java.math.BigDecimal
import java.math.RoundingMode
class GameTeamInviteDialog : BaseDialogFragment<GameTeamInviteDialogBinding>() {
private val viewModel: GameTeamInviteViewModel by viewModels()
override var width = WindowManager.LayoutParams.MATCH_PARENT
override var gravity = Gravity.CENTER
private var gameId: Long = 0
private var gameUid: Long = 0
private var gameBackground: String? = null
private var gamePrice: Long = 0
private var gameInning: Long = 1
private var dialogManager: DialogManager? = null
var successListener: (() -> Unit)? = null
companion object {
fun newInstance(info: UserGameTeamInfo): GameTeamInviteDialog {
return newInstance(info.uid ?: 0, info.gameId ?: 0, info.pic, info.price ?: 0, 1)
}
fun newInstance(
targetUid: Long,
gameId: Long,
gameBackground: String?,
gamePrice: Long,
gameInning: Long,
): GameTeamInviteDialog {
return GameTeamInviteDialog().apply {
arguments = Bundle().apply {
putLong("targetUid", targetUid)
putLong("gameId", gameId)
putSerializable("gameBackground", gameBackground)
putLong("gamePrice", gamePrice)
putLong("gameInning", gameInning)
}
}
}
}
override fun init() {
gameUid = arguments?.getLong("targetUid") ?: 0
gameId = arguments?.getLong("gameId") ?: 0
gameBackground = arguments?.getString("gameBackground")
gamePrice = arguments?.getLong("gamePrice") ?: 0
gameInning = arguments?.getLong("gameInning") ?: 1
dialogManager = DialogManager(requireContext())
initView()
initEvent()
initObserve()
}
override fun onResume() {
super.onResume()
updateBalance()
}
private fun initView() {
binding.ivGameImage.load(gameBackground)
updateInning(0)
requestBalance()
}
private fun initEvent() {
binding.ivClose.setOnClickListener {
safeDismiss()
}
binding.tvPay.singleClick {
pay()
}
binding.layoutRecharge.setOnClickListener {
ChargeActivity.start(context)
}
binding.ivCountAdd.setOnClickListener {
updateInning(1)
}
binding.ivCountSubtract.setOnClickListener {
updateInning(-1)
}
}
private fun initObserve() {
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
viewModel.payResultFlow.collectLatest {
dialogManager?.dismissDialog()
if (it.isSuccess) {
successListener?.invoke()
SingleToastUtil.showToast(R.string.game_team_19)
safeDismiss()
} else if (it.code == BalanceNotEnoughExeption.code) {
showBalanceNotEnoughDialog()
} else {
it.message?.let { msg ->
SingleToastUtil.showToast(msg)
}
}
}
}
}
}
private fun showBalanceNotEnoughDialog() {
dialogManager?.showOkCancelDialog(
ResUtil.getString(R.string.widget_dialog_dialoguihelper_04),
ResUtil.getString(R.string.treasure_to_charge)
) {
ChargeActivity.start(context)
}
}
private fun pay() {
dialogManager?.showProgressDialog(requireContext())
viewModel.pay(gameId, gameUid, gameInning)
}
private fun updateInning(add: Int) {
var newInning = gameInning + add
if (newInning <= 0) {
newInning = 1
}
gameInning = newInning
if (gameInning <= 1L) {
binding.ivCountSubtract.setImageResource(R.drawable.game_team_invite_ic_subtract_disabled)
binding.ivCountSubtract.isEnabled = false
} else {
binding.ivCountSubtract.setImageResource(R.drawable.game_team_invite_ic_subtract)
binding.ivCountSubtract.isEnabled = true
}
binding.tvCount.text = gameInning.toString()
updateMoney()
}
private fun updateMoney() {
val total = gamePrice * gameInning
binding.tvMoney.text = total.toString()
}
@SuppressLint("SetTextI18n")
private fun updateBalance() {
if (_binding == null) {
return
}
val balanceTitle = getString(R.string.gift_wallet_overage)
val balanceValue = PayModel.get().currentWalletInfo?.diamondNum ?: 0.0
var balanceBigDecimal = BigDecimal.valueOf(balanceValue)
balanceBigDecimal = balanceBigDecimal.setScale(0, RoundingMode.DOWN)
binding.tvBalance.text = "$balanceTitle${balanceBigDecimal.toPlainString()}"
}
@SuppressLint("CheckResult")
private fun requestBalance() {
PayModel.get().myRemoteWalletInfo.compose<WalletInfo>(bindToLifecycle())
.subscribe { info: WalletInfo ->
updateBalance()
}
}
override fun onDestroyView() {
super.onDestroyView()
dialogManager?.dismissDialog()
dialogManager = null
}
override fun onDestroy() {
super.onDestroy()
successListener = null
}
}

View File

@@ -0,0 +1,22 @@
package com.chwl.app.ui.game_team.invite
import com.chwl.app.base.BaseViewModel
import com.chwl.core.auth.AuthModel
import com.chwl.core.bean.response.BeanResult
import com.chwl.core.room.game.GameModel
import kotlinx.coroutines.flow.MutableSharedFlow
class GameTeamInviteViewModel : BaseViewModel() {
var payResultFlow = MutableSharedFlow<BeanResult<Any>>()
fun pay(gameId: Long, gameUid: Long, inning: Long) {
safeLaunch(onError = {
payResultFlow.emit(BeanResult.failed(it))
}) {
val result =
GameModel.startGameTeam(gameId, gameUid, inning, AuthModel.get().currentUid)
payResultFlow.emit(BeanResult.success(result))
}
}
}

View File

@@ -0,0 +1,63 @@
package com.chwl.app.ui.game_team.record
import android.content.Context
import android.content.Intent
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.chwl.app.R
import com.chwl.app.avroom.adapter.CommonVPAdapter
import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.databinding.GameTeamRecordActivityBinding
import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
import com.chwl.library.utils.ResUtil
import com.netease.nim.uikit.StatusBarUtil
class GameTeamRecordActivity : BaseViewBindingActivity<GameTeamRecordActivityBinding>() {
companion object {
fun start(context: Context) {
context.startActivity(Intent(context, GameTeamRecordActivity::class.java))
}
}
override fun init() {
initWhiteTitleBar(ResUtil.getString(R.string.game_team_09))
initTab()
}
private fun initTab() {
val fragmentList = ArrayList<Fragment>()
fragmentList.add(GameTeamRecordFragment.newInstance(GameTeamRecordFragment.TYPE_INITIATOR))
fragmentList.add(GameTeamRecordFragment.newInstance(GameTeamRecordFragment.TYPE_RECEIVER))
val titleList = ArrayList<String>()
titleList.add(getString(R.string.game_team_10))
titleList.add(getString(R.string.game_team_11))
val commonNavigator = CommonNavigator(context)
commonNavigator.setTitleWrapContent(false)
val magicIndicatorAdapter = GameTeamRecordIndicatorAdapter(context, titleList)
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
binding.viewPager.currentItem = position
}
commonNavigator.adapter = magicIndicatorAdapter
binding.magicIndicator.navigator = commonNavigator
binding.viewPager.offscreenPageLimit = 2
binding.viewPager.adapter = CommonVPAdapter(
supportFragmentManager,
lifecycle,
fragmentList
)
binding.viewPager.isUserInputEnabled = false
ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager)
}
override fun needSteepStateBar(): Boolean {
return true
}
override fun setStatusBar() {
super.setStatusBar()
StatusBarUtil.transparencyBar(this)
StatusBarUtil.StatusBarLightMode(this)
}
}

View File

@@ -0,0 +1,38 @@
package com.chwl.app.ui.game_team.record
import android.view.View
import android.widget.ImageView
import androidx.core.view.isVisible
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
import com.chwl.app.ui.utils.load
import com.chwl.app.ui.utils.loadAvatar
import com.chwl.core.game_team.GameTeamRecordBean
class GameTeamRecordAdapter :
BaseQuickAdapter<GameTeamRecordBean, BaseViewHolder>(R.layout.game_team_record_item) {
var isInitiator = false
override fun convert(helper: BaseViewHolder, item: GameTeamRecordBean?) {
helper.addOnClickListener(R.id.tv_repurchase, R.id.tv_chat, R.id.iv_order_id_copy)
val userAvatarView = helper.getView<ImageView>(R.id.iv_user_avatar)
val repurchaseView = helper.getView<View>(R.id.tv_repurchase)
if (isInitiator) {
repurchaseView.isVisible = true
helper.setText(R.id.tv_user_name, item?.toNick ?: "")
helper.setText(R.id.tv_user_id, item?.toErBanNo?.toString() ?: "")
userAvatarView.load(item?.toAvatar)
} else {
repurchaseView.isVisible = false
helper.setText(R.id.tv_user_name, item?.fromNick ?: "")
helper.setText(R.id.tv_user_id, item?.fromErBanNo?.toString() ?: "")
userAvatarView.load(item?.fromAvatar)
}
helper.setText(R.id.tv_game_name, item?.gameName ?: "")
helper.setText(R.id.tv_order_money, item?.amount?.toString())
helper.setText(R.id.tv_order_time, item?.orderTime)
helper.setText(R.id.tv_order_id, item?.orderNo)
}
}

View File

@@ -0,0 +1,154 @@
package com.chwl.app.ui.game_team.record
import android.os.Bundle
import androidx.fragment.app.viewModels
import androidx.recyclerview.widget.LinearLayoutManager
import com.chwl.app.R
import com.chwl.app.base.BaseViewBindingFragment
import com.chwl.app.common.EmptyViewHelper
import com.chwl.app.databinding.GameTemaRecordFragmentBinding
import com.chwl.app.ui.game_team.invite.GameTeamInviteDialog
import com.chwl.app.ui.im.avtivity.NimP2PMessageActivity
import com.chwl.app.ui.utils.RVDelegate
import com.chwl.app.utils.ClipboardUtils
import com.chwl.core.game_team.GameTeamRecordBean
import com.chwl.library.utils.SingleToastUtil
class GameTeamRecordFragment : BaseViewBindingFragment<GameTemaRecordFragmentBinding>() {
companion object {
const val TYPE_INITIATOR = 0
const val TYPE_RECEIVER = 1
fun newInstance(type: Int): GameTeamRecordFragment {
return GameTeamRecordFragment().apply {
arguments = Bundle().apply {
putInt("type", type)
}
}
}
}
private val viewModel: GameTeamRecordViewModel by viewModels()
private val adapter = GameTeamRecordAdapter()
private var type: Int = TYPE_INITIATOR
private var rvDelegate: RVDelegate<GameTeamRecordBean>? = null
private var pageNum = 1
private val pageSize = 20
override fun init() {
type = arguments?.getInt("type", TYPE_INITIATOR) ?: TYPE_INITIATOR
initView()
initEvent()
initObserve()
binding.swipeRefresh.isRefreshing = true
loadData(true)
}
private fun initView() {
adapter.isInitiator = type == TYPE_INITIATOR
binding.recyclerView.adapter = adapter
rvDelegate = RVDelegate.Builder<GameTeamRecordBean>()
.setPageSize(pageSize)
.setAdapter(adapter)
.setRecyclerView(binding.recyclerView)
.setEmptyView(
EmptyViewHelper.createEmptyTextViewHeight(
context,
getString(R.string.data_empty)
)
)
.setLayoutManager(LinearLayoutManager(mContext))
.build()
}
private fun initEvent() {
adapter.setOnItemChildClickListener { adapter, view, position ->
val item = (adapter.getItem(position) as? GameTeamRecordBean)
?: return@setOnItemChildClickListener
when (view.id) {
R.id.tv_repurchase -> {
jumpRepurchase(item)
}
R.id.tv_chat -> {
jumpChat(item)
}
R.id.iv_order_id_copy -> {
ClipboardUtils.copyText(item.orderNo ?: "")
toast(getString(R.string.have_copy))
}
}
}
binding.swipeRefresh.setOnRefreshListener {
loadData(true)
}
adapter.setOnLoadMoreListener({
loadData(false)
}, binding.recyclerView)
}
private fun initObserve() {
viewModel.listLiveData.observe(this) {
binding.swipeRefresh.isRefreshing = false
rvDelegate?.loadData(it)
if (!it.isSuccess && it.message != null) {
toast(it.message)
}
}
}
private fun jumpRepurchase(item: GameTeamRecordBean) {
val uid = getTargetUidByItem(item)
val gameId = item.gameId
val gameBackground = item.gamePic
val gamePrice = item.price ?: 0
val gameInning = item.inning ?: 1
if (uid == null || gameId == null) {
toast(R.string.data_parsing_exception)
return
}
GameTeamInviteDialog.newInstance(
targetUid = uid,
gameId = gameId,
gameBackground = gameBackground,
gamePrice = gamePrice,
gameInning = gameInning
).apply {
this.successListener = {
loadData(true)
}
}.safeShow(requireActivity().supportFragmentManager, requireActivity())
}
private fun jumpChat(item: GameTeamRecordBean) {
val targetUid = getTargetUidByItem(item)?.toString()
if (targetUid.isNullOrEmpty()) {
return
}
NimP2PMessageActivity.start(requireContext(), targetUid)
}
private fun getTargetUidByItem(item: GameTeamRecordBean): Long? {
val targetUid = if (type == TYPE_INITIATOR) {
item.toUid
} else {
item.fromUid
}
return targetUid
}
private fun loadData(isRefresh: Boolean) {
if (isRefresh) {
pageNum = 1
} else {
pageNum++
}
viewModel.getRecordList(type, pageNum, pageSize)
}
}

View File

@@ -0,0 +1,103 @@
package com.chwl.app.ui.game_team.record;
import android.content.Context;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.chwl.app.R;
import com.chwl.app.ui.widget.XRecyclerView.ScaleTransitionPagerTitleView;
import com.chwl.app.ui.widget.magicindicator.buildins.UIUtil;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
import java.util.List;
public class GameTeamRecordIndicatorAdapter extends CommonNavigatorAdapter {
private final Context mContext;
private final List<? extends CharSequence> mTitleList;
private int textSize = 14;
private float minScale = 1f;
private boolean showIndicator = true;
private OnItemSelectListener mOnItemSelectListener;
public GameTeamRecordIndicatorAdapter(Context context, List<? extends CharSequence> charSequences) {
this.mContext = context;
this.mTitleList = charSequences;
}
@Override
public int getCount() {
return mTitleList == null ? 0 : mTitleList.size();
}
@Override
public IPagerTitleView getTitleView(Context context, final int i) {
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_66000000));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_000000));
scaleTransitionPagerTitleView.setMinScale(minScale);
scaleTransitionPagerTitleView.setTextSize(textSize);
int padding = UIUtil.dip2px(context, 13);
scaleTransitionPagerTitleView.setPadding(padding, 0, padding, 0);
scaleTransitionPagerTitleView.setText(mTitleList.get(i));
scaleTransitionPagerTitleView.setOnClickListener(view -> {
if (mOnItemSelectListener != null) {
mOnItemSelectListener.onItemSelect(i, scaleTransitionPagerTitleView);
}
});
return scaleTransitionPagerTitleView;
}
@Override
public IPagerIndicator getIndicator(Context context) {
LinePagerIndicator indicator = new LinePagerIndicator(context);
indicator.setMode(LinePagerIndicator.MODE_EXACTLY);
indicator.setLineHeight(context.getResources().getDimensionPixelOffset(R.dimen.dp_3));
indicator.setRoundRadius(context.getResources().getDimensionPixelOffset(R.dimen.dp_2));
indicator.setLineWidth(context.getResources().getDimensionPixelOffset(R.dimen.dp_13));
indicator.setColors(context.getResources().getColor(R.color.color_0FCA81));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// lp.bottomMargin = mBottomMargin;
indicator.setLayoutParams(lp);
return indicator;
}
public int getTextSize() {
return textSize;
}
public void setTextSize(int textSize) {
this.textSize = textSize;
}
public float getMinScale() {
return minScale;
}
public void setMinScale(float minScale) {
this.minScale = minScale;
}
public boolean isShowIndicator() {
return showIndicator;
}
public void setShowIndicator(boolean showIndicator) {
this.showIndicator = showIndicator;
}
public void setOnItemSelectListener(OnItemSelectListener onItemSelectListener) {
mOnItemSelectListener = onItemSelectListener;
}
public interface OnItemSelectListener {
void onItemSelect(int position, TextView view);
}
}

View File

@@ -0,0 +1,23 @@
package com.chwl.app.ui.game_team.record
import androidx.lifecycle.MutableLiveData
import com.chwl.app.base.BaseViewModel
import com.chwl.core.auth.AuthModel
import com.chwl.core.bean.response.ListResult
import com.chwl.core.game_team.GameTeamRecordBean
import com.chwl.core.room.game.GameModel
class GameTeamRecordViewModel : BaseViewModel() {
val listLiveData = MutableLiveData<ListResult<GameTeamRecordBean>>()
fun getRecordList(type: Int, pageNum: Int, pageSize: Int) {
safeLaunch(onError = {
listLiveData.postValue(ListResult.failed(pageNum, it))
}) {
val list =
GameModel.getGameTeamRecordList(type, pageNum, pageSize, AuthModel.get().currentUid)
listLiveData.postValue(ListResult.success(list, pageNum))
}
}
}

View File

@@ -71,6 +71,11 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
*/
public boolean isSuperLuckyGift;
/**
* 礼物名称
*/
public String giftName;
public GiftInfoVm(Context context, GiftInfo data, boolean select, boolean isKnap) {
super(context, data);
this.isSelect.set(select);
@@ -110,6 +115,7 @@ public class GiftInfoVm extends BaseItem<GiftInfo> {
SimpleVipInfo vipInfo = data.getGiftVipInfo();
isLocked = vipInfo != null && VipHelper.getMyVipLevel() < vipInfo.getVipLevel();
vipIcon = vipInfo == null ? "" : vipInfo.getVipIcon();
giftName = data.getFirstGiftName();
}
@Override

View File

@@ -5,8 +5,10 @@ import android.content.Context;
import com.chwl.app.community.holder.DynamicSysHolder;
import com.chwl.app.community.im.WorldDynamicShareViewHolder;
import com.chwl.app.module_hall.im.msgholder.FamilyMsgViewHolder;
import com.chwl.app.ui.im.chat.GameTeamInviteViewHolder;
import com.chwl.core.community.attachment.DynamicSysAttachment;
import com.chwl.core.community.im.WorldDynamicAttachment;
import com.chwl.core.im.custom.bean.GameTeamInviteAttachment;
import com.chwl.core.module_hall.im.FamilyAttachment;
import com.netease.nim.uikit.api.NimUIKit;
import com.netease.nim.uikit.api.model.contact.ContactEventListener;
@@ -169,6 +171,9 @@ public class ImInitHelper {
// 客服充值
NimUIKit.registerMsgItemViewHolder(P2PContactRechargeAttachment.class, MsgViewHolderP2PContactRecharge.class);
// 游戏组队 - 邀请
NimUIKit.registerMsgItemViewHolder(GameTeamInviteAttachment.class, GameTeamInviteViewHolder.class);
NimUIKit.setSessionListener(listener);
NimUIKit.setContactEventListener(listener1);
}

View File

@@ -8,6 +8,7 @@ import com.chwl.app.decoration.view.DecorationStoreActivity;
import com.chwl.app.earn.activity.EarnRecordActivity;
import com.chwl.app.pay.activity.GiveGoldActivity;
import com.chwl.app.ui.feedback.FeedbackActivity;
import com.chwl.app.ui.game_team.record.GameTeamRecordActivity;
import com.chwl.core.module_hall.hall.bean.H5FamilyInfo;
import com.chwl.core.module_hall.hall.bean.UserClanInfo;
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
@@ -293,6 +294,9 @@ public class RouterHandler {
case RouterType.MY_DONATION:
GiveGoldActivity.Companion.start(context);
break;
case RouterType.GAME_TEAM_RECORD:
GameTeamRecordActivity.Companion.start(context);
break;
default:
SingleToastUtil.showToast(ResUtil.getString(R.string.ui_im_routerhandler_07));
return false;

View File

@@ -0,0 +1,118 @@
package com.chwl.app.ui.im.chat
import android.content.Context
import android.graphics.Color
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.Keep
import com.chwl.app.R
import com.chwl.app.ui.utils.load
import com.chwl.core.im.custom.bean.GameTeamInviteAttachment
import com.example.lib_utils.AppUtils
import com.example.lib_utils.UiUtils
import com.google.android.material.imageview.ShapeableImageView
import com.google.android.material.shape.CornerFamily
import com.google.android.material.shape.ShapeAppearanceModel
import com.netease.nim.uikit.business.session.viewholder.MsgViewHolderBase
import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
@Keep
class GameTeamInviteViewHolder(adapter: BaseMultiItemFetchLoadAdapter<*, *>) :
MsgViewHolderBase(adapter) {
private val isRTL = UiUtils.isRtl(AppUtils.getApp())
private val leftShapeAppearance: ShapeAppearanceModel by lazy(LazyThreadSafetyMode.NONE) {
buildBackgroundShapeAppearance(context ?: AppUtils.getApp(), true)
}
private val rightShapeAppearance: ShapeAppearanceModel by lazy(LazyThreadSafetyMode.NONE) {
buildBackgroundShapeAppearance(context ?: AppUtils.getApp(), false)
}
override fun getContentResId(): Int {
return R.layout.layout_msg_view_holder_game_team_invite
}
override fun inflateContentView() {
}
override fun leftBackground(): Int {
return R.color.transparent
}
override fun rightBackground(): Int {
return R.color.transparent
}
override fun bindContentView() {
val attachment = message?.attachment as? GameTeamInviteAttachment
val data = attachment?.msgData
val gameNameView = findViewById<TextView>(R.id.tv_game_name)
val gameInningView = findViewById<TextView>(R.id.tv_game_inning)
val gameIconView = findViewById<ImageView>(R.id.iv_icon)
val gameBackgroundView = findViewById<ShapeableImageView>(R.id.iv_image)
val gameBackgroundMaskView = findViewById<ShapeableImageView>(R.id.iv_image_mask)
val shapeAppearance = getBackgroundShapeAppearance()
gameBackgroundView.shapeAppearanceModel = shapeAppearance
gameBackgroundMaskView.shapeAppearanceModel = shapeAppearance
gameNameView.text = data?.gameName ?: ""
gameInningView.text =
context?.getString(R.string.game_team_18)?.format(data?.inning?.toString() ?: "0") ?: ""
gameIconView.load(data?.gameLogo)
gameBackgroundView.load(data?.gamePic, defaultRes = R.color.color_33000000)
}
private fun getBackgroundShapeAppearance(): ShapeAppearanceModel {
return if (isReceivedMessage) {
if (isRTL) {
rightShapeAppearance
} else {
leftShapeAppearance
}
} else {
if (isRTL) {
leftShapeAppearance
} else {
rightShapeAppearance
}
}
}
private fun buildBackgroundShapeAppearance(
context: Context,
isLeft: Boolean
): ShapeAppearanceModel {
val cornerA = context.resources.getDimension(R.dimen.dp_12)
val cornerB = context.resources.getDimension(R.dimen.dp_2)
val topLeftCorner: Float
val topRightCorner: Float
if (isLeft) {
topLeftCorner = cornerB
topRightCorner = cornerA
} else {
topLeftCorner = cornerA
topRightCorner = cornerB
}
return ShapeAppearanceModel.Builder().apply {
this.setTopLeftCorner(
CornerFamily.ROUNDED,
topLeftCorner
)
this.setTopRightCorner(
CornerFamily.ROUNDED,
topRightCorner
)
this.setBottomLeftCorner(
CornerFamily.ROUNDED,
cornerA
)
this.setBottomRightCorner(
CornerFamily.ROUNDED,
cornerA
)
}.build()
}
}

View File

@@ -14,6 +14,7 @@ import com.chwl.app.common.widget.dialog.DialogManager.OkCancelDialogListener
import com.chwl.app.databinding.ActivitySettingBinding
import com.chwl.app.notify.RoomNotifyManager
import com.chwl.app.ui.debug.DebugActivity
import com.chwl.app.ui.game_team.record.GameTeamRecordActivity
import com.chwl.app.ui.im.avtivity.BlackListManageActivity
import com.chwl.app.ui.language.LanguageActivity
import com.chwl.app.ui.login.BindPhoneActivity
@@ -222,8 +223,8 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
}
private fun debug() {
startActivity(Intent(this, DebugActivity::class.java))
// CommonWebViewActivity.start(this,"https://api.molistar.xyz/molistar/activity/2024-invitationFission/index.html")
startActivity(Intent(this, GameTeamRecordActivity::class.java))
// CommonWebViewActivity.start(this,"http://beta.api.molistar.xyz/molistar/modules/order/index.html")
// PublicChatRoomMessageActivity.start(this)
// MyDecorationActivity.start(this,0)
}

View File

@@ -0,0 +1,31 @@
package com.chwl.app.ui.user.adapter
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.core.view.isVisible
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.chwl.app.R
import com.chwl.app.ui.utils.load
import com.chwl.core.game_team.UserGameTeamInfo
class UserInfoGameTeamAdapter(private val isMe: Boolean) :
BaseQuickAdapter<UserGameTeamInfo, BaseViewHolder>(R.layout.user_info_item_game_team) {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
return super.onCreateViewHolder(parent, viewType).apply {
addOnClickListener(R.id.layout_play)
getView<View>(R.id.layout_play).isVisible = !isMe
}
}
override fun convert(helper: BaseViewHolder, item: UserGameTeamInfo) {
helper.setText(R.id.tv_name, item.gameName)
helper.setText(R.id.tv_level, item.proficiency)
helper.setText(R.id.tv_price, item.price?.toString() ?: "")
helper.getView<ImageView>(R.id.iv_icon).load(item.logo)
helper.getView<ImageView>(R.id.iv_bg)
.load(item.background, defaultRes = R.color.color_66000000)
}
}

View File

@@ -3,7 +3,7 @@ package com.chwl.app.ui.user.dialog
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogUserAreaPickerBinding
import com.chwl.app.ui.user.adapter.ArrayWheelAdapter
import java.io.Serializable
@@ -15,7 +15,7 @@ import java.io.Serializable
* desc: 用户地区
*/
class UserAreaDialog :
BaseDialog<DialogUserAreaPickerBinding>() {
BaseDialogFragment<DialogUserAreaPickerBinding>() {
private var mOptionsItems: List<String>? = null

View File

@@ -9,22 +9,26 @@ import com.chwl.app.R
import com.chwl.app.base.BaseViewBindingFragment
import com.chwl.app.databinding.UserInfoDataFragmentBinding
import com.chwl.app.support.FragmentVisibleStateHelper
import com.chwl.app.ui.game_team.invite.GameTeamInviteDialog
import com.chwl.app.ui.user.activity.ShowPhotoActivity
import com.chwl.app.ui.user.activity.UserInfoModifyActivity
import com.chwl.app.ui.user.activity.UserModifyPhotosActivity
import com.chwl.app.ui.user.adapter.UserInfoAlbumAdapter
import com.chwl.app.ui.user.adapter.UserInfoGameTeamAdapter
import com.chwl.app.ui.user.adapter.UserInfoGiftAdapter
import com.chwl.app.ui.user.adapter.UserInfoMedalAdapter
import com.chwl.app.ui.user.viewmodel.UserInfoViewModel
import com.chwl.app.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
import com.chwl.app.ui.widget.recyclerview.decoration.SpacingDecoration
import com.chwl.core.game_team.UserGameTeamInfo
import com.chwl.core.user.bean.UserPhoto
import com.example.lib_utils.UiUtils
class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding>() {
private val viewModel: UserInfoViewModel by activityViewModels()
override fun init() {
initGameTeam()
initAlbum()
initMedal()
initGift()
@@ -36,6 +40,29 @@ class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding
}
}
private fun initGameTeam() {
val adapter = UserInfoGameTeamAdapter(viewModel.isMe)
binding.recyclerViewGameTeam.addItemDecoration(
SpacingDecoration(
0,
resources.getDimensionPixelOffset(R.dimen.dp_10),
false
)
)
binding.recyclerViewGameTeam.adapter = adapter
adapter.setOnItemChildClickListener { adapter, view, position ->
activity?.let {
val item = (adapter.getItem(position) as? UserGameTeamInfo)
?: return@setOnItemChildClickListener
GameTeamInviteDialog.newInstance(item).safeShow(it.supportFragmentManager, it)
}
}
viewModel.userInfoDetailData.observe(this) {
adapter.setNewData(it.userGamePartner ?: emptyList())
binding.layoutGameTeam.isVisible = !it.userGamePartner.isNullOrEmpty()
}
}
private fun initAlbum() {
val albumAdapter = UserInfoAlbumAdapter()
binding.ivAlbumMore.isVisible = viewModel.isMe

View File

@@ -0,0 +1,285 @@
package com.chwl.app.ui.wallet.payment
import android.app.Activity
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import com.chwl.app.R
import com.chwl.app.common.widget.dialog.DialogManager
import com.chwl.core.pay.PayModel
import com.chwl.core.pay.bean.PayRecordId
import com.chwl.library.utils.SingleToastUtil
import com.example.lib_utils.log.ILog
import com.example.module_base.support.billing.IBillingResult
import com.example.module_base.support.billing.IBillingService2
import com.example.module_base.support.billing.IProductDetails
import com.example.module_base.support.billing.IPurchase
import com.example.module_base.support.billing.OnBillingClientStateListener
import com.example.module_base.support.billing.OnConsumeResponseListener
import com.example.module_base.support.billing.OnProductDetailsResponseListener
import com.example.module_base.support.billing.OnPurchasesResponseListener
import com.example.module_base.support.google.IGoogleService
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
class GPaymentClient(val activity: Activity) : IPaymentClient, IBillingService2.Listener,
OnProductDetailsResponseListener, LifecycleEventObserver, ILog, OnBillingClientStateListener {
private var compositeDisposable: CompositeDisposable? = null
private var _billingService: IBillingService2? = null
private val dialogManager = DialogManager(activity)
private var paymentIntent: PaymentIntent? = null
private var productItem: IProductDetails? = null
private var orderId: String? = null
init {
dialogManager.setCanceledOnClickOutside(false)
dialogManager.setCanceledOnClickBackKey(false)
(activity as? LifecycleOwner)?.lifecycle?.addObserver(this)
}
private fun getBillingService(): IBillingService2? {
if (_billingService == null) {
_billingService = IGoogleService.newBillingService2(activity, this)
_billingService?.setLogEnabled(true)
_billingService?.startConnection(this)
}
return _billingService
}
override fun launchPayment(intent: PaymentIntent) {
logD("launchPayment() intent:${intent.productId}")
if (paymentIntent != null) {
SingleToastUtil.showToast(R.string.avroom_activity_roomblacklistactivity_015)
return
}
dialogManager.showProgressDialog(activity)
this.paymentIntent = intent
tryLaunch()
}
private fun tryLaunch() {
val billingService = getBillingService()
if (billingService == null) {
callFailed(
IPaymentClient.CODE_NONSUPPORT,
PaymentException(activity.getString(R.string.bean_response_serviceresult_015))
)
return
}
val productId = paymentIntent?.productId
val productItem = productItem
logD("tryLaunch() productId:$productId productItem:$productItem")
if (productId == null) {
return
}
if (getBillingService()?.isServiceConnected() != true) {
logD("tryLaunch() isServiceConnected = false")
return
}
if (productItem == null) {
getBillingService()?.querySkuDetailsAsync(listOf(productId), this)
} else {
placeOrder(productItem)
}
}
private fun placeOrder(productItem: IProductDetails) {
logD("placeOrder() productItem:${productItem.getProductId()}")
addDisposable(PayModel.get().placeOrder(productItem.getProductId())
.subscribe(
{ recordId: PayRecordId ->
if (paymentIntent?.productId == productItem.getProductId()) {
orderId = recordId.recordId
getBillingService()?.launchBillingFlow(
productItem,
recordId.recordId
)
} else {
logE("placeOrder() 意图发生改变")
}
}
) { throwable: Throwable ->
callFailed(IPaymentClient.CODE_PLACE_ORDER_FAILED, throwable)
})
}
override fun onBillingSetupFinished(billingResult: IBillingResult) {
if (billingResult.isResponseOk()) {
logD("onBillingClientSetupFinished()")
getBillingService()?.queryPurchases(object : OnPurchasesResponseListener {
override fun onQueryPurchasesResponse(
billingResult: IBillingResult,
purchases: List<IPurchase>
) {
if (billingResult.isResponseOk() && purchases.isNotEmpty()) {
purchases.forEach {
handlePurchases(false, it)
}
}
}
})
tryLaunch()
} else {
callFailed(
IPaymentClient.CODE_UNAVAILABLE, billingResult
)
}
}
override fun onPurchasesUpdated(billingResult: IBillingResult, purchases: List<IPurchase>?) {
logD("onPurchasesUpdated() billingResult:${billingResult.getResponseCode()} purchases:${purchases?.size}")
if (billingResult.isResponseOk() && !purchases.isNullOrEmpty()) {
purchases.forEach {
handlePurchases(true, it)
}
} else {
callFailed(IPaymentClient.CODE_PURCHASE_FAILED, billingResult)
}
}
private fun handlePurchases(isCurrentPaying: Boolean, purchases: IPurchase) {
logD("handlePurchases isCurrentPaying:${isCurrentPaying} state:${purchases.getPurchaseState()}")
val identifiers = purchases.getAccountIdentifiers()
if (purchases.isPurchasedState() && identifiers != null) {
logD("handlePurchases() verifyOrder")
addDisposable(
PayModel.get().verifyOrder(
identifiers.getObfuscatedAccountId(),
purchases.getProducts().firstOrNull(),
purchases.getPackageName(),
purchases.getPurchaseToken()
).subscribe({
logD("handlePurchases() verifyOrder consumeAsync")
consumeAsync(isCurrentPaying, it)
}, {
logD("handlePurchases() error:${it.message}")
if (isCurrentPaying) {
callFailed(IPaymentClient.CODE_VERIFY_ORDER_FAILED, it)
}
})
)
}
}
private fun consumeAsync(isCurrentPaying: Boolean, token: String) {
logD("consumeAsync() isCurrentPaying:${isCurrentPaying} token:$token")
getBillingService()?.consumeAsync(token, object : OnConsumeResponseListener {
override fun onConsumeResponse(billingResult: IBillingResult, purchaseToken: String) {
logD("consumeAsync() onConsumeResponse billingResult:${billingResult} purchaseToken:$purchaseToken")
if (isCurrentPaying) {
if (billingResult.isResponseOk()) {
val orderId = orderId
if (orderId != null) {
callSuccess(orderId)
}
} else {
callFailed(IPaymentClient.CODE_CONSUME_ORDER_FAILED, billingResult)
}
}
}
})
}
override fun onProductDetailsResponse(
billingResult: IBillingResult,
productDetails: List<IProductDetails>
) {
logD("onProductDetailsResponse() billingResult:${billingResult.getResponseCode()} productDetails:${productDetails.size}")
if (billingResult.isResponseOk()) {
val item = productDetails.firstOrNull {
it.getProductId() == paymentIntent?.productId
}
productItem = item
if (item != null) {
tryLaunch()
} else {
callFailed(IPaymentClient.CODE_PRODUCT_NOT_FOUND, billingResult)
}
} else {
callFailed(IPaymentClient.CODE_PRODUCT_NOT_FOUND, billingResult)
}
}
private fun callSuccess(orderRecordId: String) {
logD("callSuccess() orderRecordId:${orderRecordId} productId:${paymentIntent?.productId}")
paymentIntent?.let {
it.listener.onResponse(PaymentResult.PaymentSuccess(it.productId, orderRecordId))
}
paymentIntent = null
dialogManager.dismissDialog()
}
private fun callFailed(code: Int) {
callFailed(
code,
PaymentException(
code,
message = activity.getString(R.string.common_operation_prompt_format).format(code)
)
)
}
private fun callFailed(code: Int, billingResult: IBillingResult) {
callFailed(
code,
PaymentException(
code,
message = activity.getString(R.string.common_operation_prompt_format)
.format("$code-${billingResult.getResponseCode()}")
)
)
}
private fun callFailed(code: Int, throwable: Throwable) {
throwable.printStackTrace()
logD("callFailed() code:${code} throwable:${throwable.message}")
throwable.let {
SingleToastUtil.showToast(
it.message
)
}
paymentIntent?.let {
it.listener.onResponse(PaymentResult.PaymentFailed(it.productId, code, throwable))
}
paymentIntent = null
dialogManager.dismissDialog()
}
private fun getCompositeDisposable(): CompositeDisposable {
var disposable = compositeDisposable
if (disposable == null) {
disposable = CompositeDisposable()
compositeDisposable = disposable
}
return disposable
}
private fun addDisposable(disposable: Disposable) {
getCompositeDisposable().add(disposable)
}
override fun onCleared() {
logD("onCleared()")
_billingService?.destroy()
paymentIntent = null
compositeDisposable?.dispose()
compositeDisposable = null
dialogManager.dismissDialog()
}
override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
logD("onStateChanged() event:$event")
when (event) {
Lifecycle.Event.ON_DESTROY -> {
(activity as? LifecycleOwner)?.lifecycle?.removeObserver(this)
onCleared()
}
else -> {
}
}
}
}

View File

@@ -0,0 +1,42 @@
package com.chwl.app.ui.wallet.payment
import com.example.lib_utils.ICleared
interface IPaymentClient : ICleared {
companion object {
// 支付成功
const val CODE_SUCCESS = 200
// 未知异常原因
const val CODE_OTHER = 0
// 不支持该功能
const val CODE_NONSUPPORT = 1
// 服务暂不可用
const val CODE_UNAVAILABLE = 2
// 未查询到购买信息
const val CODE_PRODUCT_NOT_FOUND = 3
// 预下单失败
const val CODE_PLACE_ORDER_FAILED = 4
// 购买失败
const val CODE_PURCHASE_FAILED = 5
// 验证订单失败
const val CODE_VERIFY_ORDER_FAILED = 6
// 核消订单失败
const val CODE_CONSUME_ORDER_FAILED = 7
}
fun launchPayment(intent: PaymentIntent)
override fun onCleared()
interface Listener {
fun onResponse(result: PaymentResult)
}
}

View File

@@ -0,0 +1,13 @@
package com.chwl.app.ui.wallet.payment
import androidx.annotation.Keep
@Keep
class PaymentException : Exception {
var code = 0
constructor(message: String) : super(message)
constructor(code: Int, message: String) : super(message) {
this.code = code
}
}

View File

@@ -0,0 +1,4 @@
package com.chwl.app.ui.wallet.payment
class PaymentIntent(val productId: String, val listener: IPaymentClient.Listener) {
}

View File

@@ -0,0 +1,12 @@
package com.chwl.app.ui.wallet.payment
sealed class PaymentResult {
data class PaymentSuccess(val productId: String, val orderId: String) : PaymentResult()
data class PaymentFailed(
val productId: String,
val code: Int,
val exception: Throwable? = null
) : PaymentResult()
}

View File

@@ -91,6 +91,8 @@ public class CommonWebViewActivity extends BaseActivity {
private static final String POSITION = "position";
private int mPosition;
private JSInterface jsInterface;
public static void start(Context context, String url) {
Intent intent = new Intent(context, CommonWebViewActivity.class);
intent.putExtra("url", url);
@@ -194,7 +196,7 @@ public class CommonWebViewActivity extends BaseActivity {
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
}
webView.getSettings().setTextZoom(100);
JSInterface jsInterface = new JSInterface(webView, this);
jsInterface = new JSInterface(webView, this);
jsInterface.setPosition(mPosition);
webView.addJavascriptInterface(jsInterface, "androidJsObj");
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
@@ -441,6 +443,9 @@ public class CommonWebViewActivity extends BaseActivity {
@Override
protected void onDestroy() {
if (jsInterface != null) {
jsInterface.onCleared();
}
EventBus.getDefault().unregister(this);
if (webViewCallBack != null) {

View File

@@ -1,8 +1,6 @@
package com.chwl.app.ui.webview;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Build;
import android.text.TextUtils;
@@ -16,7 +14,6 @@ import androidx.appcompat.app.AlertDialog;
import com.orhanobut.logger.Logger;
import com.chwl.app.R;
import com.chwl.app.base.BaseBindingFragment;
import com.chwl.app.common.widget.dialog.BaseAlertDialogBuilder;
import com.chwl.app.databinding.FragmentCommonWebViewBinding;
import com.chwl.library.annatation.ActLayoutRes;
import com.chwl.library.utils.ResUtil;
@@ -26,6 +23,7 @@ public class CommonWebViewFragment extends BaseBindingFragment<FragmentCommonWeb
private WebView webView;
protected String url;
private JSInterface jsInterface;
@Override
public void initiate() {
@@ -37,7 +35,7 @@ public class CommonWebViewFragment extends BaseBindingFragment<FragmentCommonWeb
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
}
webView.getSettings().setTextZoom(100);
JSInterface jsInterface = new JSInterface(webView, getActivity());
jsInterface = new JSInterface(webView, getActivity());
webView.addJavascriptInterface(jsInterface, "androidJsObj");
webView.setWebViewClient(new WebViewClient() {
@@ -113,4 +111,12 @@ public class CommonWebViewFragment extends BaseBindingFragment<FragmentCommonWeb
ShowWebView(url);
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (jsInterface != null) {
jsInterface.onCleared();
}
}
}

View File

@@ -14,13 +14,21 @@ import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chwl.app.earn.activity.EarnRecordActivity;
import com.chwl.app.ui.invite.InviteImageHelper;
import com.chwl.app.ui.invite.ShareInviteDialog;
import com.chwl.app.ui.invite.ShareInviteInfo;
import com.chwl.app.ui.wallet.payment.GPaymentClient;
import com.chwl.app.ui.wallet.payment.IPaymentClient;
import com.chwl.app.ui.wallet.payment.PaymentIntent;
import com.chwl.app.ui.wallet.payment.PaymentResult;
import com.chwl.library.language.LanguageHelper;
import com.chwl.library.utils.json.JsonUtils;
import com.example.lib_utils.ICleared;
import com.google.gson.Gson;
import com.netease.nim.uikit.common.util.log.LogUtil;
import com.orhanobut.logger.Logger;
@@ -51,7 +59,6 @@ import com.chwl.library.record.AuditRecorderConfiguration;
import com.chwl.library.record.ExtAudioRecorder;
import com.chwl.library.rxbus.RxBus;
import com.chwl.library.utils.AppMetaDataUtil;
import com.chwl.library.utils.AppUtils;
import com.chwl.library.utils.DeviceUuidFactory;
import com.chwl.library.utils.SystemUtils;
import com.chwl.library.utils.VersionUtil;
@@ -66,7 +73,7 @@ import java.util.HashMap;
* <p> html js 与webview 交互接口</p>
* Created by ${user} on 2017/11/6.
*/
public class JSInterface {
public class JSInterface implements ICleared {
private static final String TAG = JSInterface.class.getSimpleName();
private WebView mWebView;
private CommonWebViewActivity mActivity;
@@ -75,6 +82,7 @@ public class JSInterface {
private MediaRecorder recorder;
private File myRecAudioFile;
private ExtAudioRecorder extAudioRecorder;
private GPaymentClient paymentClient;
public JSInterface(WebView webView, CommonWebViewActivity activity) {
mWebView = webView;
@@ -87,6 +95,68 @@ public class JSInterface {
this.context = context;
}
private void loadUrl(String url) {
com.example.lib_utils.log.LogUtil.d("JSInterface", "loadUrl url:" + url, false);
if (Looper.myLooper() == Looper.getMainLooper()) {
if (mWebView != null) {
mWebView.loadUrl(url);
}
} else {
if (mActivity != null) {
mActivity.runOnUiThread(() -> {
if (mWebView != null) {
mWebView.loadUrl(url);
}
});
}
}
}
private void callJsWithJson(String name, Object params) {
if (name == null) {
return;
}
if (params != null) {
String jsonStr = JsonUtils.toJson(params);
loadUrl("javascript:" + name + "(" + jsonStr + ")");
} else {
loadUrl("javascript:" + name + "()");
}
}
/**
* 拉起本地支付
*/
@JavascriptInterface
public void openPayment(String productId) {
com.example.lib_utils.log.LogUtil.d("JSInterface", "openPayment productId:" + productId, false);
if (mActivity == null || TextUtils.isEmpty(productId)) {
return;
}
mActivity.runOnUiThread(() -> {
if (paymentClient == null) {
paymentClient = new GPaymentClient(mActivity);
}
PaymentIntent paymentIntent = new PaymentIntent(productId, new IPaymentClient.Listener() {
@Override
public void onResponse(@NonNull PaymentResult result) {
HashMap<String, Object> map = new HashMap<>();
if (result instanceof PaymentResult.PaymentSuccess) {
map.put("orderId", ((PaymentResult.PaymentSuccess) result).getOrderId());
map.put("productId", ((PaymentResult.PaymentSuccess) result).getProductId());
map.put("code", 200);
} else if (result instanceof PaymentResult.PaymentFailed) {
map.put("code", ((PaymentResult.PaymentFailed) result).getCode());
map.put("productId", ((PaymentResult.PaymentFailed) result).getProductId());
}
callJsWithJson("openPaymentCallback", map);
}
});
paymentClient.launchPayment(paymentIntent);
});
}
/**
* 调转个人主页
*
@@ -122,7 +192,7 @@ public class JSInterface {
map.put(IReportConstants.MODULE, IReportConstants.MOLISTAR_PAY);
ReportManager.get().reportEvent(IReportConstants.PAYPAGE_SHOW, map);
// if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
ChargeActivity.start(context);
ChargeActivity.start(context);
// } else {
// CommonWebViewActivity.start(
// context, UriProvider.getOfficialPay(
@@ -175,7 +245,7 @@ public class JSInterface {
if (activity == null) {
return;
}
ShareInviteInfo info = new Gson().fromJson(json,ShareInviteInfo.class);
ShareInviteInfo info = new Gson().fromJson(json, ShareInviteInfo.class);
if (info.getType() != null) {
if (info.getType() == 1) {
activity.runOnUiThread(() -> {
@@ -474,7 +544,7 @@ public class JSInterface {
jsonObject.put("netType", String.valueOf(SystemUtils.getNetworkType(context)));
jsonObject.put("model", SystemUtils.getPhoneModel());
jsonObject.put("appVersion", VersionUtil.getLocalName(context));
jsonObject.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context)));
jsonObject.put("appVersionCode", String.valueOf(VersionUtil.getVersionCode(context)));
jsonObject.put("deviceId", DeviceUtil.getDeviceId(context));
jsonObject.put("channel", AppMetaDataUtil.getChannelID());
jsonObject.put("Accept-Language", LanguageHelper.INSTANCE.getCurrentLanguageType());
@@ -556,4 +626,11 @@ public class JSInterface {
PraiseModel.get().praise(Long.parseLong(uid), true).subscribe();
NimP2PMessageActivity.start(context, uid);
}
@Override
public void onCleared() {
if (paymentClient != null) {
paymentClient.onCleared();
}
}
}

View File

@@ -12,7 +12,6 @@ import com.tencent.vasdolly.helper.ChannelReaderUtil;
import com.chwl.app.application.App;
import com.chwl.core.XConstants;
import com.chwl.core.Constants;
import com.chwl.library.utils.AppUtils;
import com.chwl.library.utils.VersionUtil;
/**
@@ -108,7 +107,7 @@ public class SimpleJSInterface {
jsonObject.put("os", "android");
jsonObject.put("app", XConstants.APP_MARK);
jsonObject.put("appVersion", VersionUtil.getLocalName(context));
jsonObject.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context)));
jsonObject.put("appVersionCode", String.valueOf(VersionUtil.getVersionCode(context)));
jsonObject.put("channel", getChannel());
Log.e(TAG, "getDeviceInfo: " + jsonObject);
return jsonObject.toJSONString();

View File

@@ -2,13 +2,13 @@ package com.chwl.app.ui.widget
import com.netease.nim.uikit.common.util.sys.ScreenUtil
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogDatingSelectBinding
import com.chwl.core.room.event.DatingSelectUserEvent
import com.chwl.library.utils.ResUtil
import org.greenrobot.eventbus.EventBus
class DatingSelectDialog(val position: Int, val uid: Long, private val myUid: Long, val roomUid: Long) : BaseDialog<DialogDatingSelectBinding>() {
class DatingSelectDialog(val position: Int, val uid: Long, private val myUid: Long, val roomUid: Long) : BaseDialogFragment<DialogDatingSelectBinding>() {
override fun init() {
width = ScreenUtil.dip2px(200f)

View File

@@ -59,7 +59,7 @@ class SideBarView : View {
this.textSizeFocus = focusTextSize
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
paintText(canvas)
}

View File

@@ -21,7 +21,7 @@ class AutoMirroredAnimView : AnimView {
defStyleAttr
)
override fun dispatchDraw(canvas: Canvas?) {
override fun dispatchDraw(canvas: Canvas) {
if (layoutDirection == LAYOUT_DIRECTION_RTL) {
canvas?.scale(-1f, 1f, width / 2f, height / 2f)
}

View File

@@ -21,7 +21,7 @@ class AutoMirroredImageView : ImageView {
defStyleRes: Int
) : super(context, attrs, defStyleAttr, defStyleRes)
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
if (layoutDirection == LAYOUT_DIRECTION_RTL) {
canvas?.scale(-1f, 1f, width / 2f, height / 2f)
}

View File

@@ -0,0 +1,23 @@
package com.chwl.app.view
import android.content.Context
import android.graphics.Canvas
import android.util.AttributeSet
import com.google.android.material.imageview.ShapeableImageView
class AutoMirroredShapeableImageView : ShapeableImageView {
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
override fun onDraw(canvas: Canvas) {
if (layoutDirection == LAYOUT_DIRECTION_RTL) {
canvas?.scale(-1f, 1f, width / 2f, height / 2f)
}
super.onDraw(canvas)
}
}

View File

@@ -5,7 +5,7 @@ import android.view.Gravity
import android.view.WindowManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogPaymentBinding
import com.chwl.app.ui.utils.RVDelegate
import com.chwl.app.vip.adapter.PayAdapter
@@ -15,7 +15,7 @@ import com.chwl.library.utils.ResUtil
/**
* 支付选择弹窗
*/
class PaymentDialog : BaseDialog<DialogPaymentBinding>() {
class PaymentDialog : BaseDialogFragment<DialogPaymentBinding>() {
private lateinit var rvDelegate: RVDelegate<PayInfo>

View File

@@ -10,7 +10,7 @@ import android.view.WindowManager
import androidx.core.graphics.toColorInt
import com.netease.nim.uikit.common.util.sys.ScreenUtil
import com.chwl.app.R
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogSelectPayTypeBinding
import com.chwl.app.ui.widget.dialog.CommonTipDialog
import com.chwl.app.utils.SpannableBuilder
@@ -24,7 +24,7 @@ import com.chwl.library.utils.SingleToastUtil
/**
* 充值方式选择弹窗
*/
class SelectPayTypeDialog : BaseDialog<DialogSelectPayTypeBinding>() {
class SelectPayTypeDialog : BaseDialogFragment<DialogSelectPayTypeBinding>() {
private val descText by lazy { requireArguments().getString("descText", "") }
private val coins by lazy { requireArguments().getLong("coins", 0) }

View File

@@ -1,11 +1,11 @@
package com.chwl.app.vip.dialog
import android.os.Bundle
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogVipAuthDetailsBinding
import com.chwl.app.ui.utils.load
class VipAuthDetailsDialog : BaseDialog<DialogVipAuthDetailsBinding>() {
class VipAuthDetailsDialog : BaseDialogFragment<DialogVipAuthDetailsBinding>() {
companion object {
@JvmStatic

View File

@@ -6,7 +6,7 @@ import androidx.core.view.isVisible
import androidx.fragment.app.viewModels
import com.chwl.app.R
import com.chwl.app.base.BaseActivity
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogVipBroadcastBinding
import com.chwl.app.vip.VipViewModel
import com.chwl.core.utils.CurrentTimeUtils
@@ -17,7 +17,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit
class VipBroadcastDialog : BaseDialog<DialogVipBroadcastBinding>() {
class VipBroadcastDialog : BaseDialogFragment<DialogVipBroadcastBinding>() {
companion object {
@JvmStatic

View File

@@ -1,10 +1,10 @@
package com.chwl.app.vip.dialog
import android.os.Bundle
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogVipRemainTimeBinding
class VipRemainTimeDialog : BaseDialog<DialogVipRemainTimeBinding>() {
class VipRemainTimeDialog : BaseDialogFragment<DialogVipRemainTimeBinding>() {
companion object {
@JvmStatic

View File

@@ -8,14 +8,14 @@ import com.opensource.svgaplayer.SVGADrawable
import com.opensource.svgaplayer.SVGAParser
import com.opensource.svgaplayer.SVGAVideoEntity
import com.chwl.app.base.BaseActivity
import com.chwl.app.base.BaseDialog
import com.chwl.app.base.BaseDialogFragment
import com.chwl.app.databinding.DialogVipUpgradeBinding
import com.chwl.app.vip.VipViewModel
import com.chwl.core.vip.bean.VipInfo
import java.net.MalformedURLException
import java.net.URL
class VipUpgradeDialog : BaseDialog<DialogVipUpgradeBinding>() {
class VipUpgradeDialog : BaseDialogFragment<DialogVipUpgradeBinding>() {
companion object {
@JvmStatic

View File

@@ -0,0 +1,15 @@
<?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="#FFFE4EB4"
android:startColor="#FFFF1ED7"
android:type="linear"
android:useLevel="true" />
<corners
android:bottomLeftRadius="100dp"
android:topLeftRadius="100dp" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="0"
android:startColor="#4C1A1A1A"
android:centerColor="#CC1F1F1F"
android:endColor="#E5161616" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="0"
android:endColor="#4C1A1A1A"
android:centerColor="#CC1F1F1F"
android:startColor="#E5161616" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="13dp" />
<gradient
android:angle="0"
android:endColor="#41D4F6"
android:startColor="#70E9E7" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="13dp" />
<gradient
android:angle="0"
android:endColor="#FED118"
android:startColor="#FDB719" />
</shape>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_12" />
<gradient
android:angle="0"
android:endColor="#4C1A1A1A"
android:centerColor="#CC1F1F1F"
android:startColor="#E5161616" />
</shape>

View File

@@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="91dp">
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/color_F5F5F5"/>
android:layout_height="@dimen/dp_1"
android:background="@color/color_F5F5F5" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical"
android:gravity="center" >
android:paddingVertical="@dimen/dp_20">
<LinearLayout
android:layout_width="match_parent"
@@ -22,32 +23,32 @@
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="12dp"
android:orientation="horizontal" >
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/layout_dialog_voice_seek_01"
android:textSize="13sp"
android:textColor="@color/color_999999" />
android:textColor="@color/color_999999"
android:textSize="13sp" />
<SeekBar
android:id="@+id/voice_seek"
style="@style/seekbarAppearance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:minHeight="2dp"
android:maxHeight="2dp"
android:layout_gravity="center_vertical"
style="@style/seekbarAppearance"/>
android:layout_weight="1.0"
android:maxHeight="2dp"
android:minHeight="2dp" />
<TextView
android:id="@+id/voice_number"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:text="50%"
android:textSize="12sp"
android:textColor="@color/color_999999" />
android:textColor="@color/color_999999"
android:textSize="12sp" />
</LinearLayout>
@@ -55,34 +56,34 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="12dp"
android:orientation="horizontal" >
android:layout_marginEnd="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/layout_dialog_voice_seek_02"
android:textSize="13sp"
android:textColor="@color/color_999999" />
android:textColor="@color/color_999999"
android:textSize="13sp" />
<SeekBar
android:id="@+id/music_voice_seek"
style="@style/seekbarAppearance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:minHeight="2dp"
android:maxHeight="2dp"
android:layout_gravity="center_vertical"
style="@style/seekbarAppearance"/>
android:layout_weight="1.0"
android:maxHeight="2dp"
android:minHeight="2dp" />
<TextView
android:id="@+id/music_voice_number"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:text="100%"
android:textSize="12sp"
android:textColor="@color/color_999999" />
android:textColor="@color/color_999999"
android:textSize="12sp" />
</LinearLayout>

View File

@@ -228,6 +228,19 @@
tools:contentDescription="@string/layout_fragment_av_room_game_05"
tools:visibility="visible" />
<ImageView
android:id="@+id/iv_config_entrance"
android:layout_width="@dimen/dp_38"
android:layout_height="@dimen/dp_38"
android:layout_above="@id/iv_game"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_11"
android:layout_marginBottom="@dimen/dp_20"
android:onClick="@{click}"
android:src="@drawable/room_ic_game"
android:visibility="gone"
tools:visibility="visible"/>
<ImageView
android:id="@+id/iv_game"
android:layout_width="@dimen/dp_38"
@@ -235,20 +248,23 @@
android:layout_above="@id/iv_queuing_micro"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_11"
android:layout_marginBottom="@dimen/dp_6"
android:layout_marginBottom="@dimen/dp_20"
android:onClick="@{click}"
android:src="@drawable/room_ic_game" />
android:src="@drawable/room_ic_game"
android:visibility="gone"
tools:visibility="visible"/>
<ImageView
android:id="@+id/iv_team_pk"
android:layout_width="@dimen/dp_38"
android:layout_height="@dimen/dp_38"
android:layout_above="@id/iv_game"
android:layout_above="@id/iv_config_entrance"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/dp_11"
android:layout_marginBottom="@dimen/dp_8"
android:src="@drawable/room_team_pk_icon"
android:visibility="gone" />
android:visibility="gone"
tools:visibility="visible"/>
<LinearLayout
android:layout_width="wrap_content"

View File

@@ -0,0 +1,236 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginHorizontal="@dimen/dp_38"
app:layout_constraintDimensionRatio="300:280"
app:layout_constraintTop_toBottomOf="@id/iv_close">
<com.chwl.app.view.AutoMirroredImageView
android:id="@+id/iv_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/game_team_invite_bg" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/game_team_06"
android:textColor="#563C1F"
android:textSize="@dimen/dp_20"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.091" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_game_image"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="@dimen/dp_1"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="223:95"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.339"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.327"
app:shapeAppearance="@style/shape_corner_10dp"
app:strokeColor="#F09540"
app:strokeWidth="@dimen/dp_2" />
<ImageView
android:id="@+id/iv_count_add"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/game_team_invite_ic_add"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="@id/iv_game_image"
app:layout_constraintHeight_percent="0.082"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.663" />
<TextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:minWidth="@dimen/dp_30"
android:paddingHorizontal="@dimen/dp_5"
android:text="1"
android:textColor="#471606"
android:textSize="@dimen/dp_13"
app:layout_constraintBottom_toBottomOf="@id/iv_count_add"
app:layout_constraintEnd_toStartOf="@id/iv_count_add"
app:layout_constraintTop_toTopOf="@id/iv_count_add" />
<ImageView
android:id="@+id/iv_count_subtract"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/game_team_invite_ic_subtract"
app:layout_constraintBottom_toBottomOf="@id/iv_count_add"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@id/tv_count"
app:layout_constraintTop_toTopOf="@id/iv_count_add" />
<TextView
android:id="@+id/tv_count_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/game_team_07"
android:textColor="#3F3C33"
android:textSize="@dimen/dp_14"
app:layout_constraintBottom_toBottomOf="@id/iv_count_add"
app:layout_constraintStart_toStartOf="@id/iv_game_image"
app:layout_constraintTop_toTopOf="@id/iv_count_add" />
<ImageView
android:id="@+id/iv_money"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/icon_diamond"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_percent="0.042"
app:layout_constraintHorizontal_bias="0.81"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.768" />
<TextView
android:id="@+id/tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_2"
android:text="0"
android:textColor="#491609"
android:textSize="@dimen/dp_17"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/iv_money"
app:layout_constraintEnd_toStartOf="@id/iv_money"
app:layout_constraintTop_toTopOf="@id/iv_money" />
<TextView
android:id="@+id/tv_money_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/game_team_08"
android:textColor="#3F3C33"
android:textSize="@dimen/dp_14"
app:layout_constraintBottom_toBottomOf="@id/iv_money"
app:layout_constraintStart_toStartOf="@id/iv_game_image"
app:layout_constraintTop_toTopOf="@id/iv_money" />
<View
android:layout_width="0dp"
android:layout_height="@dimen/dp_0_5"
android:background="#33442A11"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/iv_game_image"
app:layout_constraintStart_toStartOf="@id/iv_game_image"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.835" />
<TextView
android:id="@+id/tv_pay"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/base_shape_theme_13dp"
android:gravity="center"
android:maxLines="1"
android:text="@string/pay"
android:textColor="@color/white"
android:textSize="@dimen/dp_13"
app:autoSizeMaxTextSize="@dimen/dp_13"
app:autoSizeMinTextSize="@dimen/dp_8"
app:autoSizeStepGranularity="1px"
app:autoSizeTextType="uniform"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="65:26"
app:layout_constraintEnd_toEndOf="@id/iv_game_image"
app:layout_constraintHeight_percent="0.092"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.948" />
<TextView
android:id="@+id/tv_balance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:text="@string/gift_wallet_overage"
android:textColor="#3F3C33"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="@id/layout_recharge"
app:layout_constraintEnd_toStartOf="@id/layout_recharge"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="@id/iv_game_image"
app:layout_constraintTop_toTopOf="@id/layout_recharge"
app:layout_constraintWidth_default="wrap" />
<LinearLayout
android:id="@+id/layout_recharge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_3"
android:gravity="center_vertical"
app:layout_constraintBottom_toBottomOf="@id/tv_pay"
app:layout_constraintEnd_toStartOf="@id/tv_pay"
app:layout_constraintStart_toEndOf="@id/tv_balance"
app:layout_constraintTop_toTopOf="@id/tv_pay"
app:layout_constraintVertical_bias="0.6">
<ImageView
android:id="@+id/iv_balance"
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_10"
android:layout_marginStart="@dimen/dp_1_5"
android:src="@drawable/icon_diamond" />
<TextView
android:id="@id/tv_recharge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:layout_marginEnd="@dimen/dp_3"
android:text="@string/charge"
android:textColor="#FF433A"
android:textSize="@dimen/dp_12" />
<com.chwl.app.view.AutoMirroredImageView
android:id="@+id/iv_recharge"
android:layout_width="@dimen/dp_4_5"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="@drawable/game_team_invite_ic_recharge_arrow" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/iv_close"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26"
android:layout_marginStart="-1dp"
android:scaleType="fitCenter"
android:src="@drawable/game_team_invite_ic_close"
app:layout_constraintStart_toEndOf="@id/layout_content"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,38 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F9F9F9">
<FrameLayout
android:id="@+id/layout_title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EBECF3"
android:paddingTop="@dimen/dp_30"
app:layout_constraintTop_toTopOf="parent">
<com.chwl.app.base.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
<com.chwl.app.ui.widget.magicindicator.MagicIndicator
android:id="@+id/magic_indicator"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_16"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_title_bar" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_8"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/magic_indicator" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,237 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_6"
android:background="@drawable/game_team_record_bg_item"
android:paddingHorizontal="@dimen/dp_9"
android:paddingBottom="@dimen/dp_14">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_user_avatar"
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_60"
android:layout_marginStart="@dimen/dp_9"
android:layout_marginTop="@dimen/dp_12"
android:scaleType="centerCrop"
android:src="@drawable/default_cover"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearance="@style/shape_corner_10dp" />
<TextView
android:id="@+id/tv_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_6"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:layout_constraintBottom_toTopOf="@id/tv_user_id"
app:layout_constraintStart_toEndOf="@id/iv_user_avatar"
app:layout_constraintTop_toTopOf="@id/iv_user_avatar"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Name" />
<TextView
android:id="@+id/tv_user_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#666666"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toBottomOf="@id/iv_user_avatar"
app:layout_constraintStart_toStartOf="@id/tv_user_name"
app:layout_constraintTop_toBottomOf="@id/tv_user_name"
tools:text="1000" />
<View
android:id="@+id/v_line_top"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_0_5"
android:layout_marginTop="@dimen/dp_14"
android:background="#F4F4F4"
app:layout_constraintTop_toBottomOf="@id/iv_user_avatar" />
<TextView
android:id="@+id/tv_game_name_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_11"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/game_team_12"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_line_top" />
<TextView
android:id="@+id/tv_order_money_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_13"
android:text="@string/game_team_13"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:layout_constraintStart_toStartOf="@id/tv_game_name_title"
app:layout_constraintTop_toBottomOf="@id/tv_game_name_title" />
<TextView
android:id="@+id/tv_order_time_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_13"
android:text="@string/game_team_14"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:layout_constraintStart_toStartOf="@id/tv_game_name_title"
app:layout_constraintTop_toBottomOf="@id/tv_order_money_title" />
<TextView
android:id="@+id/tv_order_id_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_13"
android:text="@string/game_team_15"
android:textColor="#242335"
android:textSize="@dimen/dp_15"
app:layout_constraintStart_toStartOf="@id/tv_game_name_title"
app:layout_constraintTop_toBottomOf="@id/tv_order_time_title" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_title_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="end"
app:constraint_referenced_ids="tv_game_name_title,tv_order_time_title,tv_order_id_title,tv_order_money_title" />
<TextView
android:id="@+id/tv_game_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:layout_constraintBaseline_toBaselineOf="@id/tv_game_name_title"
app:layout_constraintStart_toEndOf="@id/barrier_title_end"
tools:text="Name" />
<TextView
android:id="@+id/tv_order_money"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:autoSizeMaxTextSize="@dimen/dp_14"
app:autoSizeMinTextSize="@dimen/dp_8"
app:autoSizeStepGranularity="1px"
app:autoSizeTextType="uniform"
app:layout_constraintBaseline_toBaselineOf="@id/tv_order_money_title"
app:layout_constraintEnd_toStartOf="@id/iv_order_money"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="@id/tv_game_name"
app:layout_constraintWidth_default="wrap"
tools:text="1000" />
<TextView
android:id="@+id/tv_order_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:layout_constraintBaseline_toBaselineOf="@id/tv_order_time_title"
app:layout_constraintStart_toStartOf="@id/tv_game_name"
tools:text="2024-10-22 12:22:34" />
<TextView
android:id="@+id/tv_order_id"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="#242335"
android:textSize="@dimen/dp_14"
app:autoSizeMaxTextSize="@dimen/dp_14"
app:autoSizeMinTextSize="@dimen/dp_8"
app:autoSizeStepGranularity="1px"
app:autoSizeTextType="uniform"
app:layout_constraintBaseline_toBaselineOf="@id/tv_order_id_title"
app:layout_constraintEnd_toStartOf="@id/iv_order_id_copy"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="@id/tv_game_name"
app:layout_constraintWidth_default="wrap"
tools:text="1231231231231" />
<ImageView
android:id="@+id/iv_order_money"
android:layout_width="@dimen/dp_12"
android:layout_height="@dimen/dp_12"
android:layout_marginStart="@dimen/dp_2"
android:src="@drawable/icon_diamond"
app:layout_constraintBottom_toBottomOf="@id/tv_order_money"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_order_money"
app:layout_constraintTop_toTopOf="@id/tv_order_money" />
<ImageView
android:id="@+id/iv_order_id_copy"
android:layout_width="@dimen/dp_23"
android:layout_height="@dimen/dp_23"
android:layout_marginEnd="@dimen/dp_5"
android:scaleType="centerInside"
android:src="@drawable/game_team_record_ic_copy"
app:layout_constraintBottom_toBottomOf="@id/tv_order_id"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_order_id"
app:layout_constraintTop_toTopOf="@id/tv_order_id" />
<View
android:id="@+id/v_line_bottom"
android:layout_width="0dp"
android:layout_height="@dimen/dp_0_5"
android:layout_marginTop="@dimen/dp_10"
android:background="#F4F4F4"
app:layout_constraintEnd_toEndOf="@id/v_line_top"
app:layout_constraintStart_toStartOf="@id/v_line_top"
app:layout_constraintTop_toBottomOf="@id/tv_order_id_title" />
<TextView
android:id="@+id/tv_chat"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_26"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_14"
android:layout_marginBottom="@dimen/dp_8"
android:background="@drawable/shape_g_70e9e7_41d4f6_13_lr"
android:gravity="center"
android:minWidth="@dimen/dp_65"
android:paddingHorizontal="@dimen/dp_5"
android:text="@string/send_msg"
android:textColor="@color/color_white"
android:textSize="@dimen/dp_13"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_line_bottom" />
<TextView
android:id="@+id/tv_repurchase"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_26"
android:layout_marginEnd="@dimen/dp_15"
android:background="@drawable/shape_g_fed118_fdb719_13_lr"
android:gravity="center"
android:minWidth="@dimen/dp_65"
android:paddingHorizontal="@dimen/dp_5"
android:text="@string/game_team_16"
android:textColor="@color/color_white"
android:textSize="@dimen/dp_13"
app:layout_constraintBottom_toBottomOf="@id/tv_chat"
app:layout_constraintEnd_toStartOf="@id/tv_chat"
app:layout_constraintTop_toTopOf="@id/tv_chat" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout 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:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.chwl.app.common.widget.StatusLayout
android:id="@+id/status_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/game_team_record_item">
</androidx.recyclerview.widget.RecyclerView>
</com.chwl.app.common.widget.StatusLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@@ -59,66 +59,26 @@
android:textColor="#1E1E1F"
android:textColorHint="#1E1E1F"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toTopOf="@id/fl_avatar"
app:layout_constraintBottom_toTopOf="@id/recycler_view_users"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_room_title"
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
tools:text="Content" />
<FrameLayout
android:id="@+id/fl_avatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_users"
android:layout_width="0dp"
android:layout_height="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_6"
android:nestedScrollingEnabled="false"
android:orientation="horizontal"
android:overScrollMode="never"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_online_number"
app:layout_constraintStart_toStartOf="@id/tv_room_title"
app:layout_constraintTop_toBottomOf="@id/tv_desc">
<com.chwl.app.common.widget.CircleImageView
android:id="@+id/iv_avatar_0"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:src="@drawable/default_avatar"
app:cborder_color="@color/white"
app:cborder_width="1px" />
<com.chwl.app.common.widget.CircleImageView
android:id="@+id/iv_avatar_1"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_16"
android:src="@drawable/default_avatar"
app:cborder_color="@color/white"
app:cborder_width="1px" />
<com.chwl.app.common.widget.CircleImageView
android:id="@+id/iv_avatar_2"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_32"
android:src="@drawable/default_avatar"
app:cborder_color="@color/white"
app:cborder_width="1px" />
<com.chwl.app.common.widget.CircleImageView
android:id="@+id/iv_avatar_3"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_48"
android:src="@drawable/default_avatar"
app:cborder_color="@color/white"
app:cborder_width="1px" />
<com.chwl.app.common.widget.CircleImageView
android:id="@+id/iv_avatar_4"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_64"
android:src="@drawable/default_avatar"
app:cborder_color="@color/white"
app:cborder_width="1px" />
</FrameLayout>
app:layout_constraintTop_toBottomOf="@id/tv_desc"
tools:listitem="@layout/home_item_room_user" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_online_number"

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.imageview.ShapeableImageView 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:id="@+id/iv_avatar"
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:padding="@dimen/dp_0_5"
android:scaleType="centerCrop"
android:src="@drawable/default_avatar"
app:shapeAppearance="@style/shape_circle"
app:strokeColor="@color/white"
app:strokeWidth="@dimen/dp_1" />

View File

@@ -11,6 +11,24 @@
android:layout_height="match_parent"
android:layout_gravity="center">
<TextView
android:id="@+id/tv_room_send_msg_input"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_28"
android:layout_marginStart="@dimen/dp_15"
android:background="@drawable/shape_190b032d_14dp"
android:gravity="center"
android:maxLines="1"
android:paddingStart="@dimen/dp_3"
android:paddingEnd="@dimen/dp_3"
android:text="@string/room_say_something"
android:textColor="@color/white"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:visibility="visible" />
<HorizontalScrollView
android:id="@+id/layout_menus"
android:layout_width="0dp"
@@ -21,7 +39,7 @@
app:layout_constraintEnd_toStartOf="@id/icon_room_send_gift"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_room_send_msg_input"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_default="wrap">
@@ -31,25 +49,6 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_room_send_msg_input"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_28"
android:layout_marginStart="@dimen/dp_15"
android:background="@drawable/shape_190b032d_14dp"
android:gravity="center"
android:maxLines="1"
android:paddingStart="@dimen/dp_3"
android:paddingEnd="@dimen/dp_3"
android:text="@string/room_say_something"
android:textColor="@color/white"
android:visibility="visible"
app:autoSizeMaxTextSize="@dimen/dp_10"
app:autoSizeMinTextSize="@dimen/dp_7"
app:autoSizeStepGranularity="1px"
app:autoSizeTextType="uniform"
tools:visibility="visible" />
<LinearLayout
android:id="@+id/room_mic_layout"
android:layout_width="@dimen/dp_29"
@@ -120,12 +119,21 @@
android:src="@drawable/room_menu_ic_more" />
<ImageView
android:id="@+id/icon_room_game"
android:id="@+id/icon_room_baishun_game"
android:layout_width="@dimen/dp_29"
android:layout_height="@dimen/dp_29"
android:layout_marginStart="@dimen/dp_11"
android:scaleType="fitXY"
android:src="@drawable/room_menu_ic_baishun_game" />
<ImageView
android:id="@+id/icon_room_PK_game"
android:layout_width="@dimen/dp_29"
android:layout_height="@dimen/dp_29"
android:layout_marginStart="@dimen/dp_11"
android:scaleType="fitXY"
android:src="@drawable/room_menu_ic_playlist" />
</LinearLayout>
</HorizontalScrollView>

View File

@@ -0,0 +1,89 @@
<?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="@dimen/dp_234"
android:layout_height="@dimen/dp_98">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_image_mask"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/msg_game_team_bg_mask" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_9"
android:text="@string/game_team_06"
android:textColor="@color/white"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toTopOf="@id/tv_message"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/game_team_17"
android:textColor="#99FFFFFF"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toTopOf="@id/iv_icon"
app:layout_constraintStart_toStartOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<View
android:layout_width="0dp"
android:layout_height="@dimen/dp_0_5"
android:layout_marginBottom="@dimen/dp_4"
android:background="#33C1C4DB"
app:layout_constraintBottom_toTopOf="@id/iv_icon"
app:layout_constraintEnd_toEndOf="@id/tv_message"
app:layout_constraintStart_toStartOf="@id/tv_message" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_icon"
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:layout_marginBottom="@dimen/dp_7"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_title"
app:shapeAppearance="@style/shape_corner_10dp"
tools:src="@drawable/default_cover" />
<TextView
android:id="@+id/tv_game_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5"
android:maxLines="1"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_12"
app:layout_constraintBottom_toTopOf="@id/tv_game_inning"
app:layout_constraintStart_toEndOf="@id/iv_icon"
app:layout_constraintTop_toTopOf="@id/iv_icon"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Name" />
<TextView
android:id="@+id/tv_game_inning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:maxLines="1"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_11"
app:layout_constraintBottom_toBottomOf="@id/iv_icon"
app:layout_constraintStart_toStartOf="@id/tv_game_name"
app:layout_constraintTop_toBottomOf="@id/tv_game_name"
tools:text="1232" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -54,7 +54,7 @@
android:layout_below="@id/gift_image"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:text="@{item.data().giftName}"
android:text="@{item.giftName}"
android:textColor="@{item.isSelect ? @color/color_ffb606 : @color/white}"
android:textSize="@dimen/dp_10"
android:maxLines="2"

View File

@@ -12,11 +12,48 @@
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_game_team"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_20"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/tv_game_team_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_15"
android:text="@string/game_team_01"
android:textColor="#191919"
android:textSize="@dimen/dp_16"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_game_team"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:clipToPadding="false"
android:nestedScrollingEnabled="false"
android:orientation="vertical"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@id/tv_game_team_title"
app:spanCount="2"
tools:background="#33000000"
tools:listitem="@layout/user_info_item_game_team" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_album"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_21">
android:layout_marginTop="@dimen/dp_20">
<TextView
android:id="@+id/tv_album_title"

Some files were not shown because too many files have changed in this diff Show More