diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java index 844b7c8da..1fa022a50 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PeopleFilterExposer.java @@ -8,6 +8,7 @@ import android.content.ComponentName; import android.content.ContentValues; import android.content.Context; import android.content.Intent; +import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import com.timsu.astrid.R; @@ -19,6 +20,7 @@ import com.todoroo.andlib.sql.Join; import com.todoroo.andlib.sql.Order; import com.todoroo.andlib.sql.Query; import com.todoroo.andlib.sql.QueryTemplate; +import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.astrid.actfm.sync.ActFmSyncService; import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.Filter; @@ -30,6 +32,7 @@ import com.todoroo.astrid.data.Metadata; import com.todoroo.astrid.data.TagData; import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.User; +import com.todoroo.astrid.service.ThemeService; import com.todoroo.astrid.tags.TagService; public class PeopleFilterExposer extends BroadcastReceiver { @@ -120,13 +123,16 @@ public class PeopleFilterExposer extends BroadcastReceiver { tagsWithMembers.close(); } + boolean isTablet = AndroidUtilities.isTabletSized(context); + int themeFlags = isTablet ? ThemeService.FLAG_FORCE_LIGHT : 0; + String title = context.getString(R.string.actfm_my_shared_tasks_title); QueryTemplate template = new QueryTemplate().join(Join.inner(Metadata.TABLE.as("mtags"), Criterion.and(Task.ID.eq(Field.field("mtags." + Metadata.TASK.name)), Field.field("mtags." + Metadata.KEY.name).eq(TagService.KEY), Field.field("mtags." + TagService.TAG.name).in(names)))); - FilterWithUpdate filter = new FilterWithUpdate(title, title, template, null); + FilterWithCustomIntent filter = new FilterWithCustomIntent(title, title, template, null); filter.customTaskList = new ComponentName(ContextManager.getContext(), PersonViewFragment.class); @@ -134,6 +140,9 @@ public class PeopleFilterExposer extends BroadcastReceiver { extras.putBoolean(PersonViewFragment.EXTRA_HIDE_QUICK_ADD, true); filter.customExtras = extras; + filter.listingIcon = ((BitmapDrawable)context.getResources().getDrawable( + ThemeService.getDrawable(R.drawable.icn_menu_friends, themeFlags))).getBitmap(); + return filter; } } diff --git a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java index d1e1792ef..dc6ad6800 100644 --- a/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/people/PersonViewFragment.java @@ -4,7 +4,6 @@ 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; import com.timsu.astrid.R; @@ -37,27 +36,15 @@ public class PersonViewFragment extends TaskListFragment { @Autowired ActFmPreferenceService actFmPreferenceService; - protected View taskListView; - private User user; - @Override - protected View getListBody(ViewGroup root) { - ViewGroup parent = (ViewGroup) getActivity().getLayoutInflater().inflate(R.layout.task_list_body_person, root, false); - - taskListView = super.getListBody(parent); - parent.addView(taskListView); - - 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); } - ((TextView)taskListView.findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); + ((TextView) getView().findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); } @Override @@ -105,7 +92,7 @@ public class PersonViewFragment extends TaskListFragment { private void refreshData(final boolean manual) { if (user != null) { - ((TextView)taskListView.findViewById(android.R.id.empty)).setText(R.string.DLG_loading); + ((TextView) getView().findViewById(android.R.id.empty)).setText(R.string.DLG_loading); syncService.synchronizeList(user, manual, new ProgressBarSyncResultCallback(getActivity(), this, R.id.progressBar, new Runnable() { @@ -115,7 +102,7 @@ public class PersonViewFragment extends TaskListFragment { ContextManager.getContext().sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH)); else refresh(); - ((TextView)taskListView.findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); + ((TextView) getView().findViewById(android.R.id.empty)).setText(getEmptyDisplayString()); } })); } diff --git a/astrid/res/layout/task_list_body_person.xml b/astrid/res/layout/task_list_body_person.xml deleted file mode 100644 index 27b5e4946..000000000 --- a/astrid/res/layout/task_list_body_person.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - -