Simple side drawer2

  • 8,076 views
Uploaded 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. …

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
8,076
On Slideshare
0
From Embeds
0
Number of Embeds
7

Actions

Shares
Downloads
27
Comments
3
Likes
13

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. SimpleSideDrawer v2! adamrocker! adamrocker@gmail.com! Mar 19th, 2013!
  • 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. Demo!
  • 4. Demo!Tap!!
  • 5. Demo!
  • 6. Demo!
  • 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. 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. Light weight library ever!!!◆ less than 11KByte! This PNG file size is around 82KByte!! !
  • 10. How does it work!◆ Android’s layout system! Application’s layout view ! set with setContentView() method! Above! Decor: the base of layout!
  • 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. 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. How does it work!◆ Open the left-side menu! RightBehindBase is GONE! ! we ight=1 ! w ra p Above! LeftBehindBase! Spacer!
  • 14. How does it work! ◆ Open the right-side menu! RightBehindBase! wrap! =1! w eightLeftBehindBase is GONE! Above!
  • 15. How does it work!◆ Control drag action! Handling the touch event! Overlay!
  • 16. Structure of SimpleSideDrawer! Original! Using SimpleSideDrawer library!
  • 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!