Android ViewPager adapter modify other pages -
i have viewpager uses fragmentstatepageradapter. each page fragment. pages contains linearlayout (lltags) default visible.
if user clicks on page (main layout of fragment), linearlayout must invisible (works) other linearlayouts (lltags in other pages) needs changed too.
if click, visibility of linearlayouts changed off pages exept previous , next. because getitem adapter isn't called next/previous item again. how can notify these pages.
ps: have newinstance method , public void settagslayoutvisible(boolean) changing visibility adapter.
next , previous loaded , adapter not going call creation.
take quick try @ this, in adapter function if fragment loaded returns objects. add this
if(mymap.containskey(position)) { livestreamfullscreenfragment lfsf = (livestreamfullscreenfragment) mymap.get(position)); lfsf.setshowtags(mshowtags); return lfsf; } else { and in fragment class
public void setshowtags(boolean showtags) { mshowtags = showtags; if(!mshowtags) { lllivestreamtags.setvisibility(view.gone); } } hope helps , enjoy work.
Comments
Post a Comment