summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android/util
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-02-14 15:27:17 +0530
committerGitHub <noreply@github.com>2020-02-14 15:27:17 +0530
commit02ea696070aea1cdf0b71af0639499f87196ec8c (patch)
tree39ea7eb8c9cc2daded826d782cda1bf04c0ffee7 /app/src/main/java/com/wireguard/android/util
parentd25702d99ded6946608713e670c6a6ce323f8f87 (diff)
Port tunnel creation UI from Viscerion
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/util')
-rw-r--r--app/src/main/java/com/wireguard/android/util/Extensions.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/util/Extensions.kt b/app/src/main/java/com/wireguard/android/util/Extensions.kt
new file mode 100644
index 00000000..6b528a85
--- /dev/null
+++ b/app/src/main/java/com/wireguard/android/util/Extensions.kt
@@ -0,0 +1,16 @@
+/*
+ * Copyright © 2020 WireGuard LLC. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package com.wireguard.android.util
+
+import android.content.Context
+import android.util.TypedValue
+import androidx.annotation.AttrRes
+
+fun Context.resolveAttribute(@AttrRes attrRes: Int): Int {
+ val typedValue = TypedValue()
+ theme.resolveAttribute(attrRes, typedValue, true)
+ return typedValue.data
+}