Refine RootSession.Transaction.iptables

This commit is contained in:
Mygod
2019-01-24 21:11:38 +08:00
parent f60c42a54c
commit 0da1943a68
5 changed files with 22 additions and 21 deletions

View File

@@ -9,7 +9,6 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import be.mygod.vpnhotspot.App.Companion.app
import be.mygod.vpnhotspot.R
import com.google.android.material.snackbar.Snackbar
import com.topjohnwu.superuser.NoShellException
@@ -21,7 +20,7 @@ sealed class SmartSnackbar {
fun make(@StringRes text: Int): SmartSnackbar = make(app.getText(text))
fun make(text: CharSequence? = ""): SmartSnackbar {
val holder = holder
return if (holder == null) {
return if (holder == null) @SuppressLint("ShowToast") {
if (Looper.myLooper() == null) Looper.prepare()
ToastWrapper(Toast.makeText(app, text, Toast.LENGTH_LONG))
} else SnackbarWrapper(Snackbar.make(holder, text ?: null.toString(), Snackbar.LENGTH_LONG))