ui: refactor AddTunnelsSheet's selection communication

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya
2020-09-17 19:36:44 +05:30
parent e99ccf9013
commit 306d0648c6
3 changed files with 43 additions and 42 deletions
@@ -8,7 +8,6 @@ package com.wireguard.android.util
import android.content.Context
import android.util.TypedValue
import androidx.annotation.AttrRes
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import com.wireguard.android.Application
@@ -21,10 +20,6 @@ fun Context.resolveAttribute(@AttrRes attrRes: Int): Int {
return typedValue.data
}
fun Fragment.requireTargetFragment(): Fragment {
return requireNotNull(targetFragment) { "A target fragment should always be set for $this" }
}
val Any.applicationScope: CoroutineScope
get() = Application.getCoroutineScope()