how to create smooth navigation drawer

前端 未结 5 493
醉话见心
醉话见心 2021-01-30 09:45

I am using this example for navigation drawer. When clicking on of item of left drawer listview it shows some images but drawerLayout closes not smoothly.

What should I

5条回答
  •  猫巷女王i
    2021-01-30 10:13

    Works perfect

    private class DrawerItemClickListener implements ListView.OnItemClickListener {
            @Override
            public void onItemClick(AdapterView parent, View view, final int position, long id) {
                mDrawerLayout.closeDrawer(mDrawerList);
                mDrawerLayout.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        selectItem(position);
                    }
                }, 300);
            }
        }
    

提交回复
热议问题