| 1 |
<?xml version="1.0"?> |
| 2 |
<template |
| 3 |
format="5" |
| 4 |
revision="6" |
| 5 |
name="Basic Activity" |
| 6 |
minApi="9" |
| 7 |
minBuildApi="14" |
| 8 |
requireAppTheme="true" |
| 9 |
description="Creates a new basic activity with an app bar."> |
| 10 |
|
| 11 |
<category value="Activity"/> |
| 12 |
<formfactor value="Mobile"/> |
| 13 |
|
| 14 |
<parameter |
| 15 |
id="activityClass" |
| 16 |
name="Activity Name" |
| 17 |
type="string" |
| 18 |
constraints="class|unique|nonempty" |
| 19 |
suggest="${layoutToActivity(layoutName)}" |
| 20 |
default="MainActivity" |
| 21 |
help="The name of the activity class to create"/> |
| 22 |
|
| 23 |
<parameter |
| 24 |
id="layoutName" |
| 25 |
name="Layout Name" |
| 26 |
type="string" |
| 27 |
constraints="layout|unique|nonempty" |
| 28 |
suggest="${activityToLayout(activityClass)}" |
| 29 |
default="activity_main" |
| 30 |
help="The name of the layout to create for the activity"/> |
| 31 |
|
| 32 |
<parameter |
| 33 |
id="activityTitle" |
| 34 |
name="Title" |
| 35 |
type="string" |
| 36 |
constraints="nonempty" |
| 37 |
default="MainActivity" |
| 38 |
suggest="${activityClass}" |
| 39 |
help="The name of the activity. For launcher activities, the application title."/> |
| 40 |
|
| 41 |
<parameter |
| 42 |
id="menuName" |
| 43 |
name="Menu Resource Name" |
| 44 |
type="string" |
| 45 |
constraints="layout|unique|nonempty" |
| 46 |
suggest="menu_${classToResource(activityClass)}" |
| 47 |
visibility="isNewProject!false" |
| 48 |
default="menu_main" |
| 49 |
help="The name of the resource file to create for the menu items"/> |
| 50 |
|
| 51 |
<parameter |
| 52 |
id="isLauncher" |
| 53 |
name="Launcher Activity" |
| 54 |
type="boolean" |
| 55 |
default="false" |
| 56 |
help="If true, this activity will have a CATEGORY_LAUNCHER intent filter, making it visible in the launcher"/> |
| 57 |
|
| 58 |
<parameter |
| 59 |
id="useFragment" |
| 60 |
name="Use a Fragment" |
| 61 |
type="boolean" |
| 62 |
default="false" |
| 63 |
help="If true, the content will be a fragment"/> |
| 64 |
|
| 65 |
<parameter |
| 66 |
id="contentLayoutName" |
| 67 |
name="Content Layout Name" |
| 68 |
type="string" |
| 69 |
constraints="layout|unique" |
| 70 |
suggest="${activityToLayout(activityClass, 'content')}" |
| 71 |
default="content_main" |
| 72 |
visibility="false" |
| 73 |
help="The name of the App Bar layout to create for the activity"/> |
| 74 |
|
| 75 |
<parameter |
| 76 |
id="parentActivityClass" |
| 77 |
name="Hierarchical Parent" |
| 78 |
type="string" |
| 79 |
constraints="activity|exists|empty" |
| 80 |
default="" |
| 81 |
help="The hierarchical parent activity, used to provide a default implementation for the 'Up' button"/> |
| 82 |
|
| 83 |
<parameter |
| 84 |
id="fragmentLayoutName" |
| 85 |
name="Fragment Layout Name" |
| 86 |
type="string" |
| 87 |
constraints="layout|unique|nonempty" |
| 88 |
suggest="${activityToLayout(activityClass, 'fragment')}" |
| 89 |
default="fragment_main" |
| 90 |
visibility="false" |
| 91 |
help="The name of the layout to create for the activity's content fragment"/> |
| 92 |
|
| 93 |
<parameter |
| 94 |
id="packageName" |
| 95 |
name="Package name" |
| 96 |
type="string" |
| 97 |
constraints="package" |
| 98 |
default="com.mycompany.myapp"/> |
| 99 |
|
| 100 |
<!-- 128x128 thumbnails relative to template.xml --> |
| 101 |
<thumbs> |
| 102 |
<!-- default thumbnail is required --> |
| 103 |
<thumb>template_basic_activity.png</thumb> |
| 104 |
<!-- attributes act as selectors based on chosen parameters --> |
| 105 |
<thumb useFragment="true">template_basic_activity_fragment.png</thumb> |
| 106 |
</thumbs> |
| 107 |
|
| 108 |
<globals file="globals.xml.ftl"/> |
| 109 |
<execute file="recipe.xml.ftl"/> |
| 110 |
|
| 111 |
</template> |