Better interactions and copy in the friend status views

pull/14/head
Sam Bosley 13 years ago
parent 8af1725283
commit d18d2b9397

@ -59,8 +59,8 @@ public class PersonViewFragment extends TaskListFragment {
if (user != null) { if (user != null) {
userImage.setUrl(user.getValue(User.PICTURE)); userImage.setUrl(user.getValue(User.PICTURE));
userSubtitle.setText(user.getValue(User.STATUS)); userSubtitle.setText(getUserSubtitleText());
userStatusButton.setText(user.getValue(User.STATUS)); setupUserStatusButton();
} else { } else {
getView().findViewById(R.id.user_header).setVisibility(View.GONE); getView().findViewById(R.id.user_header).setVisibility(View.GONE);
} }
@ -81,6 +81,32 @@ public class PersonViewFragment extends TaskListFragment {
} }
private String getUserSubtitleText() {
String status = user.getValue(User.STATUS);
String userName = user.getDisplayName();
if (User.STATUS_PENDING.equals(status))
return getString(R.string.actfm_friendship_pending, userName);
else if (User.STATUS_BLOCKED.equals(status))
return getString(R.string.actfm_friendship_blocked, userName);
else if (User.STATUS_FRIENDS.equals(status))
return getString(R.string.actfm_friendship_friends, userName);
else if (User.STATUS_OTHER_PENDING.equals(status))
return getString(R.string.actfm_friendship_other_pending, userName);
else return getString(R.string.actfm_friendship_no_status, userName);
}
private void setupUserStatusButton() {
String status = user.getValue(User.STATUS);
userStatusButton.setVisibility(View.VISIBLE);
if (TextUtils.isEmpty(status))
userStatusButton.setText(getString(R.string.actfm_friendship_connect));
else if (User.STATUS_OTHER_PENDING.equals(status))
userStatusButton.setText(getString(R.string.actfm_friendship_accept));
else
userStatusButton.setVisibility(View.GONE);
}
@Override @Override
protected void setUpUiComponents() { protected void setUpUiComponents() {
super.setUpUiComponents(); super.setUpUiComponents();

@ -51,6 +51,22 @@
<!-- Empty list for the "My Shared Tasks" filter --> <!-- Empty list for the "My Shared Tasks" filter -->
<string name="actfm_my_shared_tasks_empty">No shared tasks</string> <string name="actfm_my_shared_tasks_empty">No shared tasks</string>
<!-- ===================== Friendship connections -->
<string name="actfm_friendship_pending">You\'ve sent a friend request to %s!</string>
<string name="actfm_friendship_blocked">You\'ve blocked %s.</string>
<string name="actfm_friendship_friends">You\'re friends with %s! Add tasks for them below.</string>
<string name="actfm_friendship_other_pending">%s wants to be friends with you!</string>
<string name="actfm_friendship_no_status">Connect with %s to share and see activity on public tasks!</string>
<string name="actfm_friendship_connect">Add friend</string>
<string name="actfm_friendship_accept">Accept</string>
<!-- ================================================== TagViewActivity == --> <!-- ================================================== TagViewActivity == -->

Loading…
Cancel
Save