Restored context menu items explicit placing facility.

This commit is contained in:
Igor B. Poretsky 2016-04-30 16:32:49 +03:00
parent b8043f739c
commit 06043980a7
2 changed files with 6 additions and 2 deletions

View file

@ -55,7 +55,11 @@ public class ContextMenuAdapter {
}
public void addItem(ContextMenuItem item) {
items.add(item);
try {
items.add(item.getPos(), item);
} catch (IndexOutOfBoundsException ex) {
items.add(item);
}
}
public ContextMenuItem getItem(int position) {

View file

@ -198,7 +198,7 @@ public class ContextMenuItem {
private int mLayout = INVALID_ID;
private boolean mLoading = false;
private boolean mIsCategory = false;
private int mPosition = INVALID_ID;
private int mPosition = -1;
private String mDescription = null;
private ContextMenuAdapter.ItemClickListener mItemClickListener = null;
private ContextMenuAdapter.OnIntegerValueChangedListener mIntegerListener = null;