Cleanup and polish to quick add bar in people view

pull/14/head
Sam Bosley 13 years ago
parent cc76e6d178
commit 1896fe89c7

@ -29,7 +29,7 @@ import com.todoroo.astrid.data.User;
public class PeopleFilterExposer extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
FilterListItem[] listAsArray = prepareFilters(context);
FilterListItem[] listAsArray = prepareFilters();
Intent broadcastIntent = new Intent(PeopleFilterAdapter.BROADCAST_SEND_PEOPLE_FILTERS);
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_RESPONSE, listAsArray);
@ -37,7 +37,7 @@ public class PeopleFilterExposer extends BroadcastReceiver {
context.sendBroadcast(broadcastIntent);
}
private FilterListItem[] prepareFilters(Context context) {
private FilterListItem[] prepareFilters() {
TodorooCursor<User> users = PluginServices.getUserDao().query(Query.select(User.PROPERTIES)
.orderBy(Order.asc(User.NAME), Order.asc(User.EMAIL)));
try {

@ -4,12 +4,19 @@ import android.view.View;
import android.view.ViewGroup;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.astrid.activity.TaskListFragment;
import com.todoroo.astrid.dao.UserDao;
import com.todoroo.astrid.data.User;
public class PersonViewFragment extends TaskListFragment {
public static final String EXTRA_USER_ID_LOCAL = "user_local_id"; //$NON-NLS-1$
@Autowired UserDao userDao;
private User user;
@Override
protected View getListBody(ViewGroup root) {
ViewGroup parent = (ViewGroup) getActivity().getLayoutInflater().inflate(R.layout.task_list_body_person, root, false);
@ -20,10 +27,18 @@ public class PersonViewFragment extends TaskListFragment {
return parent;
}
@Override
protected void initializeData() {
super.initializeData();
if (extras.containsKey(EXTRA_USER_ID_LOCAL))
user = userDao.fetch(extras.getLong(EXTRA_USER_ID_LOCAL), User.PROPERTIES);
}
@Override
protected void setupQuickAddBar() {
super.setupQuickAddBar();
quickAddBar.setUsePeopleControl(false);
quickAddBar.getQuickAddBox().setHint(getString(R.string.TLA_quick_add_hint_assign, user.getDisplayName()));
}
}

@ -139,7 +139,7 @@
<!-- Quick Add Edit Box Hint-->
<string name="TLA_quick_add_hint">Add a task</string>
<!-- Quick Add Edit Box Hint for assigning -->
<!-- Quick Add Edit Box Hint for assigning (%s -> name)-->
<string name="TLA_quick_add_hint_assign">Tap to assign %s a task</string>
<!-- Notification Volumne notification-->

Loading…
Cancel
Save