Skip to content

Instantly share code, notes, and snippets.

@ktvipin27
Created May 29, 2020 05:48
Show Gist options
  • Save ktvipin27/3c4327da4a36af1ad9387dc72181643f to your computer and use it in GitHub Desktop.
Save ktvipin27/3c4327da4a36af1ad9387dc72181643f to your computer and use it in GitHub Desktop.
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