maurycyw / StaggeredGridView

A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.
https://github.com/maurycyw/StaggeredGridViewDemo
1.64k stars 664 forks source link

setOnItemLongClickListener not work's :/ #103

Open bkawakami opened 9 years ago

bkawakami commented 9 years ago

Hey guys :)

Someone know why this event not works?

I don't see the Log and the Dialog


final StaggeredGridView listViewCards = (StaggeredGridView) rootView.findViewById(R.id.listViewCards);
listViewCards.setLongClickable(true);
listViewCards.setOnItemLongClickListener(new StaggeredGridView.OnItemLongClickListener() {
            @Override
            public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
                Logger.e("onItemLongClick");
                new MaterialDialog.Builder(getActivity())
                        .title("Options")
                        .items(R.array.card_options)
                        .itemsCallback(new MaterialDialog.ListCallback() {
                            @Override
                            public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
                            }
                        })
                        .show();
                return true;
            }
        });