Horizontal Recyclerview inside Dialog android -


i working on android app , want show dialog when click on button. want show images in dialog box scrolled horizontally. so, have used recyclerview horizontal scroll orientation it's linear layout manager. images shown 1 image @ time, watch second image in dialog box, need scroll horizontally. want images shown till wrap_content width , start scrolling horizontally.

please check below code create dialog box :

dialog reactionsdialog = new dialog(mcontext, r.style.theme_customdialog);                     reactionsdialog.requestwindowfeature(window.feature_no_title);                     reactionsdialog.setcancelable(true);                     reactionsdialog.getwindow().setbackgrounddrawable(contextcompat.getdrawable(mcontext,                             r.drawable.shape));                     recyclerview reactionsrecyclerview = new recyclerview(mcontext);                     reactionsdialog.setcontentview(reactionsrecyclerview);                     reactionsdialog.show();                      linearlayoutmanager linearlayoutmanager = new linearlayoutmanager(mcontext);                     linearlayoutmanager.setorientation(linearlayoutmanager.horizontal);                     reactionsrecyclerview.sethasfixedsize(true);                     reactionsrecyclerview.setlayoutmanager(linearlayoutmanager);                     reactionsrecyclerview.setitemanimator(new defaultitemanimator()); 

it shows first image in full width of dialog box , see next image, need scroll horizontal. please check below attached screenshot reference.

enter image description here

enter image description here

what should working. lot in advanced.

make content view width wrap content.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -