From 63d66058989d8eb560e2fac2e721618c7a9a51b8 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Wed, 9 May 2012 13:11:18 -0700 Subject: [PATCH] Updated string for empty list in people view --- .../todoroo/astrid/people/PersonViewFragment.java | 12 ++++++++++-- astrid/res/values/strings-core.xml | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java index d260cc43e..954f9dd2b 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java @@ -2,6 +2,7 @@ package com.todoroo.astrid.people; import android.content.Intent; import android.support.v4.view.Menu; +import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; @@ -51,8 +52,10 @@ public class PersonViewFragment extends TaskListFragment { @Override protected void initializeData() { super.initializeData(); - if (extras.containsKey(EXTRA_USER_ID_LOCAL)) + if (extras.containsKey(EXTRA_USER_ID_LOCAL)) { user = userDao.fetch(extras.getLong(EXTRA_USER_ID_LOCAL), User.PROPERTIES); + ((TextView)taskListView.findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); + } } @Override @@ -106,9 +109,14 @@ public class PersonViewFragment extends TaskListFragment { ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); else refresh(); - ((TextView)taskListView.findViewById(android.R.id.empty)).setText(R.string.TLA_no_items); + ((TextView)taskListView.findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); } })); } + private String getEmptyDisplayString() { + String userName = user != null ? user.getDisplayName() : null; + return TextUtils.isEmpty(userName) ? getString(R.string.TLA_no_items) : getString(R.string.TLA_no_items_person, userName); + } + } diff --git a/astrid/res/values/strings-core.xml b/astrid/res/values/strings-core.xml index 54ce5d625..152922bd4 100644 --- a/astrid/res/values/strings-core.xml +++ b/astrid/res/values/strings-core.xml @@ -100,6 +100,9 @@ You have no tasks! \n Want to add something? + + %s has no\ntasks shared with you + Add-ons