diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java index 84b6746b8..637761236 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagSettingsActivity.java @@ -69,7 +69,6 @@ import com.todoroo.astrid.ui.PeopleContainer; import com.todoroo.astrid.ui.PeopleContainer.ParseSharedException; import com.todoroo.astrid.utility.AstridPreferences; import com.todoroo.astrid.utility.ResourceDrawableCache; -import com.todoroo.astrid.welcome.HelpInfoPopover; import edu.mit.mobile.android.imagecache.ImageCache; @@ -173,8 +172,6 @@ public class TagSettingsActivity extends SherlockFragmentActivity { } }).start(); } - showCollaboratorsPopover(); - } private void setupForDialogOrFullscreen() { @@ -199,14 +196,6 @@ public class TagSettingsActivity extends SherlockFragmentActivity { } } - private void showCollaboratorsPopover() { - if (!Preferences.getBoolean(R.string.p_showed_collaborators_help, false)) { - View members = findViewById(R.id.members_container); - HelpInfoPopover.showPopover(this, members, R.string.help_popover_collaborators, null); - Preferences.setBoolean(R.string.p_showed_collaborators_help, true); - } - } - protected void setUpSettingsPage() { if (isDialog) { findViewById(R.id.save_and_cancel).setVisibility(View.VISIBLE); diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java index 591c684c2..ed4c1729b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java @@ -88,7 +88,6 @@ import com.todoroo.astrid.tags.TaskToTagMetadata; import com.todoroo.astrid.utility.AstridPreferences; import com.todoroo.astrid.utility.Flags; import com.todoroo.astrid.utility.ResourceDrawableCache; -import com.todoroo.astrid.welcome.HelpInfoPopover; public class TagViewFragment extends TaskListFragment { @@ -203,20 +202,6 @@ public class TagViewFragment extends TaskListFragment { return R.layout.task_list_body_tag; } - private void showListSettingsPopover() { - if (!AstridPreferences.canShowPopover()) { - return; - } - if (!Preferences.getBoolean(R.string.p_showed_list_settings_help, false)) { - Preferences.setBoolean(R.string.p_showed_list_settings_help, true); - View tabView = getView().findViewById(R.id.members_edit); - if (tabView != null) { - HelpInfoPopover.showPopover(getActivity(), tabView, - R.string.help_popover_list_settings, null); - } - } - } - @Override protected void addSyncRefreshMenuItem(Menu menu, int themeFlags) { if(actFmPreferenceService.isLoggedIn()) { @@ -751,7 +736,6 @@ public class TagViewFragment extends TaskListFragment { IntentFilter intentFilter = new IntentFilter(BROADCAST_TAG_ACTIVITY); getActivity().registerReceiver(notifyReceiver, intentFilter); - showListSettingsPopover(); updateCommentCount(); } diff --git a/astrid/res/drawable-hdpi/popover_arrow_down.png b/astrid/res/drawable-hdpi/popover_arrow_down.png deleted file mode 100644 index 3f1f6ca7f..000000000 Binary files a/astrid/res/drawable-hdpi/popover_arrow_down.png and /dev/null differ diff --git a/astrid/res/drawable-hdpi/popover_arrow_up.png b/astrid/res/drawable-hdpi/popover_arrow_up.png deleted file mode 100644 index acdeb1f0e..000000000 Binary files a/astrid/res/drawable-hdpi/popover_arrow_up.png and /dev/null differ diff --git a/astrid/res/drawable-hdpi/popover_bg.9.png b/astrid/res/drawable-hdpi/popover_bg.9.png deleted file mode 100644 index 2d0dc7b9d..000000000 Binary files a/astrid/res/drawable-hdpi/popover_bg.9.png and /dev/null differ diff --git a/astrid/res/drawable-xhdpi/popover_arrow_down.png b/astrid/res/drawable-xhdpi/popover_arrow_down.png deleted file mode 100644 index 6d23f0f90..000000000 Binary files a/astrid/res/drawable-xhdpi/popover_arrow_down.png and /dev/null differ diff --git a/astrid/res/drawable-xhdpi/popover_arrow_up.png b/astrid/res/drawable-xhdpi/popover_arrow_up.png deleted file mode 100644 index a080c7e8b..000000000 Binary files a/astrid/res/drawable-xhdpi/popover_arrow_up.png and /dev/null differ diff --git a/astrid/res/drawable-xhdpi/popover_bg.9.png b/astrid/res/drawable-xhdpi/popover_bg.9.png deleted file mode 100644 index 2d0dc7b9d..000000000 Binary files a/astrid/res/drawable-xhdpi/popover_bg.9.png and /dev/null differ diff --git a/astrid/res/drawable/popover_arrow_down.png b/astrid/res/drawable/popover_arrow_down.png deleted file mode 100644 index 02223b01a..000000000 Binary files a/astrid/res/drawable/popover_arrow_down.png and /dev/null differ diff --git a/astrid/res/drawable/popover_arrow_up.png b/astrid/res/drawable/popover_arrow_up.png deleted file mode 100644 index 9c08e8113..000000000 Binary files a/astrid/res/drawable/popover_arrow_up.png and /dev/null differ diff --git a/astrid/res/drawable/popover_bg.9.png b/astrid/res/drawable/popover_bg.9.png deleted file mode 100644 index 2d0dc7b9d..000000000 Binary files a/astrid/res/drawable/popover_bg.9.png and /dev/null differ diff --git a/astrid/res/layout-xlarge/help_popover.xml b/astrid/res/layout-xlarge/help_popover.xml deleted file mode 100644 index 9a1048c91..000000000 --- a/astrid/res/layout-xlarge/help_popover.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - diff --git a/astrid/res/layout/help_popover.xml b/astrid/res/layout/help_popover.xml deleted file mode 100644 index 3ac5fa708..000000000 --- a/astrid/res/layout/help_popover.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - diff --git a/astrid/res/values/keys.xml b/astrid/res/values/keys.xml index 0be73a2a6..5e32fc7f3 100644 --- a/astrid/res/values/keys.xml +++ b/astrid/res/values/keys.xml @@ -409,17 +409,6 @@ actfm_sync_freq - - - showed_add_task_help - showed_tap_task_help - showed_lists_help - showed_list_settings_help - showed_collaborators_help - showed_when_shortcut - showed_when_row - tutorial - diff --git a/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java b/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java index f36a576c3..4666b03ba 100644 --- a/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java @@ -55,7 +55,6 @@ import com.todoroo.astrid.api.FilterWithUpdate; import com.todoroo.astrid.tags.TagService; import com.todoroo.astrid.tags.TagsPlugin; import com.todoroo.astrid.utility.AstridPreferences; -import com.todoroo.astrid.welcome.HelpInfoPopover; /** * Activity that displays a user's task lists and allows users @@ -457,11 +456,6 @@ public class FilterListFragment extends SherlockListFragment { adapter.getLists(); } - public void showAddListPopover() { - View anchor = getView().findViewById(R.id.new_list_button); - HelpInfoPopover.showPopover(getActivity(), anchor, R.string.help_popover_add_lists, null); - } - /** * Receiver which receives refresh intents * diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java index 3811159a1..e97af6ed8 100755 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java @@ -346,9 +346,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { AstridActivity activity = (AstridActivity) getActivity(); setUpUIComponents(); - adjustInfoPopovers(); - - Preferences.setBoolean(R.string.p_showed_tap_task_help, true); overrideFinishAnim = false; if (activity != null) { @@ -1410,13 +1407,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { super.onStop(); } - 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/TaskListFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java index 62d8ef3f4..340523271 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListFragment.java @@ -109,7 +109,6 @@ import com.todoroo.astrid.ui.FeedbackPromptDialogs; import com.todoroo.astrid.ui.QuickAddBar; import com.todoroo.astrid.utility.AstridPreferences; import com.todoroo.astrid.utility.Flags; -import com.todoroo.astrid.welcome.HelpInfoPopover; import com.todoroo.astrid.widget.TasksWidget; /** @@ -688,13 +687,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele setUpBackgroundJobs(); - if (!Preferences.getBoolean(R.string.p_showed_add_task_help, false)) { - showTaskCreateHelpPopover(); - } else if (!Preferences.getBoolean(R.string.p_showed_tap_task_help, false)) { - showTaskEditHelpPopover(); - } else if (!Preferences.getBoolean(R.string.p_showed_lists_help, false)) { - showListsHelp(); - } refreshFilterCount(); initiateAutomaticSync(); @@ -892,23 +884,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele } super.onActivityResult(requestCode, resultCode, data); - - if (!Preferences.getBoolean(R.string.p_showed_add_task_help, false)) { - if(!AstridPreferences.canShowPopover()) { - return; - } - quickAddBar.getQuickAddBox().postDelayed(new Runnable() { - @Override - public void run() { - Activity activity = getActivity(); - if (activity != null) { - HelpInfoPopover.showPopover(getActivity(), quickAddBar.getQuickAddBox(), - R.string.help_popover_add_task, null); - Preferences.setBoolean(R.string.p_showed_add_task_help, true); - } - } - }, 1000); - } } public void onScroll(AbsListView view, int firstVisibleItem, @@ -1101,74 +1076,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele } } - private void showTaskCreateHelpPopover() { - if(!AstridPreferences.canShowPopover()) { - return; - } - if (!Preferences.getBoolean(R.string.p_showed_add_task_help, false)) { - Preferences.setBoolean(R.string.p_showed_add_task_help, true); - HelpInfoPopover.showPopover(getActivity(), quickAddBar.getQuickAddBox(), - R.string.help_popover_add_task, null); - } - } - - public void showTaskEditHelpPopover() { - if(!AstridPreferences.canShowPopover()) { - return; - } - if (!Preferences.getBoolean(R.string.p_showed_tap_task_help, false)) { - quickAddBar.hideKeyboard(); - getListView().postDelayed(new Runnable() { - @Override - public void run() { - try { - if (taskAdapter != null && taskAdapter.getCount() > 0) { - final View view = getListView().getChildAt( - getListView().getChildCount() - 1); - if (view != null) { - Activity activity = getActivity(); - if (activity != null) { - HelpInfoPopover.showPopover(getActivity(), view, - R.string.help_popover_tap_task, null); - Preferences.setBoolean(R.string.p_showed_tap_task_help, true); - } - } - } - } catch (IllegalStateException e) { - // Whoops, view is gone. Try again later - } - } - }, 1000L); - - } - } - - private void showListsHelp() { - if(!AstridPreferences.canShowPopover()) { - return; - } - if (!Preferences.getBoolean( - R.string.p_showed_lists_help, false)) { - AstridActivity activity = (AstridActivity) getActivity(); - if (activity != null) { - if (AstridPreferences.useTabletLayout(activity)) { - FilterListFragment flf = activity.getFilterListFragment(); - if (flf != null) { - flf.showAddListPopover(); - } - } else { - ActionBar ab = activity.getSupportActionBar(); - View anchor = ab.getCustomView().findViewById(R.id.lists_nav); - HelpInfoPopover.showPopover(activity, - anchor, R.string.help_popover_switch_lists, null); - } - Preferences.setBoolean( - R.string.p_showed_lists_help, - true); - } - } - } - /* * ====================================================================== * ============================================================== actions diff --git a/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java b/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java index ed0e27f6f..21c9d633f 100644 --- a/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java +++ b/astrid/src/com/todoroo/astrid/ui/QuickAddBar.java @@ -334,7 +334,6 @@ public class QuickAddBar extends LinearLayout { addToCalendar(task, title); if(!TextUtils.isEmpty(title)) { - fragment.showTaskEditHelpPopover(); } if (activity instanceof TaskListActivity && !assignedToMe) { diff --git a/astrid/src/com/todoroo/astrid/welcome/HelpInfoPopover.java b/astrid/src/com/todoroo/astrid/welcome/HelpInfoPopover.java deleted file mode 100644 index c1740324f..000000000 --- a/astrid/src/com/todoroo/astrid/welcome/HelpInfoPopover.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (c) 2012 Todoroo Inc - * - * See the file "LICENSE" for the full license governing this code. - */ -package com.todoroo.astrid.welcome; - -import greendroid.widget.QuickAction; -import greendroid.widget.QuickActionWidget; - -import java.util.List; - -import android.app.Activity; -import android.content.Context; -import android.graphics.Rect; -import android.view.View; -import android.view.ViewGroup; -import android.widget.FrameLayout; -import android.widget.TextView; - -import com.timsu.astrid.R; -import com.todoroo.astrid.utility.AstridPreferences; - -/** - * Displays a popover with some help text for first time users. - * - * @author Sam Bosley - * - */ -public class HelpInfoPopover extends QuickActionWidget { - - public static HelpInfoPopover showPopover(final Activity activity, final View parent, - final int textId, OnDismissListener dismissListener) { - final HelpInfoPopover toShow = new HelpInfoPopover(activity, textId); - if (dismissListener != null) { - toShow.setOnDismissListener(dismissListener); - } - parent.postDelayed(new Runnable() { - @Override - public void run() { - try { - toShow.show(parent); - } catch (Exception e) { - //Activity wasn't running or something like that - } - } - }, 250); - return toShow; - } - - private final boolean tablet; - private int measuredWidth; - - private HelpInfoPopover(Context context, int textId) { - super(context); - setContentView(R.layout.help_popover); - TextView message = (TextView)getContentView().findViewById(R.id.gdi_message); - message.setText(textId); - setFocusable(false); - setTouchable(true); - measuredWidth = -1; // uninitialized - tablet = AstridPreferences.useTabletLayout(context); - } - - @Override - protected void populateQuickActions(List quickActions) { - // Do nothing - } - - @Override - protected int getArrowLeftMargin(View arrow) { - if (measuredWidth > 0) { - return (measuredWidth - arrow.getMeasuredWidth()) / 2; - } - - if (tablet) { - return mRect.width() / 4; - } - return mRect.width() / 2; - } - - @Override - protected int getShowAtX() { - if (measuredWidth > 0) { - return mRect.left + (mRect.width() - measuredWidth) / 2; - } - return mRect.left; - } - - @Override - protected void onMeasureAndLayout(Rect anchorRect, View contentView) { - contentView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); - contentView.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); - - int rootHeight = contentView.getMeasuredHeight(); - measuredWidth = contentView.getMeasuredWidth(); - - int offsetY = getArrowOffsetY(); - int dyTop = anchorRect.top; - int dyBottom = getScreenHeight() - anchorRect.bottom; - - boolean onTop = (dyTop > dyBottom); - int popupY = (onTop) ? anchorRect.top - rootHeight + offsetY : anchorRect.bottom - offsetY; - - setWidgetSpecs(popupY, onTop); - } - -}