<@U1DJE05QR>: I don't have an opensource example y...
# android
a
@rakshakhegde: I don't have an opensource example yet. This is how I was using BindingAdapter: 1. You need to inject DataBindingComponent via Dagger
Copy code
@Component(modules = BindingModule.class)
public interface BindingComponent extends DataBindingComponent {
}
DataBindingUtil.setDefaultComponent(DaggerBindingComponent.builder().build())
2. Write your BindingAdapter as extension function on android view:
Copy code
@BindingAdapter("bind:font")
fun TextView.setFont(fontName: String) {
    val baseContext = context.applicationContext as BaseContext
    val typeface = baseContext.applicationComponent.typefaceProvider().getTypeface(fontName)
    setTypeface(typeface)
}
3. Put font into
assets
folder and define paths
Copy code
fonts.xml
 <string name="font_path_freight_text_lfpro_book">fonts/freight_text_lfpro_book.ttf</string>
4. Use it on your view
Copy code
<TextView
                android:id="@+id/tv_section"
                style="@style/TextStyle.Kicker"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:ellipsize="end"
                android:lines="1"
                android:text="@{viewModel.section}"
                android:textAllCaps="true"
                app:font="@{@string/font_path_freight_text_lfpro_book}"
                tools:text="Text" />