diff --git a/api/res/values/strings.xml b/api/res/values/strings.xml
index 554b6653d..f03f58d67 100644
--- a/api/res/values/strings.xml
+++ b/api/res/values/strings.xml
@@ -149,7 +149,10 @@
Synchronizing...
- Synchronization
+ Sync & Backup
+
+
+ Astrid.com, Google Tasks, Saved Data & Local Backup
Connection Error! Check your Internet connection.
diff --git a/astrid/AndroidManifest.xml b/astrid/AndroidManifest.xml
index 1d1769d3d..fb667b0e6 100644
--- a/astrid/AndroidManifest.xml
+++ b/astrid/AndroidManifest.xml
@@ -265,6 +265,8 @@
+
@@ -273,24 +275,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -502,6 +486,18 @@
+
+
+
+
+
+
+
+
+
+
@@ -569,6 +567,8 @@
+
diff --git a/astrid/res/values/strings-defaults.xml b/astrid/res/values/strings-defaults.xml
index 0271c79f5..e7b217b05 100644
--- a/astrid/res/values/strings-defaults.xml
+++ b/astrid/res/values/strings-defaults.xml
@@ -8,6 +8,7 @@
New Task Defaults
+ Importance, Due Date, Add to Calendar
Default Urgency
diff --git a/astrid/res/values/strings-ppack.xml b/astrid/res/values/strings-ppack.xml
index e0700e2a0..de6dd43c7 100644
--- a/astrid/res/values/strings-ppack.xml
+++ b/astrid/res/values/strings-ppack.xml
@@ -10,6 +10,7 @@
Premium and Misc. Settings
+ Missed call reminders, voice input and miscellaneous settings
Anonymous Usage Stats
diff --git a/astrid/res/values/strings-reminders.xml b/astrid/res/values/strings-reminders.xml
index 852a8f3b3..315ba547a 100644
--- a/astrid/res/values/strings-reminders.xml
+++ b/astrid/res/values/strings-reminders.xml
@@ -105,6 +105,7 @@
Reminder Settings
+ Quiet hours, snooze options, persistence level
Reminders Enabled?
diff --git a/astrid/res/xml/preferences.xml b/astrid/res/xml/preferences.xml
index 48c7b4d9c..99db9f650 100644
--- a/astrid/res/xml/preferences.xml
+++ b/astrid/res/xml/preferences.xml
@@ -101,7 +101,8 @@
+ android:title="@string/EPr_powerpack_header"
+ android:summary="@string/EPr_powerpack_summary">
diff --git a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java
index cf5d0889d..f3caa69b9 100644
--- a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java
+++ b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java
@@ -5,12 +5,21 @@
*/
package com.todoroo.astrid.activity;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.weloveastrid.rmilk.MilkPreferences;
+import org.weloveastrid.rmilk.MilkUtilities;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
@@ -20,6 +29,7 @@ import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
+import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.widget.Toast;
@@ -41,7 +51,12 @@ import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.files.FileExplore;
import com.todoroo.astrid.files.FileMetadata;
+import com.todoroo.astrid.gtasks.GtasksPreferences;
+import com.todoroo.astrid.helper.MetadataHelper;
+import com.todoroo.astrid.producteev.ProducteevPreferences;
+import com.todoroo.astrid.producteev.ProducteevUtilities;
import com.todoroo.astrid.service.AddOnService;
+import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
@@ -118,7 +133,7 @@ public class EditPreferences extends TodorooPreferenceActivity {
PreferenceScreen screen = getPreferenceScreen();
voiceInputAssistant = new VoiceInputAssistant(this);
-// addPluginPreferences(screen);
+ addPluginPreferences(screen);
screen.getPreference(POWER_PACK_PREFERENCE).setEnabled(addOnService.hasPowerPack());
@@ -249,78 +264,90 @@ public class EditPreferences extends TodorooPreferenceActivity {
// PREFERENCE_REQUEST_CODES.put(LabsPreferences.class, REQUEST_CODE_LABS);
}
-// private void addPluginPreferences(PreferenceScreen screen) {
-// Intent queryIntent = new Intent(AstridApiConstants.ACTION_SETTINGS);
-// PackageManager pm = getPackageManager();
-// List resolveInfoList = pm.queryIntentActivities(queryIntent,
-// PackageManager.GET_META_DATA);
-// int length = resolveInfoList.size();
-// LinkedHashMap> categoryPreferences =
-// new LinkedHashMap>();
-//
-// // Loop through a list of all packages (including plugins, addons)
-// // that have a settings action
-// String labsTitle = getString(R.string.EPr_labs_header);
-// for(int i = 0; i < length; i++) {
-// ResolveInfo resolveInfo = resolveInfoList.get(i);
-// final Intent intent = new Intent(AstridApiConstants.ACTION_SETTINGS);
-// intent.setClassName(resolveInfo.activityInfo.packageName,
-// resolveInfo.activityInfo.name);
-//
-// if(MilkPreferences.class.getName().equals(resolveInfo.activityInfo.name) &&
-// !MilkUtilities.INSTANCE.isLoggedIn())
-// continue;
-//
-// if (GtasksPreferences.class.getName().equals(resolveInfo.activityInfo.name)
-// && AmazonMarketStrategy.isKindleFire())
-// continue;
-//
-// if (ProducteevPreferences.class.getName().equals(resolveInfo.activityInfo.name)
-// && !Preferences.getBoolean(R.string.p_third_party_addons, false) && !ProducteevUtilities.INSTANCE.isLoggedIn())
-// continue;
-//
-// Preference preference = new Preference(this);
-// preference.setTitle(resolveInfo.activityInfo.loadLabel(pm));
-// if (labsTitle.equals(preference.getTitle()))
-// preference.setSummary(R.string.EPr_labs_desc);
-// try {
-// Class> intentComponent = Class.forName(intent.getComponent().getClassName());
-// if (intentComponent.getSuperclass().equals(SyncProviderPreferences.class))
-// intentComponent = SyncProviderPreferences.class;
-// if (PREFERENCE_REQUEST_CODES.containsKey(intentComponent)) {
-// final int code = PREFERENCE_REQUEST_CODES.get(intentComponent);
-// preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
-// @Override
-// public boolean onPreferenceClick(Preference pref) {
-// startActivityForResult(intent, code);
-// return true;
-// }
-// });
-// } else {
-// preference.setIntent(intent);
-// }
-// } catch (ClassNotFoundException e) {
-// preference.setIntent(intent);
-// }
-//
-// String category = MetadataHelper.resolveActivityCategoryName(resolveInfo, pm);
-//
-// if(!categoryPreferences.containsKey(category))
-// categoryPreferences.put(category, new ArrayList());
-// ArrayList arrayList = categoryPreferences.get(category);
-// arrayList.add(preference);
-// }
-//
-// for(Entry> entry : categoryPreferences.entrySet()) {
-// Preference header = new Preference(this);
-// header.setLayoutResource(android.R.layout.preference_category);
-// header.setTitle(entry.getKey());
-// screen.addPreference(header);
-//
-// for(Preference preference : entry.getValue())
-// screen.addPreference(preference);
-// }
-// }
+ private void addPluginPreferences(PreferenceScreen screen) {
+ Intent queryIntent = new Intent(AstridApiConstants.ACTION_SETTINGS);
+ PackageManager pm = getPackageManager();
+ List resolveInfoList = pm.queryIntentActivities(queryIntent,
+ PackageManager.GET_META_DATA);
+ int length = resolveInfoList.size();
+ LinkedHashMap> categoryPreferences =
+ new LinkedHashMap>();
+
+ // Loop through a list of all packages (including plugins, addons)
+ // that have a settings action
+ for(int i = 0; i < length; i++) {
+ ResolveInfo resolveInfo = resolveInfoList.get(i);
+ final Intent intent = new Intent(AstridApiConstants.ACTION_SETTINGS);
+ intent.setClassName(resolveInfo.activityInfo.packageName,
+ resolveInfo.activityInfo.name);
+
+ if(MilkPreferences.class.getName().equals(resolveInfo.activityInfo.name) &&
+ !MilkUtilities.INSTANCE.isLoggedIn())
+ continue;
+
+ if (GtasksPreferences.class.getName().equals(resolveInfo.activityInfo.name)
+ && AmazonMarketStrategy.isKindleFire())
+ continue;
+
+ if (ProducteevPreferences.class.getName().equals(resolveInfo.activityInfo.name)
+ && !Preferences.getBoolean(R.string.p_third_party_addons, false) && !ProducteevUtilities.INSTANCE.isLoggedIn())
+ continue;
+
+ Preference preference = new Preference(this);
+ preference.setTitle(resolveInfo.activityInfo.loadLabel(pm));
+ Bundle metadata = resolveInfo.activityInfo.metaData;
+ if (metadata != null) {
+ int resource = metadata.getInt("summary", 0); //$NON-NLS-1$
+ if (resource > 0)
+ preference.setSummary(resource);
+ }
+ try {
+ Class> intentComponent = Class.forName(intent.getComponent().getClassName());
+ if (intentComponent.getSuperclass().equals(SyncProviderPreferences.class))
+ intentComponent = SyncProviderPreferences.class;
+ if (PREFERENCE_REQUEST_CODES.containsKey(intentComponent)) {
+ final int code = PREFERENCE_REQUEST_CODES.get(intentComponent);
+ preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference pref) {
+ startActivityForResult(intent, code);
+ return true;
+ }
+ });
+ } else {
+ preference.setIntent(intent);
+ }
+ } catch (ClassNotFoundException e) {
+ preference.setIntent(intent);
+ }
+
+ String category = MetadataHelper.resolveActivityCategoryName(resolveInfo, pm);
+
+ if(!categoryPreferences.containsKey(category))
+ categoryPreferences.put(category, new ArrayList());
+ ArrayList arrayList = categoryPreferences.get(category);
+ arrayList.add(preference);
+ }
+
+ for(Entry> entry : categoryPreferences.entrySet()) {
+ if (entry.getKey().equals(getString(R.string.app_name))) {
+ for(Preference preference : entry.getValue())
+ screen.addPreference(preference);
+ } else {
+ PreferenceManager manager = getPreferenceManager();
+ PreferenceScreen header = manager.createPreferenceScreen(this);
+ header.setTitle(entry.getKey());
+ if (entry.getKey().equals(getString(R.string.SyP_label)))
+ header.setSummary(R.string.SyP_summary);
+ screen.addPreference(header);
+
+ for(Preference preference : entry.getValue())
+ header.addPreference(preference);
+ }
+
+
+ }
+ }
@SuppressWarnings("nls")
private void addDebugPreferences() {