summaryrefslogtreecommitdiffhomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-22 00:15:58 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-22 00:19:09 -0600
commitcf25ae444860317dc24746424818cc1bc555ba97 (patch)
treed14710c412e1c87aace8326e487654f32b1c893b /ui
parente86182af56529d86299a6409c61e0d83cec2a372 (diff)
model: begin conversion
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/src/main/java/com/wireguard/android/model/ApplicationData.java57
-rw-r--r--ui/src/main/java/com/wireguard/android/model/ApplicationData.kt24
2 files changed, 24 insertions, 57 deletions
diff --git a/ui/src/main/java/com/wireguard/android/model/ApplicationData.java b/ui/src/main/java/com/wireguard/android/model/ApplicationData.java
deleted file mode 100644
index f289f53d..00000000
--- a/ui/src/main/java/com/wireguard/android/model/ApplicationData.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright © 2017-2019 WireGuard LLC. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package com.wireguard.android.model;
-
-import android.graphics.drawable.Drawable;
-
-import com.wireguard.android.BR;
-import com.wireguard.util.Keyed;
-import com.wireguard.util.NonNullForAll;
-
-import androidx.databinding.BaseObservable;
-import androidx.databinding.Bindable;
-
-@NonNullForAll
-public class ApplicationData extends BaseObservable implements Keyed<String> {
- private final Drawable icon;
- private final String name;
- private final String packageName;
- private boolean excludedFromTunnel;
-
- public ApplicationData(final Drawable icon, final String name, final String packageName, final boolean excludedFromTunnel) {
- this.icon = icon;
- this.name = name;
- this.packageName = packageName;
- this.excludedFromTunnel = excludedFromTunnel;
- }
-
- public Drawable getIcon() {
- return icon;
- }
-
- @Override
- public String getKey() {
- return name;
- }
-
- public String getName() {
- return name;
- }
-
- public String getPackageName() {
- return packageName;
- }
-
- @Bindable
- public boolean isExcludedFromTunnel() {
- return excludedFromTunnel;
- }
-
- public void setExcludedFromTunnel(final boolean excludedFromTunnel) {
- this.excludedFromTunnel = excludedFromTunnel;
- notifyPropertyChanged(BR.excludedFromTunnel);
- }
-}
diff --git a/ui/src/main/java/com/wireguard/android/model/ApplicationData.kt b/ui/src/main/java/com/wireguard/android/model/ApplicationData.kt
new file mode 100644
index 00000000..8d4708fd
--- /dev/null
+++ b/ui/src/main/java/com/wireguard/android/model/ApplicationData.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright © 2017-2019 WireGuard LLC. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ */
+package com.wireguard.android.model
+
+import android.graphics.drawable.Drawable
+import androidx.databinding.BaseObservable
+import androidx.databinding.Bindable
+import com.wireguard.android.BR
+import com.wireguard.util.Keyed
+
+class ApplicationData(val icon: Drawable, val name: String, val packageName: String, isExcludedFromTunnel : Boolean) : BaseObservable(), Keyed<String> {
+ override fun getKey(): String {
+ return name
+ }
+
+ @get:Bindable
+ var isExcludedFromTunnel = isExcludedFromTunnel
+ set(value) {
+ field = value
+ notifyPropertyChanged(BR.excludedFromTunnel)
+ }
+}