aboutsummaryrefslogtreecommitdiffstats
path: root/templates/activities
diff options
context:
space:
mode:
authorRoman Nurik <romannurik@google.com>2012-07-27 09:16:47 -0700
committerRoman Nurik <romannurik@google.com>2012-07-27 09:32:25 -0700
commit0c11d54033271032bbe2be111cc0c208f8036252 (patch)
treed985b4aaf256d195c246ef97cf49773148ee93fe /templates/activities
parent3d1fd6f05a58463a8d56f7ba374240a093a061d0 (diff)
downloadsdk-0c11d54033271032bbe2be111cc0c208f8036252.zip
sdk-0c11d54033271032bbe2be111cc0c208f8036252.tar.gz
sdk-0c11d54033271032bbe2be111cc0c208f8036252.tar.bz2
Settings activity template.
This adds an activity template for Settings. The template comes with a bunch of example preferences for common things like notifications and sync frequency, while highlighting design best practices such as binding summaries to setting values, hiding extraneous buttons in dialog preferences, and even showing a two-pane UI on tablet devices. Future work should further improve on this by using the modern fragment-based PreferenceActivity APIs on all API 11+ devices, not just tablets. With this change, template code would become pretty complex, so I punted on it for now. Change-Id: I8f18fce4a00193c2878d5a94c12f5ad4ee81ce8d
Diffstat (limited to 'templates/activities')
-rw-r--r--templates/activities/SettingsActivity/globals.xml.ftl5
-rw-r--r--templates/activities/SettingsActivity/recipe.xml.ftl14
-rw-r--r--templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl14
-rw-r--r--templates/activities/SettingsActivity/root/res/values/strings.xml.ftl59
-rw-r--r--templates/activities/SettingsActivity/root/res/xml/pref_data_sync.xml21
-rw-r--r--templates/activities/SettingsActivity/root/res/xml/pref_general.xml33
-rw-r--r--templates/activities/SettingsActivity/root/res/xml/pref_headers.xml17
-rw-r--r--templates/activities/SettingsActivity/root/res/xml/pref_notification.xml27
-rw-r--r--templates/activities/SettingsActivity/root/src/app_package/SettingsActivity.java.ftl295
-rw-r--r--templates/activities/SettingsActivity/template.xml53
-rw-r--r--templates/activities/SettingsActivity/template_settings_activity.pngbin0 -> 6260 bytes
11 files changed, 538 insertions, 0 deletions
diff --git a/templates/activities/SettingsActivity/globals.xml.ftl b/templates/activities/SettingsActivity/globals.xml.ftl
new file mode 100644
index 0000000..a416d3a
--- /dev/null
+++ b/templates/activities/SettingsActivity/globals.xml.ftl
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<globals>
+ <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
+ <global id="simpleName" value="${activityToLayout(activityClass)}" />
+</globals>
diff --git a/templates/activities/SettingsActivity/recipe.xml.ftl b/templates/activities/SettingsActivity/recipe.xml.ftl
new file mode 100644
index 0000000..bb5b709
--- /dev/null
+++ b/templates/activities/SettingsActivity/recipe.xml.ftl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<recipe>
+ <merge from="AndroidManifest.xml.ftl" />
+
+ <copy from="res/xml" />
+
+ <instantiate from="res/values/strings.xml.ftl"
+ to="res/values/strings_${simpleName}.xml" />
+
+ <instantiate from="src/app_package/SettingsActivity.java.ftl"
+ to="${srcOut}/${activityClass}.java" />
+
+ <open file="${srcOut}/${activityClass}.java" />
+</recipe>
diff --git a/templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl b/templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl
new file mode 100644
index 0000000..7f2efb8
--- /dev/null
+++ b/templates/activities/SettingsActivity/root/AndroidManifest.xml.ftl
@@ -0,0 +1,14 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
+
+ <application>
+ <activity android:name=".${activityClass}"
+ android:label="@string/title_${simpleName}"
+ <#if buildApi gte 16 && parentActivityClass != "">android:parentActivityName="${parentActivityClass}"</#if>>
+ <#if parentActivityClass != "">
+ <meta-data android:name="android.support.PARENT_ACTIVITY"
+ android:value="${parentActivityClass}" />
+ </#if>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/templates/activities/SettingsActivity/root/res/values/strings.xml.ftl b/templates/activities/SettingsActivity/root/res/values/strings.xml.ftl
new file mode 100644
index 0000000..164c24f
--- /dev/null
+++ b/templates/activities/SettingsActivity/root/res/values/strings.xml.ftl
@@ -0,0 +1,59 @@
+<resources>
+ <string name="title_${simpleName}">${activityTitle}</string>
+
+ <!-- Strings related to Settings -->
+
+ <!-- Example General settings -->
+ <string name="pref_header_general">General</string>
+
+ <string name="pref_title_social_recommendations">Enable social recommendations</string>
+ <string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>
+
+ <string name="pref_title_display_name">Display name</string>
+ <string name="pref_default_display_name">John Smith</string>
+
+ <string name="pref_title_add_friends_to_messages">Add friends to messages</string>
+ <string-array name="pref_example_list_titles">
+ <item>Always</item>
+ <item>When possible</item>
+ <item>Never</item>
+ </string-array>
+ <string-array name="pref_example_list_values">
+ <item>1</item>
+ <item>0</item>
+ <item>-1</item>
+ </string-array>
+
+ <!-- Example settings for Data & Sync -->
+ <string name="pref_header_data_sync">Data &amp; sync</string>
+
+ <string name="pref_title_sync_frequency">Sync frequency</string>
+ <string-array name="pref_sync_frequency_titles">
+ <item>15 minutes</item>
+ <item>30 minutes</item>
+ <item>1 hour</item>
+ <item>3 hours</item>
+ <item>6 hours</item>
+ <item>Never</item>
+ </string-array>
+ <string-array name="pref_sync_frequency_values">
+ <item>15</item>
+ <item>30</item>
+ <item>60</item>
+ <item>180</item>
+ <item>360</item>
+ <item>-1</item>
+ </string-array>
+
+ <string name="pref_title_system_sync_settings">System sync settings</string>
+
+ <!-- Example settings for Notifications -->
+ <string name="pref_header_notifications">Notifications</string>
+
+ <string name="pref_title_new_message_notifications">New message notifications</string>
+
+ <string name="pref_title_ringtone">Ringtone</string>
+ <string name="pref_ringtone_silent">Silent</string>
+
+ <string name="pref_title_vibrate">Vibrate</string>
+</resources>
diff --git a/templates/activities/SettingsActivity/root/res/xml/pref_data_sync.xml b/templates/activities/SettingsActivity/root/res/xml/pref_data_sync.xml
new file mode 100644
index 0000000..ffda831
--- /dev/null
+++ b/templates/activities/SettingsActivity/root/res/xml/pref_data_sync.xml
@@ -0,0 +1,21 @@
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
+ dismiss it. -->
+ <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
+ <ListPreference
+ android:key="sync_frequency"
+ android:title="@string/pref_title_sync_frequency"
+ android:entries="@array/pref_sync_frequency_titles"
+ android:entryValues="@array/pref_sync_frequency_values"
+ android:defaultValue="180"
+ android:negativeButtonText="@null"
+ android:positiveButtonText="@null" />
+
+ <!-- This preference simply launches an intent when selected. Use this UI sparingly, per
+ design guidelines. -->
+ <Preference android:title="@string/pref_title_system_sync_settings">
+ <intent android:action="android.settings.SYNC_SETTINGS" />
+ </Preference>
+
+</PreferenceScreen>
diff --git a/templates/activities/SettingsActivity/root/res/xml/pref_general.xml b/templates/activities/SettingsActivity/root/res/xml/pref_general.xml
new file mode 100644
index 0000000..c49cbed
--- /dev/null
+++ b/templates/activities/SettingsActivity/root/res/xml/pref_general.xml
@@ -0,0 +1,33 @@
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <CheckBoxPreference
+ android:key="example_checkbox"
+ android:title="@string/pref_title_social_recommendations"
+ android:summary="@string/pref_description_social_recommendations"
+ android:defaultValue="true" />
+
+ <!-- NOTE: EditTextPreference accepts EditText attributes. -->
+ <!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
+ <EditTextPreference
+ android:key="example_text"
+ android:title="@string/pref_title_display_name"
+ android:defaultValue="@string/pref_default_display_name"
+ android:selectAllOnFocus="true"
+ android:inputType="textCapWords"
+ android:capitalize="words"
+ android:singleLine="true"
+ android:maxLines="1" />
+
+ <!-- NOTE: Hide buttons to simplify the UI. Users can touch outside the dialog to
+ dismiss it. -->
+ <!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
+ <ListPreference
+ android:key="example_list"
+ android:title="@string/pref_title_add_friends_to_messages"
+ android:defaultValue="-1"
+ android:entries="@array/pref_example_list_titles"
+ android:entryValues="@array/pref_example_list_values"
+ android:negativeButtonText="@null"
+ android:positiveButtonText="@null" />
+
+</PreferenceScreen>
diff --git a/templates/activities/SettingsActivity/root/res/xml/pref_headers.xml b/templates/activities/SettingsActivity/root/res/xml/pref_headers.xml
new file mode 100644
index 0000000..a3da325
--- /dev/null
+++ b/templates/activities/SettingsActivity/root/res/xml/pref_headers.xml
@@ -0,0 +1,17 @@
+<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- These settings headers are only used on tablets. -->
+
+ <header
+ android:fragment="${packageName}.${activityClass}$GeneralPreferenceFragment"
+ android:title="@string/pref_header_general" />
+
+ <header
+ android:fragment="${packageName}.${activityClass}$NotificationPreferenceFragment"
+ android:title="@string/pref_header_notifications" />
+
+ <header
+ android:fragment="${packageName}.${activityClass}$DataSyncPreferenceFragment"
+ android:title="@string/pref_header_data_sync" />
+
+</preference-headers>
diff --git a/templates/activities/SettingsActivity/root/res/xml/pref_notification.xml b/templates/activities/SettingsActivity/root/res/xml/pref_notification.xml
new file mode 100644
index 0000000..b4b8cae
--- /dev/null
+++ b/templates/activities/SettingsActivity/root/res/xml/pref_notification.xml
@@ -0,0 +1,27 @@
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <!-- A 'parent' preference, which enables/disables child preferences (below)
+ when checked/unchecked. -->
+ <CheckBoxPreference
+ android:key="notifications_new_message"
+ android:title="@string/pref_title_new_message_notifications"
+ android:defaultValue="true" />
+
+ <!-- Allows the user to choose a ringtone in the 'notification' category. -->
+ <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
+ <!-- NOTE: RingtonePreference's summary should be set to its value by the activity code. -->
+ <RingtonePreference
+ android:dependency="notifications_new_message"
+ android:key="notifications_new_message_ringtone"
+ android:title="@string/pref_title_ringtone"
+ android:ringtoneType="notification"
+ android:defaultValue="content://settings/system/notification_sound" />
+
+ <!-- NOTE: This preference will be enabled only when the checkbox above is checked. -->
+ <CheckBoxPreference
+ android:dependency="notifications_new_message"
+ android:key="notifications_new_message_vibrate"
+ android:title="@string/pref_title_vibrate"
+ android:defaultValue="true" />
+
+</PreferenceScreen>
diff --git a/templates/activities/SettingsActivity/root/src/app_package/SettingsActivity.java.ftl b/templates/activities/SettingsActivity/root/src/app_package/SettingsActivity.java.ftl
new file mode 100644
index 0000000..bf67aca
--- /dev/null
+++ b/templates/activities/SettingsActivity/root/src/app_package/SettingsActivity.java.ftl
@@ -0,0 +1,295 @@
+package ${packageName};
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.res.Configuration;
+import android.media.Ringtone;
+import android.media.RingtoneManager;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceCategory;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceManager;
+import android.preference.RingtonePreference;
+import android.text.TextUtils;
+<#if parentActivityClass != "">
+import android.view.MenuItem;
+import android.support.v4.app.NavUtils;
+</#if>
+
+import java.util.List;
+
+/**
+ * A {@link PreferenceActivity} that presents a set of application settings. On
+ * handset devices, settings are presented as a single list. On tablets,
+ * settings are split by category, with category headers shown to the left of
+ * the list of settings.
+ * <p>
+ * See <a href="http://developer.android.com/design/patterns/settings.html">
+ * Android Design: Settings</a> for design guidelines and the <a
+ * href="http://developer.android.com/guide/topics/ui/settings.html">Settings
+ * API Guide</a> for more information on developing a Settings UI.
+ */
+public class ${activityClass} extends PreferenceActivity {
+ /**
+ * Determines whether to always show the simplified settings UI, where
+ * settings are presented in a single list. When false, settings are shown
+ * as a master/detail two-pane view on tablets. When true, a single pane is
+ * shown on tablets.
+ */
+ private static final boolean ALWAYS_SIMPLE_PREFS = false;
+
+ <#if parentActivityClass != "">
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setupActionBar();
+ }
+
+ /**
+ * Set up the {@link android.app.ActionBar}, if the API is available.
+ */
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ private void setupActionBar() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
+ // Show the Up button in the action bar.
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ // This ID represents the Home or Up button. In the case of this
+ // activity, the Up button is shown. Use NavUtils to allow users
+ // to navigate up one level in the application structure. For
+ // more details, see the Navigation pattern on Android Design:
+ //
+ // http://developer.android.com/design/patterns/navigation.html#up-vs-back
+ //
+ // TODO: If Settings has multiple levels, Up should navigate up
+ // that hierarchy.
+ NavUtils.navigateUpFromSameTask(this);
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+ </#if>
+
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+
+ setupSimplePreferencesScreen();
+ }
+
+ /**
+ * Shows the simplified settings UI if the device configuration if the
+ * device configuration dictates that a simplified, single-pane UI should be
+ * shown.
+ */
+ private void setupSimplePreferencesScreen() {
+ if (!isSimplePreferences(this)) {
+ return;
+ }
+
+ // In the simplified UI, fragments are not used at all and we instead
+ // use the older PreferenceActivity APIs.
+
+ // Add 'general' preferences.
+ addPreferencesFromResource(R.xml.pref_general);
+
+ // Add 'notifications' preferences, and a corresponding header.
+ PreferenceCategory fakeHeader = new PreferenceCategory(this);
+ fakeHeader.setTitle(R.string.pref_header_notifications);
+ getPreferenceScreen().addPreference(fakeHeader);
+ addPreferencesFromResource(R.xml.pref_notification);
+
+ // Add 'data and sync' preferences, and a corresponding header.
+ fakeHeader = new PreferenceCategory(this);
+ fakeHeader.setTitle(R.string.pref_header_data_sync);
+ getPreferenceScreen().addPreference(fakeHeader);
+ addPreferencesFromResource(R.xml.pref_data_sync);
+
+ // Bind the summaries of EditText/List/Dialog/Ringtone preferences to
+ // their values. When their values change, their summaries are updated
+ // to reflect the new value, per the Android Design guidelines.
+ bindPreferenceSummaryToValue(findPreference("example_text"));
+ bindPreferenceSummaryToValue(findPreference("example_list"));
+ bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
+ bindPreferenceSummaryToValue(findPreference("sync_frequency"));
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean onIsMultiPane() {
+ return isXLargeTablet(this) && !isSimplePreferences(this);
+ }
+
+ /**
+ * Helper method to determine if the device has an extra-large screen. For
+ * example, 10" tablets are extra-large.
+ */
+ private static boolean isXLargeTablet(Context context) {
+ return (context.getResources().getConfiguration().screenLayout
+ & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_XLARGE;
+ }
+
+ /**
+ * Determines whether the simplified settings UI should be shown. This is
+ * true if this is forced via {@link #ALWAYS_SIMPLE_PREFS}, or the device
+ * doesn't have newer APIs like {@link PreferenceFragment}, or the device
+ * doesn't have an extra-large screen. In these cases, a single-pane
+ * "simplified" settings UI should be shown.
+ */
+ private static boolean isSimplePreferences(Context context) {
+ return ALWAYS_SIMPLE_PREFS
+ || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB
+ || !isXLargeTablet(context);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ public void onBuildHeaders(List<Header> target) {
+ if (!isSimplePreferences(this)) {
+ loadHeadersFromResource(R.xml.pref_headers, target);
+ }
+ }
+
+ /**
+ * A preference value change listener that updates the preference's summary
+ * to reflect its new value.
+ */
+ private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object value) {
+ String stringValue = value.toString();
+
+ if (preference instanceof ListPreference) {
+ // For list preferences, look up the correct display value in
+ // the preference's 'entries' list.
+ ListPreference listPreference = (ListPreference) preference;
+ int index = listPreference.findIndexOfValue(stringValue);
+
+ // Set the summary to reflect the new value.
+ preference.setSummary(
+ index >= 0
+ ? listPreference.getEntries()[index]
+ : null);
+
+ } else if (preference instanceof RingtonePreference) {
+ // For ringtone preferences, look up the correct display value
+ // using RingtoneManager.
+ if (TextUtils.isEmpty(stringValue)) {
+ // Empty values correspond to 'silent' (no ringtone).
+ preference.setSummary(R.string.pref_ringtone_silent);
+
+ } else {
+ Ringtone ringtone = RingtoneManager.getRingtone(
+ preference.getContext(), Uri.parse(stringValue));
+
+ if (ringtone == null) {
+ // Clear the summary if there was a lookup error.
+ preference.setSummary(null);
+ } else {
+ // Set the summary to reflect the new ringtone display
+ // name.
+ String name = ringtone.getTitle(preference.getContext());
+ preference.setSummary(name);
+ }
+ }
+
+ } else {
+ // For all other preferences, set the summary to the value's
+ // simple string representation.
+ preference.setSummary(stringValue);
+ }
+ return true;
+ }
+ };
+
+ /**
+ * Binds a preference's summary to its value. More specifically, when the
+ * preference's value is changed, its summary (line of text below the
+ * preference title) is updated to reflect the value. The summary is also
+ * immediately updated upon calling this method. The exact display format is
+ * dependent on the type of preference.
+ *
+ * @see #sBindPreferenceSummaryToValueListener
+ */
+ private static void bindPreferenceSummaryToValue(Preference preference) {
+ // Set the listener to watch for value changes.
+ preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
+
+ // Trigger the listener immediately with the preference's
+ // current value.
+ sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
+ PreferenceManager
+ .getDefaultSharedPreferences(preference.getContext())
+ .getString(preference.getKey(), ""));
+ }
+
+ /**
+ * This fragment shows general preferences only. It is used when the
+ * activity is showing a two-pane settings UI.
+ */
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ public static class GeneralPreferenceFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.pref_general);
+
+ // Bind the summaries of EditText/List/Dialog/Ringtone preferences
+ // to their values. When their values change, their summaries are
+ // updated to reflect the new value, per the Android Design
+ // guidelines.
+ bindPreferenceSummaryToValue(findPreference("example_text"));
+ bindPreferenceSummaryToValue(findPreference("example_list"));
+ }
+ }
+
+ /**
+ * This fragment shows notification preferences only. It is used when the
+ * activity is showing a two-pane settings UI.
+ */
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ public static class NotificationPreferenceFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.pref_notification);
+
+ // Bind the summaries of EditText/List/Dialog/Ringtone preferences
+ // to their values. When their values change, their summaries are
+ // updated to reflect the new value, per the Android Design
+ // guidelines.
+ bindPreferenceSummaryToValue(findPreference("notifications_new_message_ringtone"));
+ }
+ }
+
+ /**
+ * This fragment shows data and sync preferences only. It is used when the
+ * activity is showing a two-pane settings UI.
+ */
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
+ public static class DataSyncPreferenceFragment extends PreferenceFragment {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.pref_data_sync);
+
+ // Bind the summaries of EditText/List/Dialog/Ringtone preferences
+ // to their values. When their values change, their summaries are
+ // updated to reflect the new value, per the Android Design
+ // guidelines.
+ bindPreferenceSummaryToValue(findPreference("sync_frequency"));
+ }
+ }
+}
diff --git a/templates/activities/SettingsActivity/template.xml b/templates/activities/SettingsActivity/template.xml
new file mode 100644
index 0000000..f6c8dfe
--- /dev/null
+++ b/templates/activities/SettingsActivity/template.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<template
+ format="1"
+ revision="1"
+ name="New Settings Activity"
+ description="Creates a new application settings activity."
+ minApi="4"
+ minBuildApi="11">
+ <dependency name="android-support-v4" revision="8" />
+
+ <category value="Activities" />
+
+ <parameter
+ id="activityClass"
+ name="Activity Name"
+ type="string"
+ constraints="class|nonempty"
+ default="SettingsActivity"
+ help="The name of the activity class to create" />
+
+ <parameter
+ id="activityTitle"
+ name="Title"
+ type="string"
+ constraints="nonempty"
+ default="Settings"
+ help="The name of the activity." />
+
+ <parameter
+ id="parentActivityClass"
+ name="Hierarchical Parent"
+ type="string"
+ constraints="activity|exists|empty"
+ default=""
+ help="The hierarchical parent activity, used to provide a default implementation for the 'Up' button" />
+
+ <parameter
+ id="packageName"
+ name="Package name"
+ type="string"
+ constraints="package"
+ default="com.mycompany.myapp" />
+
+ <!-- 128x128 thumbnails relative to template.xml -->
+ <thumbs>
+ <!-- default thumbnail is required -->
+ <thumb>template_settings_activity.png</thumb>
+ </thumbs>
+
+ <globals file="globals.xml.ftl" />
+ <execute file="recipe.xml.ftl" />
+
+</template>
diff --git a/templates/activities/SettingsActivity/template_settings_activity.png b/templates/activities/SettingsActivity/template_settings_activity.png
new file mode 100644
index 0000000..c1a65cb
--- /dev/null
+++ b/templates/activities/SettingsActivity/template_settings_activity.png
Binary files differ