Final reordering of things on astrid.com prefs page, readded logged in sanity check to billing activity

pull/14/head
Sam Bosley 13 years ago
parent 93d52400ac
commit 6039b9e01b

@ -7,6 +7,7 @@ package com.todoroo.astrid.actfm;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.net.Uri; import android.net.Uri;
@ -146,6 +147,26 @@ public class ActFmPreferences extends SyncProviderPreferences {
preference.setTitle(R.string.account_type_title_not_logged_in); preference.setTitle(R.string.account_type_title_not_logged_in);
preference.setSummary(R.string.account_type_summary_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 { } else {
super.updatePreferences(preference, value); super.updatePreferences(preference, value);
} }

@ -31,11 +31,6 @@
android:key="@string/actfm_https_key" android:key="@string/actfm_https_key"
android:title="@string/actfm_https_title" android:title="@string/actfm_https_title"
android:defaultValue="false"/> android:defaultValue="false"/>
<com.todoroo.astrid.ui.MultilinePreference
android:key="@string/sync_SPr_forget_key"
android:title="@string/sync_SPr_forget"
android:summary="@string/sync_SPr_forget_description" />
</PreferenceCategory> </PreferenceCategory>
@ -53,6 +48,11 @@
android:key="@string/sync_SPr_key_last_error" android:key="@string/sync_SPr_key_last_error"
android:textSize="24sp" android:textSize="24sp"
android:gravity="center"/> android:gravity="center"/>
<com.todoroo.astrid.ui.MultilinePreference
android:key="@string/sync_SPr_forget_key"
android:title="@string/sync_SPr_forget"
android:summary="@string/sync_SPr_forget_description" />
</PreferenceCategory> </PreferenceCategory>

@ -116,14 +116,14 @@ public class BillingActivity extends FragmentActivity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (!actFmPreferenceService.isLoggedIn()) { if (!actFmPreferenceService.isLoggedIn()) {
// Prompt to log in // 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), DialogUtilities.okDialog(this, getString(R.string.premium_login_prompt),
// new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
// @Override @Override
// public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
// finish(); finish();
// } }
// }); });
} else if (!billingService.checkBillingSupported(BillingConstants.ITEM_TYPE_SUBSCRIPTION)) { } else if (!billingService.checkBillingSupported(BillingConstants.ITEM_TYPE_SUBSCRIPTION)) {
showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID);
} else if (ActFmPreferenceService.isPremiumUser()) { } 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 R.string.premium_description_4, R.string.premium_description_5, R.string.premium_description_6
}; };
StringBuilder builder = new StringBuilder("<html><body><ul>"); StringBuilder builder = new StringBuilder("<html><style type=\"text/css\">li { padding-bottom: 13px } </style><body><ul>");
for (int i = 0; i < bullets.length; i++) { for (int i = 0; i < bullets.length; i++) {
builder.append("<li><font style='color=#404040; font-size: 18px'>").append(getString(bullets[i])); builder.append("<li><font style='color=#404040; font-size: 18px'>").append(getString(bullets[i]));
if (i != bullets.length - 1)
builder.append("<br><br>");
builder.append("</font></li>\n"); builder.append("</font></li>\n");
} }

Loading…
Cancel
Save