| 1 |
<?xml version="1.0"?> |
| 2 |
<template |
| 3 |
format="5" |
| 4 |
revision="6" |
| 5 |
name="Tabbed Activity" |
| 6 |
minApi="13" |
| 7 |
minBuildApi="14" |
| 8 |
requireAppTheme="true" |
| 9 |
description="Creates a new blank activity, with an action bar and navigational elements such as tabs or horizontal swipe."> |
| 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="fragmentLayoutName" |
| 34 |
name="Fragment Layout Name" |
| 35 |
type="string" |
| 36 |
constraints="layout|unique|nonempty" |
| 37 |
suggest="fragment_${classToResource(activityClass)}" |
| 38 |
default="fragment_main" |
| 39 |
help="The name of the layout to create for the activity's content fragment" /> |
| 40 |
|
| 41 |
<parameter |
| 42 |
id="activityTitle" |
| 43 |
name="Title" |
| 44 |
type="string" |
| 45 |
constraints="nonempty" |
| 46 |
default="MainActivity" |
| 47 |
suggest="${activityClass}" |
| 48 |
help="The name of the activity. For launcher activities, the application title." /> |
| 49 |
|
| 50 |
<parameter |
| 51 |
id="menuName" |
| 52 |
name="Menu Resource Name" |
| 53 |
type="string" |
| 54 |
constraints="layout|unique|nonempty" |
| 55 |
suggest="menu_${classToResource(activityClass)}" |
| 56 |
default="menu_main" |
| 57 |
help="The name of the resource file to create for the menu items" /> |
| 58 |
|
| 59 |
<parameter |
| 60 |
id="isLauncher" |
| 61 |
name="Launcher Activity" |
| 62 |
type="boolean" |
| 63 |
default="false" |
| 64 |
help="If true, this activity will have a CATEGORY_LAUNCHER intent filter, making it visible in the launcher" /> |
| 65 |
|
| 66 |
<parameter |
| 67 |
id="parentActivityClass" |
| 68 |
name="Hierarchical Parent" |
| 69 |
type="string" |
| 70 |
constraints="activity|exists|empty" |
| 71 |
default="" |
| 72 |
help="The hierarchical parent activity, used to provide a default implementation for the 'Up' button" /> |
| 73 |
|
| 74 |
<parameter |
| 75 |
id="features" |
| 76 |
name="Navigation Style" |
| 77 |
type="enum" |
| 78 |
default="pager" |
| 79 |
help="Additional features to include, such as a fragment, swipe views, or a navigation drawer" > |
| 80 |
<option id="pager">Swipe Views (ViewPager)</option> |
| 81 |
<option id="tabs">Action Bar Tabs (with ViewPager)</option> |
| 82 |
<option id="spinner">Action Bar Spinner</option> |
| 83 |
</parameter> |
| 84 |
|
| 85 |
<parameter |
| 86 |
id="packageName" |
| 87 |
name="Package name" |
| 88 |
type="string" |
| 89 |
constraints="package" |
| 90 |
default="com.mycompany.myapp" /> |
| 91 |
|
| 92 |
<!-- 128x128 thumbnails relative to template.xml --> |
| 93 |
<thumbs> |
| 94 |
<!-- default thumbnail is required --> |
| 95 |
<thumb>template_blank_activity_pager.png</thumb> |
| 96 |
<!-- attributes act as selectors based on chosen parameters --> |
| 97 |
<thumb features="tabs">template_blank_activity_tabs.png</thumb> |
| 98 |
<thumb features="pager">template_blank_activity_pager.png</thumb> |
| 99 |
<thumb features="spinner">template_blank_activity_dropdown.png</thumb> |
| 100 |
</thumbs> |
| 101 |
|
| 102 |
<globals file="globals.xml.ftl" /> |
| 103 |
<execute file="recipe.xml.ftl" /> |
| 104 |
|
| 105 |
</template> |