diff options
Diffstat (limited to 'templates/activities')
-rw-r--r-- | templates/activities/BlankActivity/recipe.xml.ftl | 4 | ||||
-rw-r--r-- | templates/activities/BlankActivity/root/res/layout/activity_simple.xml | 8 | ||||
-rw-r--r-- | templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl | 15 | ||||
-rw-r--r-- | templates/activities/BlankActivity/root/res/menu/main.xml.ftl (renamed from templates/activities/BlankActivity/root/res/menu/main.xml) | 4 | ||||
-rw-r--r-- | templates/activities/BlankActivity/template.xml | 8 | ||||
-rw-r--r-- | templates/activities/MasterDetailFlow/template.xml | 1 |
6 files changed, 24 insertions, 16 deletions
diff --git a/templates/activities/BlankActivity/recipe.xml.ftl b/templates/activities/BlankActivity/recipe.xml.ftl index a6d0ce9..6c0dc6a 100644 --- a/templates/activities/BlankActivity/recipe.xml.ftl +++ b/templates/activities/BlankActivity/recipe.xml.ftl @@ -6,7 +6,7 @@ <copy from="res/drawable-mdpi" /> <copy from="res/drawable-xhdpi" /> - <copy from="res/menu/main.xml" + <instantiate from="res/menu/main.xml.ftl" to="res/menu/${menuName}.xml" /> <merge from="res/values/dimens.xml" /> @@ -23,7 +23,7 @@ to="res/layout/${layoutName}.xml" /> <#else> - <instantiate from="res/layout/activity_simple.xml" + <instantiate from="res/layout/activity_simple.xml.ftl" to="res/layout/${layoutName}.xml" /> </#if> diff --git a/templates/activities/BlankActivity/root/res/layout/activity_simple.xml b/templates/activities/BlankActivity/root/res/layout/activity_simple.xml deleted file mode 100644 index aa34ee3..0000000 --- a/templates/activities/BlankActivity/root/res/layout/activity_simple.xml +++ /dev/null @@ -1,8 +0,0 @@ -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center" - android:text="@string/hello_world" - android:padding="@dimen/padding_medium" - tools:context=".${activityClass}" /> diff --git a/templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl b/templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl new file mode 100644 index 0000000..457c0bf --- /dev/null +++ b/templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl @@ -0,0 +1,15 @@ +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width=<#if buildApi lt 8 >"fill_parent"<#else>"match_parent"</#if> + android:layout_height=<#if buildApi lt 8 >"fill_parent"<#else>"match_parent"</#if> > + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_centerVertical="true" + android:padding="@dimen/padding_medium" + android:text="@string/hello_world" + tools:context=".${activityClass}" /> + +</RelativeLayout> diff --git a/templates/activities/BlankActivity/root/res/menu/main.xml b/templates/activities/BlankActivity/root/res/menu/main.xml.ftl index cfc10fd..41bdfee 100644 --- a/templates/activities/BlankActivity/root/res/menu/main.xml +++ b/templates/activities/BlankActivity/root/res/menu/main.xml.ftl @@ -1,6 +1,6 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_settings" android:title="@string/menu_settings" - android:orderInCategory="100" - android:showAsAction="never" /> + android:orderInCategory="100"<#if buildApi gte 11> + android:showAsAction="never"</#if> /> </menu> diff --git a/templates/activities/BlankActivity/template.xml b/templates/activities/BlankActivity/template.xml index bce675d..00b8fb4 100644 --- a/templates/activities/BlankActivity/template.xml +++ b/templates/activities/BlankActivity/template.xml @@ -33,10 +33,10 @@ default="none" help="The type of navigation to use for the activity" > <option id="none" default="true">None</option> - <option id="tabs">Tabs</option> - <option id="tabs_pager">Tabs + Swipe</option> - <option id="pager_strip">Swipe Views + Title Strip</option> - <option id="dropdown">Dropdown</option> + <option id="tabs" minApi="14">Tabs</option> + <option id="tabs_pager" minApi="14">Tabs + Swipe</option> + <option id="pager_strip" minApi="14">Swipe Views + Title Strip</option> + <option id="dropdown" minApi="14">Dropdown</option> </parameter> <parameter diff --git a/templates/activities/MasterDetailFlow/template.xml b/templates/activities/MasterDetailFlow/template.xml index 05ddb68..70a3995 100644 --- a/templates/activities/MasterDetailFlow/template.xml +++ b/templates/activities/MasterDetailFlow/template.xml @@ -3,6 +3,7 @@ format="1" revision="1" name="New Master/Detail Flow" + minApi="11" description="Creates a new master/detail flow, which is two columns on tablets, and one column on smaller screens. This creates a master fragment, detail fragment, and two activities."> <dependency name="android-support-v4" revision="8" /> |