|
|
@ -69,6 +69,8 @@ public class FilterListActivity extends ListFragment {
|
|
|
|
|
|
|
|
|
|
|
|
public static final String TAG_FILTERLIST_FRAGMENT = "filterlist_fragment";
|
|
|
|
public static final String TAG_FILTERLIST_FRAGMENT = "filterlist_fragment";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String TOKEN_LAST_SELECTED = "lastSelected";
|
|
|
|
|
|
|
|
|
|
|
|
// -- extra codes
|
|
|
|
// -- extra codes
|
|
|
|
//public static final String SHOW_BACK_BUTTON = "show_back"; //$NON-NLS-1$
|
|
|
|
//public static final String SHOW_BACK_BUTTON = "show_back"; //$NON-NLS-1$
|
|
|
|
|
|
|
|
|
|
|
@ -92,12 +94,15 @@ public class FilterListActivity extends ListFragment {
|
|
|
|
@Autowired ExceptionService exceptionService;
|
|
|
|
@Autowired ExceptionService exceptionService;
|
|
|
|
|
|
|
|
|
|
|
|
protected FilterAdapter adapter = null;
|
|
|
|
protected FilterAdapter adapter = null;
|
|
|
|
private boolean mDualFragments;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final RefreshReceiver refreshReceiver = new RefreshReceiver();
|
|
|
|
private final RefreshReceiver refreshReceiver = new RefreshReceiver();
|
|
|
|
|
|
|
|
|
|
|
|
private OnFilterItemClickedListener mListener;
|
|
|
|
private OnFilterItemClickedListener mListener;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean mDualFragments;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int mSelectedIndex;
|
|
|
|
|
|
|
|
|
|
|
|
/* ======================================================================
|
|
|
|
/* ======================================================================
|
|
|
|
* ======================================================= initialization
|
|
|
|
* ======================================================= initialization
|
|
|
|
* ====================================================================== */
|
|
|
|
* ====================================================================== */
|
|
|
@ -175,10 +180,11 @@ public class FilterListActivity extends ListFragment {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
onNewIntent(getActivity().getIntent());
|
|
|
|
AstridWrapperActivity activity = (AstridWrapperActivity) getActivity();
|
|
|
|
|
|
|
|
mDualFragments = activity.isMultipleFragments();
|
|
|
|
Fragment tasklistFrame = getFragmentManager().findFragmentByTag(TaskListActivity.TAG_TASKLIST_FRAGMENT);
|
|
|
|
if (mDualFragments)
|
|
|
|
mDualFragments = (tasklistFrame != null) && tasklistFrame.isInLayout();
|
|
|
|
mSelectedIndex = activity.getIntent().getIntExtra(TOKEN_LAST_SELECTED, 0);
|
|
|
|
|
|
|
|
onNewIntent(activity.getIntent());
|
|
|
|
|
|
|
|
|
|
|
|
if (mDualFragments) {
|
|
|
|
if (mDualFragments) {
|
|
|
|
// In dual-pane mode, the list view highlights the selected item.
|
|
|
|
// In dual-pane mode, the list view highlights the selected item.
|
|
|
@ -299,6 +305,8 @@ public class FilterListActivity extends ListFragment {
|
|
|
|
R.layout.filter_adapter_row, false);
|
|
|
|
R.layout.filter_adapter_row, false);
|
|
|
|
setListAdapter(adapter);
|
|
|
|
setListAdapter(adapter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
adapter.setLastSelected(mSelectedIndex);
|
|
|
|
|
|
|
|
|
|
|
|
registerForContextMenu(getListView());
|
|
|
|
registerForContextMenu(getListView());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -310,12 +318,12 @@ public class FilterListActivity extends ListFragment {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onListItemClick(ListView parent, View v, int position, long id) {
|
|
|
|
public void onListItemClick(ListView parent, View v, int position, long id) {
|
|
|
|
// if (mDualFragments)
|
|
|
|
if (mDualFragments)
|
|
|
|
// {
|
|
|
|
getListView().setItemChecked(position, true);
|
|
|
|
// setSelectedChild(groupPosition, childPosition, false);
|
|
|
|
|
|
|
|
// setItemChecked((int) getSelectedPosition(), true);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
Filter item = adapter.getItem(position);
|
|
|
|
Filter item = adapter.getItem(position);
|
|
|
|
|
|
|
|
mSelectedIndex = position;
|
|
|
|
|
|
|
|
adapter.setLastSelected(mSelectedIndex);
|
|
|
|
|
|
|
|
getActivity().getIntent().putExtra(TOKEN_LAST_SELECTED, mSelectedIndex);
|
|
|
|
mListener.onFilterItemClicked(item);
|
|
|
|
mListener.onFilterItemClicked(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|