Android分类侧滑菜单:Side Menu

ybw8 9年前

Side Menu 是用于安卓的分类侧滑菜单。

示例代码:

    ViewAnimator viewAnimator =   new ViewAnimator<>(ActionBarActivity.this,                                      new ArrayList<Resourceble>(),  (LinearLayout) findViewById(R.id.left_drawer),   contentFragment, drawerLayout);      //to open menu you have to override ActionBarDrawerToggle method               @Override              public void onDrawerSlide(View drawerView, float slideOffset) {                                super.onDrawerSlide(drawerView, slideOffset);                                if (slideOffset > 0.6 && viewAnimator.getLinearLayout().getChildCount() == 0)                      viewAnimator.showMenuContent();              }            public void onDrawerClosed(View view) {                                  super.onDrawerClosed(view);                  viewAnimator.getLinearLayout().removeAllViews();                  viewAnimator.getLinearLayout().invalidate();              }

Android分类侧滑菜单:Side Menu  

项目主页:http://www.open-open.com/lib/view/home/1433400190260