From 8af17252834e16f475699725ace41015d2e74b64 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Thu, 18 Oct 2012 17:54:59 -0700 Subject: [PATCH] Stubs for handling the user status clicked button --- .../todoroo/astrid/people/PersonViewFragment.java | 5 +++++ .../todoroo/astrid/activity/TaskListActivity.java | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java index c2e982256..a98f14277 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java @@ -99,6 +99,11 @@ public class PersonViewFragment extends TaskListFragment { return parent; } + public void handleStatusButtonClicked() { + // TODO: Handle this for real + System.err.println("Status for " + user.getDisplayName() + " is " + user.getValue(User.STATUS)); //$NON-NLS-1$ //$NON-NLS-2$ + } + @Override protected void addSyncRefreshMenuItem(Menu menu, int themeFlags) { if(actFmPreferenceService.isLoggedIn()) { diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index 2565e0058..290aedb23 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -49,6 +49,7 @@ import com.todoroo.astrid.core.CustomFilterExposer; import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.people.PeopleFilterMode; +import com.todoroo.astrid.people.PersonViewFragment; import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.service.StatisticsService; import com.todoroo.astrid.service.ThemeService; @@ -140,6 +141,16 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener } }; + private final OnClickListener friendStatusClickListener = new OnClickListener() { + @Override + public void onClick(View v) { + TaskListFragment tlf = getTaskListFragment(); + if (tlf == null || !(tlf instanceof PersonViewFragment)) + return; + ((PersonViewFragment) tlf).handleStatusButtonClicked(); + } + }; + /** * @see android.app.Activity#onCreate(Bundle) */ @@ -170,6 +181,7 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener createMainMenuPopover(); mainMenu.setOnClickListener(mainMenuClickListener); commentsButton.setOnClickListener(commentsButtonClickListener); + personStatus.setOnClickListener(friendStatusClickListener); Bundle extras = getIntent().getExtras(); if (extras != null)