From 4402461b600406506cee1d146a1e9b4bd8ffacc9 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 23 Dec 2011 00:26:08 -0700 Subject: [PATCH] Fixed a bug with the sequence of welcome popovers --- .../astrid/activity/TaskEditActivity.java | 7 +++++ .../astrid/activity/TaskListActivity.java | 28 ++++++++++--------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java index 8e4a61bf1..d12a05558 100755 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditActivity.java @@ -226,6 +226,7 @@ public final class TaskEditActivity extends Activity { new StartupService().onStartupApplication(this); setUpUIComponents(); + adjustInfoPopovers(); overrideFinishAnim = getIntent().getBooleanExtra(OVERRIDE_FINISH_ANIM, true); @@ -891,6 +892,12 @@ public final class TaskEditActivity extends Activity { StatisticsService.sessionStop(this); } + private void adjustInfoPopovers() { + Preferences.setBoolean(R.string.p_showed_tap_task_help, true); + if (!Preferences.isSet(getString(R.string.p_showed_lists_help))) + Preferences.setBoolean(R.string.p_showed_lists_help, false); + } + /* ====================================================================== * ========================================== UI component helper classes * ====================================================================== */ diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index 6e47a2e73..ff36bf305 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -896,20 +896,22 @@ public class TaskListActivity extends ListActivity implements OnScrollListener, imm.hideSoftInputFromWindow(quickAddBox.getWindowToken(), 0); getListView().postDelayed(new Runnable() { public void run() { - final View view = getListView().getChildAt(getListView().getChildCount() - 1); - if (view != null) { - OnDismissListener onDismiss = new OnDismissListener() { - @Override - public void onDismiss() { - if (!Preferences.isSet(getString(R.string.p_showed_lists_help))) { - Preferences.setBoolean(R.string.p_showed_lists_help, false); - } else if (!Preferences.getBoolean(R.string.p_showed_lists_help, false)) { - Preferences.setBoolean(R.string.p_showed_lists_help, true); - HelpInfoPopover.showPopover(TaskListActivity.this, findViewById(R.id.back), R.string.help_popover_lists, null); + if (taskAdapter.getCount() > 0) { + final View view = getListView().getChildAt(getListView().getChildCount() - 1); + if (view != null) { + OnDismissListener onDismiss = new OnDismissListener() { + @Override + public void onDismiss() { + if (!Preferences.isSet(getString(R.string.p_showed_lists_help))) { + Preferences.setBoolean(R.string.p_showed_lists_help, false); + } else if (!Preferences.getBoolean(R.string.p_showed_lists_help, false)) { + Preferences.setBoolean(R.string.p_showed_lists_help, true); + HelpInfoPopover.showPopover(TaskListActivity.this, findViewById(R.id.back), R.string.help_popover_lists, null); + } } - } - }; - HelpInfoPopover.showPopover(TaskListActivity.this, view, R.string.help_popover_tap_task, onDismiss); + }; + HelpInfoPopover.showPopover(TaskListActivity.this, view, R.string.help_popover_tap_task, onDismiss); + } } } }, 1000L);