android - Open an intermediate view to show grid items -
i have done creating grid view text , images, create grid view once select item current grid view , in user interface show intermediate grid view background grid view visibility.
any appreciated.
create recyclerview gridlayoutmanager.
and configure onclick listener on adapter.
recyclerview recyclerview = (recyclerview) findviewbyid( r.id.recycler_view); recyclerview.additemdecoration(new margindecoration(this)); recyclerview.sethasfixedsize(true); recyclerview.setlayoutmanager(new gridlayoutmanager(this, 2)); recyclerview.setadapter(new numberedadapter(30));
create click listener:
@override public void onbindviewholder( final textviewholder holder, final int position) { if (isheader(position)) { return; } // subtract 1 header final string label = labels.get(position - 1); holder.textview.settext(label); holder.textview.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { toast.maketext(holder.textview.getcontext(), label, toast.length_short).show(); } }); }
Comments
Post a Comment