From da3aca16bfe4113bf3eef46fc69a59a4aa4201c0 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 17 Feb 2012 15:10:18 -0800 Subject: [PATCH] Go directly to comments page when clicking a comment notification --- .../astrid/actfm/EditPeopleControlSet.java | 4 ---- .../todoroo/astrid/actfm/TagViewFragment.java | 20 +++++++------------ .../astrid/activity/TaskListActivity.java | 4 ++++ 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java index e0b26ba10..e4294e46e 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java @@ -21,7 +21,6 @@ import android.graphics.Color; import android.support.v4.app.Fragment; import android.text.TextUtils; import android.util.DisplayMetrics; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; @@ -570,9 +569,6 @@ public class EditPeopleControlSet extends PopupControlSet { selected = 0;*/ return true; } - else { - Log.d("Edit People control set", "Does not equal task rabbit"); - } userJson = item.user; } } diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java index cbffc6d49..3a7b10159 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java @@ -172,8 +172,9 @@ public class TagViewFragment extends TaskListFragment { dataLoaded = true; } - String tag = getActivity().getIntent().getStringExtra(EXTRA_TAG_NAME); - long remoteId = getActivity().getIntent().getLongExtra(EXTRA_TAG_REMOTE_ID, 0); + TaskListActivity activity = (TaskListActivity) getActivity(); + String tag = activity.getIntent().getStringExtra(EXTRA_TAG_NAME); + long remoteId = activity.getIntent().getLongExtra(EXTRA_TAG_REMOTE_ID, 0); if(tag == null && remoteId == 0) return; @@ -198,17 +199,10 @@ public class TagViewFragment extends TaskListFragment { super.onNewIntent(intent); -// if (intent.getBooleanExtra(TOKEN_START_ACTIVITY, false)) { -// getView().findViewById(R.id.activity).postDelayed(new Runnable() { -// @Override -// public void run() { -// Intent i = new Intent(getActivity(), TagUpdatesActivity.class); -// i.putExtra(EXTRA_TAG_DATA, tagData); -// startActivity(i); -// AndroidUtilities.callOverridePendingTransition(getActivity(), R.anim.slide_left_in, R.anim.slide_left_out); -// } -// }, 500); -// } + if (activity.getIntent().getBooleanExtra(TOKEN_START_ACTIVITY, false)) { + activity.getIntent().removeExtra(TOKEN_START_ACTIVITY); + activity.showComments(); + } } @Override diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index 58094f5cd..1fd14eeba 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -344,6 +344,10 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener commentsButton.setBackgroundResource(tv.data); } + public void showComments() { + commentsButton.performClick(); + } + @Override public void onBackPressed() { // manage task edit visibility