summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-08-16 04:30:42 -0500
committerSamuel Holland <samuel@sholland.org>2017-08-16 04:30:42 -0500
commita5e2c1c1b3bea5606dd550cf3f14c09c428fafee (patch)
treef0ed2f8fedb989fdf17c4d2e7ae2ab398ab8f7c2 /app
parenteb43e49a95080ecfae63a5e57bbda3e078989bfb (diff)
BindingAdapters: Create an adapter for textStyle
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/com/wireguard/android/BindingAdapters.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/BindingAdapters.java b/app/src/main/java/com/wireguard/android/BindingAdapters.java
index 6cd4a70f..756b38a3 100644
--- a/app/src/main/java/com/wireguard/android/BindingAdapters.java
+++ b/app/src/main/java/com/wireguard/android/BindingAdapters.java
@@ -3,7 +3,10 @@ package com.wireguard.android;
import android.databinding.BindingAdapter;
import android.databinding.ObservableArrayMap;
import android.databinding.ObservableList;
+import android.graphics.Typeface;
+import android.widget.EditText;
import android.widget.ListView;
+import android.widget.TextView;
/**
* Static methods for use by generated code in the Android data binding library.
@@ -64,6 +67,11 @@ public final class BindingAdapters {
}
}
+ @BindingAdapter({"android:textStyle"})
+ public static void textStyleBinding(final TextView view, final Typeface typeface) {
+ view.setTypeface(typeface);
+ }
+
private BindingAdapters() {
// Prevent instantiation.
}