package ${escapeKotlinIdentifiers(packageName)} import android.os.Bundle <#if createFragmentArgs> import android.os.Parcelable import kotlinx.android.parcel.Parcelize import com.airbnb.mvrx.args import android.view.View import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState import im.vector.riotx.R import im.vector.riotx.core.platform.VectorBaseFragment import javax.inject.Inject <#if createFragmentArgs> @Parcelize data class ${fragmentArgsClass}() : Parcelable //TODO: add this fragment into FragmentModule class ${fragmentClass} @Inject constructor( private val viewModelFactory: ${viewModelClass}.Factory ) : VectorBaseFragment(), ${viewModelClass}.Factory by viewModelFactory { <#if createFragmentArgs> private val fragmentArgs: ${fragmentArgsClass} by args() private val viewModel: ${viewModelClass} by fragmentViewModel() override fun getLayoutResId() = R.layout.${fragmentLayout} override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) // Initialize your view, subscribe to viewModel... } override fun onDestroyView() { super.onDestroyView() // Clear your view, unsubscribe... } override fun invalidate() = withState(viewModel) { state -> //TODO } }