|
|
@@ -11,32 +11,31 @@ import com.adealink.frame.util.runOnUiThread
|
|
|
import com.adealink.weparty.BuildConfig
|
|
|
import com.adealink.weparty.R
|
|
|
import com.adealink.weparty.commonui.toast.ToastCompat
|
|
|
+import io.trtc.tuikit.atomicx.widget.basicwidget.toast.AtomicToast
|
|
|
+import io.trtc.tuikit.atomicx.widget.basicwidget.toast.AtomicToast.Duration
|
|
|
|
|
|
fun showToast(text: CharSequence) {
|
|
|
- showToast(text, 0)
|
|
|
+ showToast(text, Toast.LENGTH_SHORT)
|
|
|
}
|
|
|
|
|
|
fun showToast(text: CharSequence, duration: Int) {
|
|
|
runOnUiThread {
|
|
|
- if (ToastCompat.isToastEnabled()) {
|
|
|
- ToastCompat.makeText(AppUtil.appContext, text, duration).show()
|
|
|
- } else {
|
|
|
- ToastCompat.show(text, duration)
|
|
|
- }
|
|
|
+ AtomicToast.show(AppUtil.appContext, text = text.toString(), position = AtomicToast.Position.CENTER, duration = Duration.map(duration))
|
|
|
+// if (ToastCompat.isToastEnabled()) {
|
|
|
+// ToastCompat.makeText(AppUtil.appContext, text, duration).show()
|
|
|
+// } else {
|
|
|
+// ToastCompat.show(text, duration)
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
fun showToast(@StringRes resId: Int) {
|
|
|
- showToast(resId, 0)
|
|
|
+ showToast(resId, Toast.LENGTH_SHORT)
|
|
|
}
|
|
|
|
|
|
fun showToast(@StringRes resId: Int, duration: Int) {
|
|
|
runOnUiThread {
|
|
|
- if (ToastCompat.isToastEnabled()) {
|
|
|
- ToastCompat.makeText(AppUtil.appContext, resId, duration).show()
|
|
|
- } else {
|
|
|
- ToastCompat.show(getCompatString(resId), duration)
|
|
|
- }
|
|
|
+ showToast(getCompatString(resId), duration)
|
|
|
}
|
|
|
}
|
|
|
|