Browse Source

feat: 本地化

tongmengxiao 5 months ago
parent
commit
6b30f4ef41

+ 1 - 1
baseswago/src/main/java/com/swago/baseswago/agora/AgoraManager.kt

@@ -236,7 +236,7 @@ object AgoraManager {
 
 
     fun setVideoConfiguration(
-        vd: VideoEncoderConfiguration.VideoDimensions = VideoEncoderConfiguration.VD_640x480,
+        vd: VideoEncoderConfiguration.VideoDimensions = VideoEncoderConfiguration.VD_480x360,
         fps: VideoEncoderConfiguration.FRAME_RATE = VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15
     ) {
         mRtcEngine?.setVideoEncoderConfiguration(

+ 13 - 5
baseswago/src/main/java/com/swago/baseswago/dialog/EnterPasswordDialog.kt

@@ -4,6 +4,7 @@ import android.os.Bundle
 import android.view.Gravity
 import android.view.View
 import android.view.View.OnClickListener
+import com.swago.baseswago.R
 import com.swago.baseswago.databinding.DialogEnterPasswordBinding
 import com.swago.baseswago.databinding.DialogInviteBindingBinding
 import com.swago.baseswago.dialog.BaseXDFragment
@@ -31,12 +32,15 @@ class EnterPasswordDialog : BaseXDFragment<DialogEnterPasswordBinding>() {
         arguments?.let {
             type = it.getInt("type", 0)
         }
-        binding.tvSetting.text = when (type) {
-            2 -> "Enter"
-            else -> {
-                "Setting"
-            }
+        if (type == 2){
+            binding.tvInviteTitle.text = getString(R.string.enter_room_password)
+            binding.tvHint.visibility = View.GONE
+        } else {
+            binding.tvInviteTitle.text = getString(R.string.setting_password)
+            binding.tvHint.visibility = View.VISIBLE
+            binding.tvHint.text = getString(R.string.enter_password)
         }
+
         binding.tvSetting.setOnClickListener {
             val password = binding.activationCode.getPasswordText()
             if (password.isEmpty() || password.length <4)
@@ -45,6 +49,10 @@ class EnterPasswordDialog : BaseXDFragment<DialogEnterPasswordBinding>() {
             dismissAllowingStateLoss()
         }
 
+        binding.ivClose.setOnClickListener {
+            dismissAllowingStateLoss()
+        }
+
     }
 
     override fun initLiveData() {

+ 4 - 0
baseswago/src/main/java/com/swago/baseswago/model/MomentModel.java

@@ -33,6 +33,10 @@ public class MomentModel implements Parcelable {
     private int is_cup;
     private int user_broadcast_type; //直播间类型(1视频2语音)
 
+    public MomentModel(){
+
+    }
+
     protected MomentModel(Parcel in) {
         user_account = in.readString();
         user_name = in.readString();

+ 11 - 1
baseswago/src/main/java/com/swago/baseswago/util/BaseViewModel.kt

@@ -5,6 +5,7 @@ import android.content.Intent
 import android.widget.Toast
 import androidx.lifecycle.AndroidViewModel
 import com.alibaba.android.arouter.launcher.ARouter
+import com.swago.baseswago.R
 import com.swago.baseswago.constant.ARouteConstant
 import com.swago.baseswago.http.SwagoException
 import kotlinx.coroutines.CoroutineScope
@@ -12,6 +13,10 @@ import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.GlobalScope
 import kotlinx.coroutines.launch
 import java.lang.Exception
+import java.net.ConnectException
+import java.net.SocketTimeoutException
+import java.net.UnknownHostException
+import java.util.concurrent.TimeoutException
 
 /**
  *@date 2021/8/23 16:30
@@ -25,7 +30,12 @@ open class BaseViewModel(application: Application) : AndroidViewModel(applicatio
                 callback.invoke(this)
             } catch (e: Exception) {
                 e.printStackTrace()
-                Toast.makeText(AppContext.getContext(), e.message, Toast.LENGTH_SHORT).show()
+                if (e is ConnectException || e is TimeoutException || e is UnknownHostException || e is SocketTimeoutException){
+                    Toast.makeText(AppContext.getContext(), R.string.connect_error_retry, Toast.LENGTH_SHORT).show()
+                } else {
+                    Toast.makeText(AppContext.getContext(), e.message, Toast.LENGTH_SHORT).show()
+                }
+
                 if (e is SwagoException) {
                     if (e.code == 403) {
                         if (UserInfo.getLoginModel()?.token?.isNotEmpty() == true){

+ 2 - 2
baseswago/src/main/res/drawable/shape_9b20fc_line_20.xml → baseswago/src/main/res/drawable/shape_9b20fc_line_37.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <stroke android:width="2dp" android:color="#9b20fc"/>
+    <stroke android:width="1dp" android:color="#ff56b7"/>
     <solid android:color="@color/_ffffff"/>
-    <corners android:radius="20dp"/>
+    <corners android:radius="37dp"/>
 </shape>

+ 69 - 58
baseswago/src/main/res/layout/dialog_enter_password.xml

@@ -1,74 +1,75 @@
 <?xml version="1.0" encoding="utf-8"?>
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    app:layout_constraintTop_toTopOf="parent"
+    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"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools">
+    app:layout_constraintTop_toTopOf="parent">
 
 
     <androidx.constraintlayout.widget.ConstraintLayout
-        android:background="@drawable/shape_white_20"
-        app:layout_constraintTop_toTopOf="parent"
+        android:id="@+id/cl_content"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
         android:layout_marginStart="40dp"
         android:layout_marginEnd="40dp"
+        android:background="@drawable/shape_white_20"
         android:paddingBottom="30dp"
         app:layout_constraintBottom_toBottomOf="parent"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        app:layout_constraintTop_toTopOf="parent">
 
 
-    <TextView
-        android:id="@+id/tv_invite_title"
-        android:text="Set Room Password"
-        android:textColor="#0F172A"
-        android:textSize="18sp"
-        android:textStyle="bold"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        android:layout_marginTop="30dp"/>
+        <TextView
+            android:id="@+id/tv_invite_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="30dp"
+            android:text="@string/setting_password"
+            android:textColor="#0F172A"
+            android:textSize="18sp"
+            android:textStyle="bold"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
 
-    <TextView
-        android:id="@+id/tv_hint"
-        android:text="Please enter your password"
-        android:textColor="#0F172A"
-        android:textSize="14sp"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        android:layout_marginTop="16dp"
-        app:layout_constraintTop_toBottomOf="@+id/tv_invite_title"/>
+        <TextView
+            android:id="@+id/tv_hint"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="16dp"
+            android:text="@string/enter_password"
+            android:textColor="#0F172A"
+            android:textSize="14sp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tv_invite_title" />
 
-    <com.swago.baseswago.cusview.CodeTextView
-        android:id="@+id/activation_code"
-        android:layout_width="match_parent"
-        android:layout_height="60dp"
-        android:layout_marginStart="32dp"
-        android:layout_marginEnd="32dp"
-        android:layout_marginTop="16dp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/tv_hint"/>
+        <com.swago.baseswago.cusview.CodeTextView
+            android:id="@+id/activation_code"
+            android:layout_width="match_parent"
+            android:layout_height="60dp"
+            android:layout_marginStart="32dp"
+            android:layout_marginTop="16dp"
+            android:layout_marginEnd="32dp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tv_hint" />
 
-    <TextView
-        android:id="@+id/tv_setting"
-        android:layout_width="match_parent"
-        android:layout_height="50dp"
-        android:layout_marginTop="20dp"
-        app:layout_constraintTop_toBottomOf="@+id/activation_code"
-        app:layout_constraintEnd_toEndOf="parent"
-        android:layout_marginEnd="20dp"
-        android:textColor="#fff"
-        android:textSize="@dimen/sp_16"
-        android:text="Setting"
-        android:gravity="center"
-        android:layout_marginBottom="30dp"
-        android:layout_marginStart="30dp"
-        android:background="@drawable/shape_9b20fc_20"/>
+        <TextView
+            android:id="@+id/tv_setting"
+            android:layout_width="match_parent"
+            android:layout_height="44dp"
+            android:layout_marginStart="30dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginEnd="20dp"
+            android:layout_marginBottom="30dp"
+            android:background="@drawable/shape_ff56b7_37"
+            android:gravity="center"
+            android:text="@string/live_setting"
+            android:textColor="#fff"
+            android:textSize="@dimen/sp_16"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/activation_code" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 
@@ -76,9 +77,19 @@
         android:id="@+id/iv_bg"
         android:layout_width="match_parent"
         android:layout_height="100dp"
-        android:background="@mipmap/bg_invite"
-        app:layout_constraintTop_toTopOf="parent"
         android:layout_marginStart="40dp"
-        android:layout_marginEnd="40dp"/>
+        android:layout_marginEnd="40dp"
+        android:background="@mipmap/bg_invite"
+        app:layout_constraintTop_toTopOf="@+id/cl_content" />
+
+    <ImageView
+        android:id="@+id/iv_close"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="20dp"
+        android:src="@mipmap/ic_finish_password"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/cl_content" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 40 - 28
baseswago/src/main/res/layout/dialog_invite_binding.xml

@@ -28,7 +28,7 @@
 
         <TextView
             android:id="@+id/tv_invite_title"
-            android:text="Agency invitation"
+            android:text="@string/agency_invitation"
             android:textColor="#0F172A"
             android:textSize="18sp"
             android:textStyle="bold"
@@ -40,7 +40,8 @@
             android:layout_marginTop="50dp"/>
 
         <TextView
-            android:text="Nickname (ID: 324235) invites you to join his guild "
+            android:id="@+id/tv_invite_detail"
+            android:text="@string/invites_you_to_join_his_guild"
             android:textColor="#0F172A"
             android:textSize="14sp"
             android:layout_width="match_parent"
@@ -52,34 +53,45 @@
             android:layout_marginTop="24dp"
             app:layout_constraintTop_toBottomOf="@+id/tv_invite_title"/>
 
-
-        <TextView
-            android:id="@+id/tv_refuse"
-            android:layout_width="120dp"
-            android:layout_height="50dp"
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:weightSum="2"
+            android:layout_marginStart="@dimen/dp_10"
+            android:layout_marginEnd="@dimen/dp_10"
             app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            android:layout_marginStart="20dp"
-            android:text="Refuse"
-            android:textColor="#9b20fc"
-            android:textSize="@dimen/sp_16"
-            android:gravity="center"
-            android:layout_marginBottom="20dp"
-            android:background="@drawable/shape_9b20fc_line_20"/>
+            app:layout_constraintStart_toStartOf="parent">
+            <TextView
+                android:id="@+id/tv_refuse"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:layout_height="44dp"
+                android:text="@string/invite_refuses"
+                android:textColor="#ff56b7"
+                android:textSize="@dimen/sp_16"
+                android:gravity="center"
+                android:layout_marginEnd="@dimen/dp_10"
+                android:layout_marginStart="@dimen/dp_10"
+                android:layout_marginBottom="20dp"
+                android:background="@drawable/shape_9b20fc_line_37"/>
+
+            <TextView
+                android:id="@+id/tv_agree"
+                android:layout_width="0dp"
+                android:layout_height="44dp"
+                android:textColor="#fff"
+                android:textSize="@dimen/sp_16"
+                android:text="@string/invite_agree"
+                android:layout_weight="1"
+                android:gravity="center"
+                android:layout_marginEnd="@dimen/dp_10"
+                android:layout_marginStart="@dimen/dp_10"
+                android:layout_marginBottom="20dp"
+                android:background="@drawable/shape_ff56b7_37"/>
+        </LinearLayout>
+
 
-        <TextView
-            android:id="@+id/tv_agree"
-            android:layout_width="120dp"
-            android:layout_height="50dp"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            android:layout_marginEnd="20dp"
-            android:textColor="#fff"
-            android:textSize="@dimen/sp_16"
-            android:text="Agree"
-            android:gravity="center"
-            android:layout_marginBottom="20dp"
-            android:background="@drawable/shape_9b20fc_20"/>
     </androidx.constraintlayout.widget.ConstraintLayout>
 
     <ImageView

BIN
baseswago/src/main/res/mipmap-xxhdpi/ic_finish_password.png


+ 11 - 0
baseswago/src/main/res/values-ar/strings.xml

@@ -265,4 +265,15 @@
     <string name="use_chats_condition_content">\n 1.مبلغ إعادة الشحن > 0 \n2.المستوى ≥5</string>
     <string name="recharge_message">شحن</string>
     <string name="ok">تمام</string>
+    <string name="living_room_already_be_closed">غرفة المعيشة تكون مغلقة بالفعل</string>
+    <string name="room_will_be_closed_after">سيتم إغلاق الغرفة بعد(%ss)</string>
+    <string name="agency_invitation">دعوة</string>
+    <string name="invites_you_to_join_his_guild">"%s"يدعوك للانضمام إلى وكالته (ID:%s)%s</string>
+    <string name="invite_agree">موافق</string>
+    <string name="invite_refuses">رفض</string>
+    <string name="setting_password">أنشئ كلمة مرور</string>
+    <string name="enter_password">الرجاء إدخال كلمة المرور</string>
+    <string name="live_setting">يتأكد</string>
+    <string name="enter_room_password">الرجاء إدخال كلمة المرور للغرفة</string>
+    <string name="connect_error_retry">اتصال غير طبيعي، يرجى التحقق من اتصال الشبكة</string>
 </resources>

+ 11 - 0
baseswago/src/main/res/values-in/strings.xml

@@ -269,4 +269,15 @@
     <string name="use_chats_condition_content">\n1. Jumlah top up>0 \n2.Tingkat ≥5</string>
     <string name="recharge_message">Top up</string>
     <string name="ok">OKE</string>
+    <string name="living_room_already_be_closed">Live sudah ditutup</string>
+    <string name="room_will_be_closed_after">Live room akan ditutup setelah (%ss)</string>
+    <string name="agency_invitation">Undangan agency</string>
+    <string name="invites_you_to_join_his_guild">"%s"(ID:%s)mengundang Anda bergabung agency "%s"</string>
+    <string name="invite_agree">Setuju</string>
+    <string name="invite_refuses">Menolak</string>
+    <string name="setting_password">Pengaturan kata sandi</string>
+    <string name="enter_password">Silakan masukkan kata sandi</string>
+    <string name="live_setting">Konfirmasi</string>
+    <string name="enter_room_password">Silakan masukkan kata sandi</string>
+    <string name="connect_error_retry">Koneksi tidak normal, silakan periksa koneksi jaringan</string>
 </resources>

+ 11 - 0
baseswago/src/main/res/values-ms/strings.xml

@@ -266,4 +266,15 @@
     <string name="use_chats_condition_content">\n1. Jumlah top up>0 \n2.Tingkat ≥5</string>
     <string name="recharge_message">Top up</string>
     <string name="ok">OKE</string>
+    <string name="living_room_already_be_closed">Live sudah ditutup</string>
+    <string name="room_will_be_closed_after">Live room akan ditutup setelah (%ss)</string>
+    <string name="agency_invitation">Undangan agency</string>
+    <string name="invites_you_to_join_his_guild">"%s"(ID:%s)mengundang Anda bergabung agency "%s"</string>
+    <string name="invite_agree">Setuju</string>
+    <string name="invite_refuses">Menolak</string>
+    <string name="setting_password">Pengaturan kata sandi</string>
+    <string name="enter_password">Silakan masukkan kata sandi</string>
+    <string name="live_setting">Konfirmasi</string>
+    <string name="enter_room_password">Silakan masukkan kata sandi</string>
+    <string name="connect_error_retry">Koneksi tidak normal, silakan periksa koneksi jaringan</string>
 </resources>

+ 11 - 0
baseswago/src/main/res/values-zh/strings.xml

@@ -265,4 +265,15 @@
     <string name="use_chats_condition_content">\n1. 充值金额>0 \n2. 等级≥5级</string>
     <string name="recharge_message">充值</string>
     <string name="ok">好的</string>
+    <string name="living_room_already_be_closed">直播间被关闭</string>
+    <string name="room_will_be_closed_after">直播间在(%sS)后被关闭</string>
+    <string name="agency_invitation">家族邀请</string>
+    <string name="invites_you_to_join_his_guild">%s(ID:%s)邀请你加入他的工会"%s"</string>
+    <string name="invite_agree">同意</string>
+    <string name="invite_refuses">拒绝</string>
+    <string name="setting_password">设置密码</string>
+    <string name="enter_password">请输入密码</string>
+    <string name="live_setting">确认</string>
+    <string name="enter_room_password">请输入房间密码</string>
+    <string name="connect_error_retry">连接异常,请检查网络连接</string>
 </resources>

+ 11 - 0
baseswago/src/main/res/values/strings.xml

@@ -287,4 +287,15 @@
     <string name="use_chats_condition_content">\n1.recharge amount >0 \n2.Level ≥ 5</string>
     <string name="recharge_message">Recharge</string>
     <string name="ok">Okay</string>
+    <string name="living_room_already_be_closed">Room be closed</string>
+    <string name="room_will_be_closed_after">room will be closed after(%ss)</string>
+    <string name="agency_invitation">agency invitation</string>
+    <string name="invites_you_to_join_his_guild">%s(ID:%s)invites you to join his guild "%s"</string>
+    <string name="invite_agree">agree</string>
+    <string name="invite_refuses">refuse</string>
+    <string name="setting_password">setting password</string>
+    <string name="enter_password">Please enter your password</string>
+    <string name="live_setting">confirm</string>
+    <string name="enter_room_password">Please enter room password</string>
+    <string name="connect_error_retry">Abnormal connection, please check the network connection</string>
 </resources>

+ 24 - 11
room/src/main/java/com/swago/room/dialog/CloseLiveDialog.kt

@@ -3,20 +3,16 @@ package com.swago.room.dialog
 import android.os.Bundle
 import android.os.CountDownTimer
 import android.view.Gravity
-import androidx.fragment.app.viewModels
-import com.swago.baseswago.baseroom.SwagoRoomManager
 import com.swago.baseswago.dialog.BaseXDFragment
-import com.swago.baseswago.util.NoDoubleClickListener
-import com.swago.baseswago.util.SwagoLoading
-import com.swago.room.bean.UserRoomModel
-import com.swago.room.databinding.DialogAudioNoticeBinding
+import com.swago.baseswago.util.AppContext
+import com.swago.room.R
 import com.swago.room.databinding.DialogCloseLiveBinding
-import com.swago.room.vm.RoomOtherVm
 
 class CloseLiveDialog : BaseXDFragment<DialogCloseLiveBinding>() {
+    var closeLive:(()->Unit)? = null
 
     private lateinit var countDownTimer: CountDownTimer
-    private val totalTimeInMillis: Long = 15000
+    private val totalTimeInMillis: Long = 16000
 
     init {
         setGravity(Gravity.CENTER)
@@ -26,8 +22,9 @@ class CloseLiveDialog : BaseXDFragment<DialogCloseLiveBinding>() {
 
 
     companion object {
-        fun newInstance(): CloseLiveDialog {
+        fun newInstance(msg: String): CloseLiveDialog {
             val args = Bundle()
+            args.putString("msg", msg)
             val fragment = CloseLiveDialog()
             fragment.arguments = args
             return fragment
@@ -35,21 +32,37 @@ class CloseLiveDialog : BaseXDFragment<DialogCloseLiveBinding>() {
     }
 
     override fun initOther() {
+        arguments?.let {
+            val msg = it.getString("msg", "")
+            binding.tvHint.text = msg
+        }
         countDownTimer = object : CountDownTimer(totalTimeInMillis, 1000) {
             override fun onTick(millisUntilFinished: Long) {
                 val secondsRemaining = millisUntilFinished / 1000
-
+                binding.tvTime.text =
+                    AppContext.getContext().resources.getString(R.string.room_will_be_closed_after)
+                        .format("$secondsRemaining")
             }
 
             override fun onFinish() {
-
+                closeLive?.invoke()
             }
 
         }
         countDownTimer.start()
+
+        binding.tvClose.setOnClickListener {
+            closeLive?.invoke()
+        }
     }
 
     override fun initLiveData() {
 
     }
+
+    override fun onDestroyView() {
+        super.onDestroyView()
+        countDownTimer.cancel()
+
+    }
 }

+ 2 - 1
room/src/main/java/com/swago/room/giftdandao/GiftDanDaoManager.kt

@@ -6,6 +6,7 @@ import com.swago.baseswago.baseroom.SwagoRoomManager
 import com.swago.baseswago.model.live.gift.IMGiftModel
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.LogUtil
+import com.swago.room.R
 import com.swago.room.sound.SoundPoolPlayer
 import kotlinx.coroutines.*
 import java.util.*
@@ -27,7 +28,7 @@ class GiftDanDaoManager  : IRoomActiveListener {
 
     fun init(){
         SwagoRoomManager.addListener(this)
-        SoundPoolPlayer.init(AppContext.getContext())
+        SoundPoolPlayer.init(AppContext.getContext() , R.raw.gift_sound)
 
     }
 

+ 2 - 2
room/src/main/java/com/swago/room/sound/SoundPoolPlayer.kt

@@ -15,11 +15,11 @@ object SoundPoolPlayer {
     private var soundId:Int = 0
 
 
-    fun init(context:Context){
+    fun init(context:Context , sound : Int){
         if (soundPool == null) {
             soundPool = SoundPool.Builder().setMaxStreams(MAX_STREAMS).build()
             //加载音效
-            soundId = soundPool!!.load(context, R.raw.gift_sound, 1)
+            soundId = soundPool!!.load(context, sound, 1)
         }
         if (vibrator == null){
             vibrator = context.getSystemService(VIBRATOR_SERVICE) as Vibrator

+ 8 - 9
room/src/main/res/layout/dialog_close_live.xml

@@ -21,7 +21,7 @@
 
     <TextView
         android:id="@+id/tv_close_title"
-        android:text="Account has been banned"
+        android:text="@string/living_room_already_be_closed"
         android:textColor="#0F172A"
         android:textSize="18sp"
         android:textStyle="bold"
@@ -30,7 +30,7 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent"
-        android:layout_marginTop="30dp"/>
+        android:layout_marginTop="40dp"/>
 
     <TextView
         android:id="@+id/tv_hint"
@@ -53,7 +53,7 @@
         android:layout_marginEnd="32dp"
         android:layout_marginTop="16dp"
         android:textSize="@dimen/sp_14"
-        android:text="The live will be closed after 5s."
+        android:text="@string/room_will_be_closed_after"
         android:textColor="#DC2626"
         android:gravity="center"
         app:layout_constraintEnd_toEndOf="parent"
@@ -61,32 +61,31 @@
         app:layout_constraintTop_toBottomOf="@+id/tv_hint"/>
 
     <TextView
-        android:id="@+id/tv_setting"
+        android:id="@+id/tv_close"
         android:layout_width="match_parent"
-        android:layout_height="50dp"
+        android:layout_height="44dp"
         android:layout_marginTop="20dp"
         app:layout_constraintTop_toBottomOf="@+id/tv_time"
         app:layout_constraintEnd_toEndOf="parent"
         android:layout_marginEnd="20dp"
         android:textColor="#fff"
         android:textSize="@dimen/sp_16"
-        android:text="Close the Live"
+        android:text="OK"
         android:gravity="center"
         android:layout_marginBottom="30dp"
         android:layout_marginStart="30dp"
-        android:background="@drawable/shape_9b20fc_20"/>
+        android:background="@drawable/shape_ff56b7_37"/>
 
     </androidx.constraintlayout.widget.ConstraintLayout>
 
     <ImageView
         android:id="@+id/iv_bg"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="100dp"
         android:background="@mipmap/bg_close_live"
         android:layout_marginStart="40dp"
         android:layout_marginEnd="40dp"
         android:layout_marginTop="@dimen/dp_40"
-
         app:layout_constraintTop_toTopOf="parent"/>
 
     <ImageView

+ 27 - 5
user/src/main/java/com/swago/user/FollowAndFansActivity.kt

@@ -17,6 +17,7 @@ import com.swago.baseswago.constant.ARouteConstant
 import com.swago.baseswago.cusview.SwagoRecyclerView
 import com.swago.baseswago.databinding.LayoutListBinding
 import com.swago.baseswago.model.BlackListModel
+import com.swago.baseswago.model.MomentModel
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.DpPxUtil
 import com.swago.user.adapter.FollowFanAdapter
@@ -39,6 +40,9 @@ class FollowAndFansActivity : BaseListActivity<LayoutListBinding, BlackListModel
 
     private var position = -1
 
+    private val momentModelList by lazy {
+        ArrayList<MomentModel>()
+    }
 
     private val userVm by viewModels<UserVm>()
 
@@ -85,11 +89,29 @@ class FollowAndFansActivity : BaseListActivity<LayoutListBinding, BlackListModel
 
         adapter.setOnItemClickListener { _, _, position ->
             if (adapter.data.size > position && position >= 0) {
-                PersonDataDFragment.newInstance(
-                    adapter.data[position].id,
-                    isAnchor = false,
-                    inRoom = false
-                ).show(supportFragmentManager, "PersonDataDFragment")
+                if (type == 0){
+                    val momentModel = MomentModel()
+                    momentModel.id = adapter.data[position].id
+                    momentModel.user_account = adapter.data[position].user_account
+                    momentModel.user_name = adapter.data[position].user_name
+                    momentModel.user_head_img_url = adapter.data[position].user_head_img_url
+                    momentModel.user_sex = adapter.data[position].user_sex
+                    momentModelList.clear()
+                    momentModelList.add(momentModel)
+                    ARouter.getInstance()
+                        .build(ARouteConstant.Room.black)
+                        .withInt("position",0)
+                        .withParcelableArrayList("data",momentModelList)
+                        .navigation()
+                } else {
+                    PersonDataDFragment.newInstance(
+                        adapter.data[position].id,
+                        isAnchor = false,
+                        inRoom = false
+                    ).show(supportFragmentManager, "PersonDataDFragment")
+                }
+
+
             }
         }
     }