android - Move the Floating Action Button along with the swiped tab -
let me brief idea , i'm aiming achieve,
idea have swipe tab 3 tabs in , each tab screen being represented seperate fragment class. did using "it.neokree:materialtabs:0.11" library , working well. created floating action button (fab) using "com.oguzdev:circularfloatingactionmenu:1.0.2" library.
now what i'm trying achieve fix fab fragment in center tab , when swipe screen go previous or next tab fab should slide out along tab fragment in , should slide in along center tab screen when swipe it.
i have worked on till , i'm able hide view in other fragments , show again in center fragment overriding setuservisiblehint()
method in each fragment class this.
@override public void setuservisiblehint(boolean isvisibletouser) { super.setuservisiblehint(isvisibletouser); if (isvisibletouser) { view tempview = getactivity().findviewbyid(r.id.myfab); tempview.setvisibility(view.invisible); } }
but problem want fab slide out , in along center tab other views in tab's fragment class does, fab vanishing , reappearring.
in way want fab exclusive center tab , should fixed it.
i tried defining fab inside center fragment class doesn't seem make difference. advice , suggestion helpful. in advance
if want show floatingactionbutton in middle/single tab, can add fab in fragment instead of adding in activity in fragments added.
Comments
Post a Comment