diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-20 23:36:00 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-21 03:06:56 -0600 |
commit | 902a1ce46e88ed9ae552e68961e19ce156b17ccf (patch) | |
tree | 504c434b758c5def5c3eb89ff94690fa5e3555dc /ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt | |
parent | Replace PermissionRequestCallback with direct methods (diff) | |
download | wireguard-android-902a1ce46e88ed9ae552e68961e19ce156b17ccf.tar.xz wireguard-android-902a1ce46e88ed9ae552e68961e19ce156b17ccf.zip |
viewmodel: port to kotlin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt index 387d0962..b6f3043b 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt @@ -83,7 +83,7 @@ class TunnelEditorFragment : BaseFragment(), AppExclusionListener { override fun onExcludedAppsSelected(excludedApps: List<String>) { requireNotNull(binding) { "Tried to set excluded apps while no view was loaded" } - binding!!.config!!.getInterface().excludedApplications.apply { + binding!!.config!!.`interface`.excludedApplications.apply { clear() addAll(excludedApps) } @@ -125,12 +125,12 @@ class TunnelEditorFragment : BaseFragment(), AppExclusionListener { tunnel == null -> { Log.d(TAG, "Attempting to create new tunnel " + binding!!.name) val manager = Application.getTunnelManager() - manager.create(binding!!.name, newConfig) + manager.create(binding!!.name!!, newConfig) .whenComplete(this::onTunnelCreated) } tunnel!!.name != binding!!.name -> { Log.d(TAG, "Attempting to rename tunnel to " + binding!!.name) - tunnel!!.setName(binding!!.name) + tunnel!!.setName(binding!!.name!!) .whenComplete { _, t -> onTunnelRenamed(tunnel!!, newConfig, t) } } else -> { @@ -147,7 +147,7 @@ class TunnelEditorFragment : BaseFragment(), AppExclusionListener { @Suppress("UNUSED_PARAMETER") fun onRequestSetExcludedApplications(view: View?) { if (binding != null) { - val excludedApps = ArrayList(binding!!.config!!.getInterface().excludedApplications) + val excludedApps = ArrayList(binding!!.config!!.`interface`.excludedApplications) val fragment = AppListDialogFragment.newInstance(excludedApps, this) fragment.show(parentFragmentManager, null) } |