Structure
Class layout
class LoginFragment : BaseFragment {
// 1. Property declarations
private val viewModel by viewModels<LoginViewModel>()
// 2. Initializer block
init {
contentRes = R.layout.fragment_login
toolbarTitle = R.string.text_login_with
}
// 3. Secondary constructor
// 4. Overridden methods
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
// 5. Class methods
fun fetchMyLocationWithPermissionCheck() { }
// 6. Companion object
companion object { }
}Last updated
Was this helpful?