Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample template.xml file
<?xml version="1.0"?>
<template
format="5"
revision="5"
name="App Activity"
minApi="21"
minBuildApi="21"
description="Creates a new app activity">
<category value="Activity" />
<formfactor value="Mobile" />
<parameter
id="activityClass"
name="Activity Name"
type="string"
constraints="class|unique|nonempty"
suggest="${layoutToActivity(layoutName)}"
default="MainActivity"
help="The name of the activity class to create" />
<parameter
id="layoutName"
name="Layout Name"
type="string"
constraints="layout|unique|nonempty"
suggest="${activityToLayout(activityClass)}"
default="activity_main"
help="The name of the layout to create for the activity" />
<parameter
id="viewModelClass"
name="ViewModel Name"
type="string"
constraints="class|unique|nonempty"
suggest="${underscoreToCamelCase(classToResource(activityClass))}ViewModel"
help="The name of the view model class to create" />
<parameter
id="packageName"
name="Package name"
type="string"
constraints="package"
default="com.mycompany.myapp" />
<parameter
id="activityTitle"
name="Activity Title"
type="string"
suggest="${underscoreToCamelCase(classToResource(activityClass))}"
help="Title of the new activity" />
<globals file="globals.xml.ftl" />
<execute file="recipe.xml.ftl" />
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment