From b2b28b6bd3befb8195cef4f0339d11c222fc4e64 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Wed, 1 Feb 2012 14:28:27 -0800 Subject: [PATCH] Fixed a bug where you wouldn't show up in members header if you were owner of the tag. Added unassigned filter to members header also --- .../todoroo/astrid/actfm/TagViewFragment.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java index 15c11b579..7d32aae45 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewFragment.java @@ -284,10 +284,18 @@ public class TagViewFragment extends TaskListFragment { addImageForMember(membersView, member); } // Handle creator + JSONObject owner; if(tagData.getValue(TagData.USER_ID) != 0) { - JSONObject owner = new JSONObject(tagData.getValue(TagData.USER)); - addImageForMember(membersView, owner); + owner = new JSONObject(tagData.getValue(TagData.USER)); + } else { + owner = ActFmPreferenceService.thisUser(); } + addImageForMember(membersView, owner); + + JSONObject unassigned = new JSONObject(); + unassigned.put("id", Task.USER_ID_UNASSIGNED); + unassigned.put("name", getActivity().getString(R.string.actfm_EPA_unassigned)); + addImageForMember(membersView, unassigned); } } catch (JSONException e) { e.printStackTrace(); @@ -307,7 +315,11 @@ public class TagViewFragment extends TaskListFragment { AsyncImageView image = new AsyncImageView(getActivity()); image.setLayoutParams(new LinearLayout.LayoutParams((int)(50 * displayMetrics.density), (int)(50 * displayMetrics.density))); + image.setDefaultImageResource(R.drawable.icn_default_person_image); + if (member.optLong("id", Task.USER_ID_SELF) == Task.USER_ID_UNASSIGNED) + image.setDefaultImageResource(R.drawable.icn_anyone); + image.setScaleType(ImageView.ScaleType.FIT_XY); try { final long id = member.getLong("id");