Selaa lähdekoodia

feat: delete toastutils

tongmengxiao 6 kuukautta sitten
vanhempi
commit
bed8a4cbab

+ 6 - 2
room/src/main/java/com/swago/room/dialog/SendMsgDialog.kt

@@ -5,6 +5,7 @@ import android.text.Editable
 import android.text.TextWatcher
 import android.view.Gravity
 import android.view.View
+import android.widget.Toast
 import androidx.constraintlayout.widget.ConstraintLayout
 import androidx.core.content.ContextCompat
 import androidx.fragment.app.viewModels
@@ -22,7 +23,6 @@ import com.swago.room.util.IMSender
 import com.swago.room.vm.RoomOtherVm
 import com.tencent.imsdk.v2.V2TIMMessage
 import com.tencent.imsdk.v2.V2TIMValueCallback
-import com.tencent.qcloud.tim.uikit.utils.ToastUtil
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.launch
 import org.json.JSONObject
@@ -189,7 +189,11 @@ class SendMsgDialog : BaseXDFragment<DialogSendMsgBinding>() {
 
                                         override fun onError(code: Int, desc: String?) {
                                             if (code == 10016){
-                                                ToastUtil.toastShortMessage(AppContext.getContext().getString(R.string.you_been_banned))
+                                                Toast.makeText(
+                                                    AppContext.getContext(),
+                                                    AppContext.getContext().resources.getString(R.string.you_been_banned),
+                                                    Toast.LENGTH_SHORT
+                                                ).show()
                                             }
 
                                         }

+ 6 - 2
user/src/main/java/com/swago/user/store/StoreBuyDialog.kt

@@ -3,6 +3,7 @@ package com.swago.user.store
 import android.os.Bundle
 import android.view.Gravity
 import android.view.View
+import android.widget.Toast
 import androidx.activity.viewModels
 import androidx.fragment.app.viewModels
 import com.opensource.svgaplayer.SVGADrawable
@@ -16,7 +17,6 @@ import com.swago.loadUrl
 import com.swago.user.R
 import com.swago.user.databinding.DialogStoreDetailBinding
 import com.swago.user.vm.StoreVm
-import com.tencent.qcloud.tim.uikit.utils.ToastUtil
 import java.io.File
 import java.net.URL
 
@@ -81,7 +81,11 @@ class StoreBuyDialog : BaseXDFragment<DialogStoreDetailBinding>(){
             override fun onClick() {
                 storeBean?.let {
                     if (it.product_status ==1){
-                        ToastUtil.toastShortMessage(getString(R.string.this_product_has_been_purchased))
+                        Toast.makeText(
+                            AppContext.getContext(),
+                            AppContext.getContext().resources.getString(R.string.this_product_has_been_purchased),
+                            Toast.LENGTH_SHORT
+                        ).show()
                         return@let
                     }
                     storeVm.buyProduct(it.id)

+ 0 - 1
user/src/main/java/com/swago/user/store/StoreListActivity.kt

@@ -19,7 +19,6 @@ import com.swago.user.R
 import com.swago.user.databinding.ActivityStoreListBinding
 import com.swago.user.vm.StoreVm
 import com.swago.user.vm.TaskVm
-import com.tencent.qcloud.tim.uikit.utils.ToastUtil
 import com.zy.multistatepage.state.EmptyState
 import java.util.concurrent.CopyOnWriteArrayList
 

+ 5 - 2
user/src/main/java/com/swago/user/vm/StoreVm.kt

@@ -11,7 +11,6 @@ import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.BaseViewModel
 import com.swago.baseswago.util.SwagoLoading
 import com.swago.user.R
-import com.tencent.qcloud.tim.uikit.utils.ToastUtil
 
 class StoreVm(application: Application) : BaseViewModel(application){
 
@@ -35,7 +34,11 @@ class StoreVm(application: Application) : BaseViewModel(application){
         requestData2 {
             requestData {
                 ApiManager.userApi.buyProduct(productId)
-                ToastUtil.toastShortMessage(AppContext.getContext().getString(R.string.purchase_successful))
+                Toast.makeText(
+                    AppContext.getContext(),
+                    AppContext.getContext().resources.getString(R.string.purchase_successful),
+                    Toast.LENGTH_SHORT
+                ).show()
             }
 
         }