@JvmStatic
when creatingnewInstance
of fragment - only needed for java code- Right way to get
R.string
in ViewModel class
- Data Binding
- ViewModel
- LiveData
- LeakCanary
- Floating Action Button with Speed Dial. See #14 for more information
-
- concat two strings
android:text="@{`Hello ` + user.firstName}"/>
string should be like this:android:text= "@{@string/Generic_Text(Profile.name)}"
<string name="Generic_Text">My Name is %s</string>
- bind viewmodel to fragment using
AutoClearedValue
- Bind to spinner
- BindingComponent
- set globally
DataBindingUtil.setDefaultComponent(BindingComponent())
- only for one layout
DataBindingUtil.inflate( inflater, R.layout., container, false, BindingComponent())
- concat two strings
-
- navigation to fragment
private fun navigateToFragment(fragmentInstance: () -> Fragment) { supportFragmentManager.beginTransaction() .replace(R.id.main_container, fragmentInstance()) .addToBackStack(null) .commit() }
-
- Manage Android dependencies versions using gradle extra properties (can be also done using
config.gradle
file)
- Manage Android dependencies versions using gradle extra properties (can be also done using
-