@JvmStatic
when creating newInstance
of fragment - only needed for java codeR.string
in ViewModel classandroid:text="@{`Hello ` + user.firstName}"/>
android:text= "@{@string/Generic_Text(Profile.name)}"
string should be like this:
<string name="Generic_Text">My Name is %s</string>
AutoClearedValue
DataBindingUtil.setDefaultComponent(BindingComponent())
DataBindingUtil.inflate(
inflater,
R.layout.,
container,
false, BindingComponent())
private fun navigateToFragment(fragmentInstance: () -> Fragment) {
supportFragmentManager.beginTransaction()
.replace(R.id.main_container, fragmentInstance())
.addToBackStack(null)
.commit()
}
config.gradle
file)