Bug 1192814 - PanelRecyclerView: Create context menu for header. r=jonalmeida

--HG--
extra : commitid : 3ZR71TUm0z9
extra : amend_source : 31aa338f8f9feb89fc3bb1cc53df15787c2b03ad
This commit is contained in:
Sebastian Kaspari 2015-08-11 10:22:39 +02:00
parent 49d9cc3879
commit 465f8b80ff

View File

@ -143,11 +143,26 @@ public class PanelRecyclerView extends RecyclerView
@Override
public boolean onItemLongClicked(RecyclerView recyclerView, int position, View v) {
if (viewConfig.hasHeaderConfig()) {
if (position == 0) {
final HomeConfig.HeaderConfig headerConfig = viewConfig.getHeaderConfig();
final HomeContextMenuInfo info = new HomeContextMenuInfo(v, position, -1);
info.url = headerConfig.getUrl();
info.title = headerConfig.getUrl();
contextMenuInfo = info;
return showContextMenuForChild(this);
}
position--;
}
Cursor cursor = adapter.getCursor();
cursor.moveToPosition(position);
contextMenuInfo = contextMenuInfoFactory.makeInfoForCursor(recyclerView, position, -1, cursor);
return showContextMenuForChild(PanelRecyclerView.this);
return showContextMenuForChild(this);
}
private class PanelSpanSizeLookup extends GridLayoutManager.SpanSizeLookup {