Settings->Editor->Live Templates
1 hiltvm
(applicable in top-level)
1
2
3
4
5
6
| @dagger.hilt.android.lifecycle.HiltViewModel
class $NAME$ @javax.inject.Inject constructor(
$PARAM$
) : androidx.lifecycle.ViewModel() {
$END$
}
|
2 vmstate
(applicable in class)
1
2
| private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$)
val $NAME$: androidx.compose.runtime.State<$TYPE$> = _$NAME$
|
3 vmflow
(applicable in class)
1
2
| private val _$NAME$ = kotlinx.coroutines.flow.MutableStateFlow<$TYPE$>($INITIAL_VALUE$)
val $NAME$ = _$NAME$.asStateFlow()
|
4 vmsharedflow
(applicable in class)
1
2
| private val _$NAME$ = kotlinx.coroutines.flow.MutableSharedFlow<$TYPE$>()
val $NAME$ = _$NAME$.asSharedFlow()
|
1
2
3
| var $NAME$ by androidx.compose.runtime.remember {
androidx.compose.runtime.mutableStateOf($INITIAL_VALUE$)
}
|
1
2
3
4
5
6
| androidx.compose.foundation.layout.Box(
modifier = androidx.compose.ui.Modifier.fillMaxSize(),
contentAlignment = androidx.compose.ui.Alignment.Center
) {
$END$
}
|
1
2
3
4
5
6
7
8
9
10
| androidx.compose.material.IconButton(
onClick = {
},
) {
androidx.compose.material.Icon(
imageVector = $ICON$,
contentDescription = $CONTENT_DESCRIPTION$
)
}
|
1
| modifier = androidx.compose.ui.Modifier.$PARAM$
|
Make the PARAM complete().
1
| EDIT VARIABLES -> Expression complete()
|