Simple side drawer2

12,398 views
12,555 views

Published on

SimpleSideDrawer is an android library to add a drawer navigation into your android application. Simple, high affinity and right weight! Update and you can use the right-side menu.

https://github.com/adamrocker/simple-side-drawer

Published in: Technology
3 Comments
13 Likes
Statistics
Notes
No Downloads
Views
Total views
12,398
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
42
Comments
3
Likes
13
Embeds 0
No embeds

No notes for slide

Simple side drawer2

  1. 1. SimpleSideDrawer v2! adamrocker! adamrocker@gmail.com! Mar 19th, 2013!
  2. 2. What’s this?!Side Drawer library for Android! Easy to use! (Add only 2 lines)! High affinity! (Not need to extend)! Light weight! (Less than 11KByte)! OSS ! (Apache License, v2.0)!
  3. 3. Demo!
  4. 4. Demo!Tap!!
  5. 5. Demo!
  6. 6. Demo!
  7. 7. How to use?!◆ Add only 2 lines!public  void  onCreate(  Bundle  saved  )  {   public  void  onCreate(  Bundle  saved  )  {          super.onCreate(  saved  );          super.onCreate(  saved  );          setContentView(  R.layout.main  );          setContentView(  R.layout.main  );  }          nav  =  new  SimpleSideDrawer(  this  );          nav.setLeCBehindContentView(  R.layout.leC_menu  );   }   Easy  and  high  affinity   to  use  
  8. 8. Right side menu is also available!◆ Add 1 more line!public  void  onCreate(  Bundle  saved  )  {   public  void  onCreate(  Bundle  saved  )  {          super.onCreate(  saved  );          super.onCreate(  saved  );          setContentView(  R.layout.main  );          setContentView(  R.layout.main  );  }          nav  =  new  SimpleSideDrawer(  this  );   !!        nav.setLeCBehindContentView(  R.layout.leC_menu  );   N EW!        nav.setRightBehindContentView(  R.layout.right_menu  );   }  
  9. 9. Light weight library ever!!!◆ less than 11KByte! This PNG file size is around 82KByte!! !
  10. 10. How does it work!◆ Android’s layout system! Application’s layout view ! set with setContentView() method! Above! Decor: the base of layout!
  11. 11. How does it work!◆ Remove the above layout view from the decor! Above! decor = window.getDecorView();! above = decor.getChildAt( 0 );! decor.removeView( above );!
  12. 12. How does it work! SimpleSideDrawer (extends FrameLayout)!◆ Insert the behind layout view! LinearLayout (horizontal)! p! RightBehindBase! =1 ! wra ! w eight w ra p Above! LeftBehindBase! Spacer!
  13. 13. How does it work!◆ Open the left-side menu! RightBehindBase is GONE! ! we ight=1 ! w ra p Above! LeftBehindBase! Spacer!
  14. 14. How does it work! ◆ Open the right-side menu! RightBehindBase! wrap! =1! w eightLeftBehindBase is GONE! Above!
  15. 15. How does it work!◆ Control drag action! Handling the touch event! Overlay!
  16. 16. Structure of SimpleSideDrawer! Original! Using SimpleSideDrawer library!
  17. 17. Thank you!What’s SimpleSideDrawer?!>> Side Drawer library for Android!Features:! Easy to use! (Add only 2 lines)! High affinity! (Not need to extend)! Light weight! (Less than 11KByte)! OSS ! (Apache License, v2.0)! https://github.com/adamrocker/simple-side-drawer!

×