From 02ea696070aea1cdf0b71af0639499f87196ec8c Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 14 Feb 2020 15:27:17 +0530 Subject: Port tunnel creation UI from Viscerion Signed-off-by: Jason A. Donenfeld --- .../main/java/com/wireguard/android/util/Extensions.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/src/main/java/com/wireguard/android/util/Extensions.kt (limited to 'app/src/main/java/com/wireguard/android/util') 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 +} -- cgit v1.2.3