-
-
Save jefisu/6ec1d433c4c090b3ba0d738b296cd9ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. hiltvm (applicable in top-level) | |
@dagger.hilt.android.lifecycle.HiltViewModel | |
class $NAME$ @javax.inject.Inject constructor( | |
$PARAM$ | |
) : androidx.lifecycle.ViewModel() { | |
$END$ | |
} | |
2. hiltmodule (applicable in top-level) | |
@dagger.Module | |
@dagger.hilt.InstallIn(dagger.hilt.components.SingletonComponent::class) | |
object $NAME_MODULE$ { | |
$END$ | |
} | |
description: Creates a module hilt to dependency | |
3. hiltprov (applicable in top-level and object declaration) | |
@dagger.Provides | |
@javax.inject.Singleton | |
fun provide$FUNC$ ($PARAM$): $RETURN$ { | |
$END$ | |
} | |
description: Create a function to provide a dependency | |
4. vmstatefunc (applicable in class) | |
private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$) | |
val $NAME$: androidx.compose.runtime.State<$TYPE$> = _$NAME$ | |
fun $FUNC$($PARAM$: $TYPE$) { | |
_$NAME$.value = $PARAM$ | |
} | |
5. remstate (applicable in Kotlin except Comment) | |
var $NAME$ by androidx.compose.runtime.remember { | |
androidx.compose.runtime.mutableStateOf($INITIAL_VALUE$) | |
} | |
6. centerbox (applicable in Kotlin except Comment) | |
androidx.compose.foundation.layout.Box( | |
modifier = androidx.compose.ui.Modifier.fillMaxSize(), | |
contentAlignment = androidx.compose.ui.Alignment.Center | |
) { | |
$END$ | |
} | |
7. iconbtn (applicable in Kotlin except Comment) | |
androidx.compose.material.IconButton( | |
onClick = { | |
}, | |
) { | |
androidx.compose.material.Icon( | |
imageVector = $ICON$, | |
contentDescription = $CONTENT_DESCRIPTION$ | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment