Skip to content

Instantly share code, notes, and snippets.

@axiel7
Last active October 15, 2023 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axiel7/f1ce53274c3a503f1a544ed0ac7b4120 to your computer and use it in GitHub Desktop.
Save axiel7/f1ce53274c3a503f1a544ed0ac7b4120 to your computer and use it in GitHub Desktop.
Compose View Android Studio code template
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}
#end
#parse("File Header.java")
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
@Composable
fun ${NAME}() {
}
@Preview
@Composable
fun ${NAME}Preview() {
${NAME}()
}
@axiel7
Copy link
Author

axiel7 commented Oct 15, 2023

A code template for easily creating new compose views, similar to the Xcode SwiftUI View template.

Put this in Settings -> Editor -> File and Code Templates -> +

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment