From a5e2c1c1b3bea5606dd550cf3f14c09c428fafee Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 16 Aug 2017 04:30:42 -0500 Subject: [PATCH] BindingAdapters: Create an adapter for textStyle Signed-off-by: Jason A. Donenfeld --- .../main/java/com/wireguard/android/BindingAdapters.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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. }