diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java index d9b29821a..4ee1c59e0 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/ActFmPreferences.java @@ -7,6 +7,7 @@ package com.todoroo.astrid.actfm; import android.content.ActivityNotFoundException; import android.content.DialogInterface; +import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; @@ -146,6 +147,26 @@ public class ActFmPreferences extends SyncProviderPreferences { preference.setTitle(R.string.account_type_title_not_logged_in); preference.setSummary(R.string.account_type_summary_not_logged_in); } + } else if (r.getString(R.string.sync_SPr_forget_key).equals(preference.getKey())) { + preference.setOnPreferenceClickListener(new OnPreferenceClickListener() { + public boolean onPreferenceClick(Preference p) { + DialogUtilities.okCancelDialog(ActFmPreferences.this, + r.getString(R.string.sync_forget_confirm), new OnClickListener() { + @Override + public void onClick(DialogInterface dialog, + int which) { + logOut(); + initializePreference(getPreferenceScreen()); + } + }, null); + return true; + } + }); + if(!loggedIn) { + PreferenceCategory category = (PreferenceCategory) findPreference(r.getString(R.string.sync_SPr_group_status)); + category.removePreference(preference); + } + } else { super.updatePreferences(preference, value); } diff --git a/astrid/res/xml/preferences_actfm.xml b/astrid/res/xml/preferences_actfm.xml index 16d12b7df..926ebc7d7 100644 --- a/astrid/res/xml/preferences_actfm.xml +++ b/astrid/res/xml/preferences_actfm.xml @@ -31,11 +31,6 @@ android:key="@string/actfm_https_key" android:title="@string/actfm_https_title" android:defaultValue="false"/> - - @@ -53,6 +48,11 @@ android:key="@string/sync_SPr_key_last_error" android:textSize="24sp" android:gravity="center"/> + + diff --git a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java index 9732e8ba9..167f3cd71 100644 --- a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java +++ b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java @@ -116,14 +116,14 @@ public class BillingActivity extends FragmentActivity { protected void onResume() { super.onResume(); if (!actFmPreferenceService.isLoggedIn()) { - // Prompt to log in -// DialogUtilities.okDialog(this, getString(R.string.premium_login_prompt), -// new DialogInterface.OnClickListener() { -// @Override -// public void onClick(DialogInterface dialog, int which) { -// finish(); -// } -// }); + // Prompt to log in, but this shouldn't happen anyways since we hide the entry path to this screen when not logged in + DialogUtilities.okDialog(this, getString(R.string.premium_login_prompt), + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }); } else if (!billingService.checkBillingSupported(BillingConstants.ITEM_TYPE_SUBSCRIPTION)) { showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); } else if (ActFmPreferenceService.isPremiumUser()) { @@ -170,12 +170,10 @@ public class BillingActivity extends FragmentActivity { R.string.premium_description_4, R.string.premium_description_5, R.string.premium_description_6 }; - StringBuilder builder = new StringBuilder("