源码简介
Side-Menu的更好的一种体现方式
源码运行截图
源码片段:
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- if (savedInstanceState == null) {
- contentFragment = ContentFragment.newInstance(R.drawable.content_music);
- getSupportFragmentManager().beginTransaction()
- .add(R.id.content_frame, contentFragment)
- .commit();
- }
- drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
- drawerLayout.setScrimColor(Color.TRANSPARENT);
- linearLayout = (LinearLayout) findViewById(R.id.left_drawer);
- linearLayout.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- drawerLayout.closeDrawers();
- }
- });
- setActionBar();
- createMenuList();
- viewAnimator = new ViewAnimator<>(this, list, contentFragment, drawerLayout, this);
- }
源码链接:http://down.51cto.com/data/1983055