Ver código fonte

feat: pk失败提示

tongmengxiao 3 meses atrás
pai
commit
5a689c2234

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

@@ -370,4 +370,5 @@
     <string name="continue_in_room_earn_coins">ابق في الغرفة لمدة %s دقيقة لتربح عملات %s أخرى.</string>
     <string name="please_setting_camera_microphone">رجى الانتقال إلى الإعدادات لتمكين أذونات الكاميرا </string>
     <string name="successful_collection">تم الاستلام بنجاح</string>
+    <string name="pk_failed_re_pk">الشبكة غير مستقرة، وفشل اتصال pk. يرجى المحاولة مرة أخرى.</string>
 </resources>

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

@@ -382,4 +382,5 @@
     <string name="continue_in_room_earn_coins">Lanjutkan di ruangan host selama %s menit untuk mendapatkan %s koin lagi.</string>
     <string name="please_setting_camera_microphone">Silakan mengaktifkan izin kamera dan mikrofon di pengaturan.</string>
     <string name="successful_collection">Berhasil diterima</string>
+    <string name="pk_failed_re_pk">Jaringan tidak stabil dan koneksi PK gagal, silakan coba lagi</string>
 </resources>

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

@@ -382,4 +382,5 @@
     <string name="continue_in_room_earn_coins">Lanjutkan di ruangan host selama %s menit untuk mendapatkan %s koin lagi.</string>
     <string name="please_setting_camera_microphone">Silakan mengaktifkan izin kamera dan mikrofon di pengaturan.</string>
     <string name="successful_collection">Berhasil diterima</string>
+    <string name="pk_failed_re_pk">Jaringan tidak stabil dan koneksi PK gagal, silakan coba lagi</string>
 </resources>

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

@@ -370,4 +370,5 @@
     <string name="continue_in_room_earn_coins">Continue in the room for %s mins to earn another %s coins.</string>
     <string name="please_setting_camera_microphone">请到设置里开启相机和麦克风权限</string>
     <string name="successful_collection">领取成功</string>
+    <string name="pk_failed_re_pk">网络不稳定,PK连接失败,请重新PK</string>
 </resources>

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

@@ -402,4 +402,5 @@
     <string name="continue_in_room_earn_coins">Continue in the room for %s mins to earn another %s coins.</string>
     <string name="please_setting_camera_microphone">Please go to settings to enable camera and microphone permissions</string>
     <string name="successful_collection">Successful collection</string>
+    <string name="pk_failed_re_pk">Network instability, PK connection failed, please re-PK</string>
 </resources>

+ 7 - 7
home/src/main/java/com/swago/home/HomeFragment.kt

@@ -57,13 +57,13 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
 
 
     override fun loadData() {
-        UserInfo.getUserInfo()?.let{
-            if (!it.is_zhuanpan_every_day){
-                TodayTrafficDialog.newInstance().show(childFragmentManager,"TodayTrafficDialog")
-            }
-        }.also {
-            TodayTrafficDialog.newInstance().show(childFragmentManager,"TodayTrafficDialog")
-        }
+//        UserInfo.getUserInfo()?.let{
+//            if (!it.is_zhuanpan_every_day){
+//                TodayTrafficDialog.newInstance().show(childFragmentManager,"TodayTrafficDialog")
+//            }
+//        }.also {
+//            TodayTrafficDialog.newInstance().show(childFragmentManager,"TodayTrafficDialog")
+//        }
     }
 
     override fun initOther() {

+ 1 - 0
room/src/main/java/com/swago/room/anchor/AnchorRoomFragment.kt

@@ -227,6 +227,7 @@ class AnchorRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
     }
 
     override fun stopPK(stopPKModel: StopPKModel) {
+        pkAcceptDialog = null
     }
 
     override fun punishPK(punishPKModel: PunishPKModel, isGetDataFromIM: Boolean) {

+ 5 - 0
room/src/main/java/com/swago/room/pk/PkVm.kt

@@ -182,6 +182,11 @@ class PkVm(application: Application) : AbsMsgVm(application) {
     fun pkJoinFail(pkId: String) {
         requestData {
             ApiManager.roomApi.pkJoinFail(pkId)
+            Toast.makeText(
+                AppContext.getContext(),
+                AppContext.getContext().getString(R.string.pk_failed_re_pk),
+                Toast.LENGTH_LONG
+            ).show()
         }
     }
 

+ 1 - 1
room/src/main/res/layout/view_rewards.xml

@@ -22,7 +22,7 @@
         android:textColor="#fff"
         tools:text="0"
         android:gravity="center_horizontal"
-        android:textSize="8sp"
+        android:textSize="8dp"
         android:layout_marginTop="2dp"
         android:background="@mipmap/bg_time_reward"
         app:layout_constraintTop_toTopOf="parent"