How to detect that the DrawerLayout started opening?

前端 未结 7 2068
旧时难觅i
旧时难觅i 2020-12-01 04:52

So I have tabs that I want to hide when the Navigation Drawer starts opening. The code I have hides them when it finished opening, but it\'s not what I want

相关标签:
7条回答
  • 2020-12-01 05:47

    fookwood answer did not work for me but slight modification in the if statment did the trick)

    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, navigationDrawerLayout, topToolbar,
                    R.string.open_drawer, R.string.close_drawer) {
                @Override public void onDrawerStateChanged(int newState) {
                    if (newState == DrawerLayout.STATE_SETTLING && !navigationDrawerLayout.isDrawerOpen(navigationDrawerView)) {
                        // this where Drawer start opening
    }
    
    0 讨论(0)
提交回复
热议问题