From e256017e86873809adbcd3faac338bfd4cf36765 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 24 Aug 2012 13:29:18 -0700 Subject: [PATCH] More adjustments to settings page --- astrid/res/values/strings-actfm.xml | 4 ++- astrid/res/values/strings-core.xml | 3 -- astrid/res/xml/preferences.xml | 2 +- astrid/res/xml/preferences_actfm.xml | 34 +++++++++---------- .../astrid/activity/EditPreferences.java | 27 +++++++++------ 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/astrid/res/values/strings-actfm.xml b/astrid/res/values/strings-actfm.xml index 86b1b3bf5..e6f9eced2 100644 --- a/astrid/res/values/strings-actfm.xml +++ b/astrid/res/values/strings-actfm.xml @@ -309,8 +309,10 @@ Account Type + Account Info + Status and options Sign up for a free account - Access tasks online, share lists and even delegate + Access tasks online, share lists and delegate Premium diff --git a/astrid/res/values/strings-core.xml b/astrid/res/values/strings-core.xml index 317848ff4..eaa316074 100644 --- a/astrid/res/values/strings-core.xml +++ b/astrid/res/values/strings-core.xml @@ -582,9 +582,6 @@ Account: %s - - - Cloud sync status and options Tutorial, FAQ, About Astrid diff --git a/astrid/res/xml/preferences.xml b/astrid/res/xml/preferences.xml index 636074a08..5e0274704 100644 --- a/astrid/res/xml/preferences.xml +++ b/astrid/res/xml/preferences.xml @@ -10,7 +10,7 @@ + android:summary="@string/actfm_account_info_summary"/> diff --git a/astrid/res/xml/preferences_actfm.xml b/astrid/res/xml/preferences_actfm.xml index b81756708..16d12b7df 100644 --- a/astrid/res/xml/preferences_actfm.xml +++ b/astrid/res/xml/preferences_actfm.xml @@ -17,23 +17,6 @@ android:title="@string/actfm_inapp_billing" android:summary="@string/actfm_inapp_billing_summary"/> - - - - - - - - @@ -55,5 +38,22 @@ android:summary="@string/sync_SPr_forget_description" /> + + + + + + + + \ No newline at end of file diff --git a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java index 94290f2e7..d3e127503 100644 --- a/astrid/src/com/todoroo/astrid/activity/EditPreferences.java +++ b/astrid/src/com/todoroo/astrid/activity/EditPreferences.java @@ -270,9 +270,14 @@ public class EditPreferences extends TodorooPreferenceActivity { } private void showAccountPrefs() { - Intent intent = new Intent(this, ActFmPreferences.class); - intent.setAction(AstridApiConstants.ACTION_SETTINGS); - startActivityForResult(intent, REQUEST_CODE_SYNC); + if (actFmPreferenceService.isLoggedIn()) { + Intent intent = new Intent(this, ActFmPreferences.class); + intent.setAction(AstridApiConstants.ACTION_SETTINGS); + startActivityForResult(intent, REQUEST_CODE_SYNC); + } else { + Intent intent = new Intent(this, ActFmLoginActivity.class); + startActivity(intent); + } } private static final HashMap, Integer> PREFERENCE_REQUEST_CODES = new HashMap, Integer>(); @@ -433,15 +438,17 @@ public class EditPreferences extends TodorooPreferenceActivity { final Resources r = getResources(); if (r.getString(R.string.p_account).equals(preference.getKey())) { - String accountType; - if (ActFmPreferenceService.isPremiumUser()) { - accountType = getString(R.string.actfm_account_premium); - } else if (actFmPreferenceService.isLoggedIn()) { - accountType = getString(R.string.actfm_account_basic); + int title; + int summary; + if (ActFmPreferenceService.isPremiumUser() || actFmPreferenceService.isLoggedIn()) { + title = R.string.actfm_account_info; + summary = R.string.actfm_account_info_summary; } else { - accountType = getString(R.string.actfm_account_none); + title = R.string.account_type_title_not_logged_in; + summary = R.string.account_type_summary_not_logged_in; } - preference.setTitle(getString(R.string.EPr_account_title, accountType)); + preference.setTitle(title); + preference.setSummary(summary); } else if (r.getString(R.string.p_showNotes).equals(preference.getKey())) { if (value != null && !(Boolean)value) preference.setSummary(R.string.EPr_showNotes_desc_disabled);