I found few days ago, amazing project, called https://github.com/commonsguy/cwac-merge.
I want to make some adapter disabled (non clickable, like headers).
On readme I can read:
You can also extend MergeAdapter to override isEnabled(), so you can control which positions are and are not enabled.
But I cant realize, how can I do this. That is source isEnabled method:
@Override
public boolean isEnabled(int position) {
for (ListAdapter piece : pieces) {
int size=piece.getCount();
if (position<size) {
return(piece.isEnabled(position));
}
position-=size;
}
return(false);
}
This is my adapter's adding code:
adapter.addView(header("Header1"),false);
SimpleAdapter test = new SimpleAdapter(Test.this, top, R.layout.main,
new String[] { ITEM_TITLE2, ITEM_CAPTION2, ITEM_TITLE3 }, new int[] { R.id.id1, R.id.id2, R.id.id3 });
adapter.addAdapter(test1);