diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 722b2aaee..49c2a287f 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -401,6 +401,14 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene }); } }); + //选中监听 + mTabButtonGroup.addTabButtonGroupChangeListener((view, index) -> { + if (index==0){ + floatBanner.setVisibility(View.VISIBLE); + }else { + floatBanner.setVisibility(View.GONE); + } + }); } /** @@ -1048,6 +1056,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene } else { mViewPager.setCurrentItem(event.getPage()); mTabButtonGroup.setCurPosition(event.getPage()); + if (event.getPage()==0){ + floatBanner.setVisibility(View.VISIBLE); + }else { + floatBanner.setVisibility(View.GONE); + } } }