BindingAdapters: Create an adapter for textStyle

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Samuel Holland 2017-08-16 04:30:42 -05:00
parent eb43e49a95
commit a5e2c1c1b3

View File

@ -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.
}