From 9b5476a1aa79462f9bb947d5d52b98cc1ef0a1df Mon Sep 17 00:00:00 2001 From: Andrew Shaw Date: Mon, 30 Jan 2012 14:23:55 -0800 Subject: [PATCH] Added a dialog when user tries to share a list but isn't logged in --- .../astrid/actfm/TagSettingsActivity.java | 27 +++++++++++++++++-- astrid/res/values/strings-actfm.xml | 7 +++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java index 4c9bba49e..c469539b2 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java @@ -10,6 +10,7 @@ import org.json.JSONObject; import android.app.Activity; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.os.Bundle; @@ -214,9 +215,31 @@ public class TagSettingsActivity extends FragmentActivity { if(newName.length() > 0 && oldName.length() == 0) { tagDataService.save(tagData); } - startActivityForResult(new Intent(this, ActFmLoginActivity.class), - REQUEST_ACTFM_LOGIN); + + DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface d, int which) { + startActivityForResult(new Intent(TagSettingsActivity.this, ActFmLoginActivity.class), + REQUEST_ACTFM_LOGIN); + } + }; + + DialogInterface.OnClickListener cancelListener = new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface d, int which) { + + tagMembers.removeAllViews(); + tagMembers.addPerson(""); //$NON-NLS-1$ + } + }; + DialogUtilities.okCancelCustomDialog(TagSettingsActivity.this, getString(R.string.actfm_EPA_login_button), + getString(R.string.actfm_TVA_login_to_share), R.string.actfm_EPA_login_button, + R.string.actfm_EPA_dont_share_button, android.R.drawable.ic_dialog_alert, + okListener, cancelListener); + Toast.makeText(this, R.string.tag_list_saved, Toast.LENGTH_LONG).show(); + return; + } int oldMemberCount = tagData.getValue(TagData.MEMBER_COUNT); diff --git a/astrid/res/values/strings-actfm.xml b/astrid/res/values/strings-actfm.xml index c7db8beb3..2f088625e 100644 --- a/astrid/res/values/strings-actfm.xml +++ b/astrid/res/values/strings-actfm.xml @@ -99,6 +99,13 @@ List description + + + List description + + + You need to be logged in to Astrid.com to share lists! Please log in or make this a private list. +