|
@@ -0,0 +1,98 @@
|
|
|
|
+package com.swago.room.dialog
|
|
|
|
+
|
|
|
|
+import android.annotation.SuppressLint
|
|
|
|
+import android.os.Bundle
|
|
|
|
+import android.view.Gravity
|
|
|
|
+import android.view.View
|
|
|
|
+import com.bumptech.glide.Glide
|
|
|
|
+import com.swago.baseswago.baseroom.SwagoRoomManager
|
|
|
|
+import com.swago.baseswago.dialog.BaseXDFragment
|
|
|
|
+import com.swago.baseswago.model.live.AnchorClosedModel
|
|
|
|
+import com.swago.baseswago.util.NoDoubleClickListener
|
|
|
|
+import com.swago.baseswago.util.TimeUtil
|
|
|
|
+import com.swago.room.R
|
|
|
|
+import com.swago.room.databinding.DialogAnchorCloseBinding
|
|
|
|
+import com.swago.room.enum.RoomType
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ *@date 2021/11/28 21:13
|
|
|
|
+ *description:
|
|
|
|
+ */
|
|
|
|
+class ClarityVideoDialog : BaseXDFragment<DialogAnchorCloseBinding>(){
|
|
|
|
+
|
|
|
|
+ private var anchorCloseModel:AnchorClosedModel? = null
|
|
|
|
+ private var roomType:Int = 1
|
|
|
|
+
|
|
|
|
+ companion object{
|
|
|
|
+ fun newInstance(anchorCloseModel:AnchorClosedModel ,roomType: Int , checkPassword: Boolean):ClarityVideoDialog{
|
|
|
|
+ val dialog = ClarityVideoDialog()
|
|
|
|
+ val bundle = Bundle()
|
|
|
|
+ bundle.putParcelable("model",anchorCloseModel)
|
|
|
|
+ bundle.putInt("roomType",roomType)
|
|
|
|
+ bundle.putBoolean("checkPassword",checkPassword)
|
|
|
|
+ dialog.arguments = bundle
|
|
|
|
+ return dialog
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @SuppressLint("MissingSuperCall")
|
|
|
|
+ override fun onActivityCreated(savedInstanceState: Bundle?) {
|
|
|
|
+ super.onActivityCreated(savedInstanceState)
|
|
|
|
+ setDimAmount(0f)
|
|
|
|
+ setHeightMatchParent()
|
|
|
|
+ setGravity(Gravity.BOTTOM)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ override fun initOther() {
|
|
|
|
+ arguments?.let {
|
|
|
|
+ anchorCloseModel = it.getParcelable("model")
|
|
|
|
+ roomType = it.getInt("roomType")
|
|
|
|
+ val checkPassword = it.getBoolean("checkPassword")
|
|
|
|
+ if (checkPassword){
|
|
|
|
+ binding.tvPassword.visibility = View.VISIBLE
|
|
|
|
+ } else {
|
|
|
|
+ binding.tvPassword.visibility = View.GONE
|
|
|
|
+ }
|
|
|
|
+ if (roomType == RoomType.VIDEO.type){
|
|
|
|
+ binding.tvIncome.text = getString(R.string.income_of_this_live)
|
|
|
|
+ binding.tvTime.text = getString(R.string.duration_of_this_live)
|
|
|
|
+ binding.tvTotalTime.text = getString(R.string.today_video_duration)
|
|
|
|
+ binding.tvWeekTime.text = getString(R.string.total_video_duration_this_week)
|
|
|
|
+ binding.tvWeekDayTime.text = getString(R.string.video_valid_days_this_week)
|
|
|
|
+ } else {
|
|
|
|
+ binding.tvIncome.text = getString(R.string.income_of_this_audio)
|
|
|
|
+ binding.tvTime.text = getString(R.string.duration_of_this_audio)
|
|
|
|
+ binding.tvTotalTime.text = getString(R.string.today_audio_duration)
|
|
|
|
+ binding.tvWeekTime.text = getString(R.string.total_voice_time_this_week)
|
|
|
|
+ binding.tvWeekDayTime.text = getString(R.string.voice_valid_days_this_week)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ anchorCloseModel?.let { anchorClosedModel ->
|
|
|
|
+ Glide.with(this).load(anchorClosedModel.user_head_img_url)
|
|
|
|
+ .placeholder(R.mipmap.default_avatar)
|
|
|
|
+ .error(R.mipmap.default_avatar).into(binding.ivAvatar)
|
|
|
|
+ binding.tvIncomeValue.text = anchorClosedModel.income_coins
|
|
|
|
+ binding.tvWatcherValue.text = anchorClosedModel.total_member
|
|
|
|
+ binding.tvTimeValue.text = TimeUtil.convertMinSecond((anchorClosedModel.broadcast_time))
|
|
|
|
+ binding.tvTotalTimeValue.text = TimeUtil.convertMinSecond((anchorClosedModel.today_total_time))
|
|
|
|
+ binding.tvWeekTimeValue.text = TimeUtil.convertMinSecond((anchorClosedModel.week_total_time ))
|
|
|
|
+ binding.tvWeekDayValue.text = "${anchorClosedModel.week_valid_day}"
|
|
|
|
+ binding.tvName.text = anchorClosedModel.user_name
|
|
|
|
+ binding.tvId.text = "ID:${anchorClosedModel.user_account}"
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ binding.tvClose.setOnClickListener(object : NoDoubleClickListener() {
|
|
|
|
+ override fun onClick() {
|
|
|
|
+ dismissAllowingStateLoss()
|
|
|
|
+ activity?.finish()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ override fun initLiveData() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|