0

I am new in android, i want to create a sliding action bar menu, i searched in google and i found tutorial about this. but in more tutorials used FrameLayout in xml file for create layout and UI program. My question is: Do i use LinearLayout or RelativeLayout instead of FrameLayout? and another question: Do i use sliding action bar menu for devices with android 2.2+? Which version of android can used this?

in google map app, we show action bar with touch left side of device and drag from left to right side. how can i implement this? Do implement of this is like sliding action bar menu in this site?(sliding action bar menu) i need which version of android for implemented this?

Thanks and sorry for my bad english

user3209380
  • 169
  • 1
  • 2
  • 14

2 Answers2

0

I am sorry I did not get your first question. Please frame the question with a better English so that I may respond to it.

The SlidingMenu option is available for Android 2.2+ only (and can be used for any version thereafter). You should not be bothered about supporting lower OS as I have never seen a device running on them.

The Google Map, Gmail and Hangouts application uses the Navigation drawer provided by Google. You may read about it here: http://developer.android.com/design/patterns/navigation-drawer.html. However, it only supports the drawer opening from the left hand side. So, if you are looking for a drawer opening from both the sides, you should go with SlidingMenu. Although there are a few issues that might occur while using GoogleMaps with SlidingMenu, it shouldn't really affect the app if you optimise it well.

rahulritesh
  • 860
  • 1
  • 9
  • 17
  • Thanks for quick reply. i mean of first question is : when i implement Layout for sliding menu, we used, FrameLayout and ListView in xml, see menu.xml in this site(http://stackoverflow.com/questions/11234375/how-did-google-manage-to-do-this-slide-actionbar-in-android-application). Do i use LinearLayout or RelativeLayout instead of FrameLayout? FrameLayout usually used for using Fragment, in my app i cant use Fragment. Do you understand what i say? Thank you :) – user3209380 Jan 24 '14 at 06:51
  • It isn't really necessary to put a fragment on a `FrameLayout`. You can just put a view on it and load them. However, since one of them is on top of the other, you'll need to use FrameLayout, for sure. A `FrameLayout` is used to place one layout on top of another. Hope that explains everything you needed. – rahulritesh Jan 24 '14 at 06:57
  • But in android site not say, we should use FrameLayout in main content,"The main content view (the FrameLayout above) " say main content is a view, not say FrameLayout. how can i put view in framelayout? Thanks – user3209380 Jan 24 '14 at 07:28
  • I want use sliding menu in Activity A. and when i click in item of menu,i open a dialog in Activity A. and if i open Activity B, i dont want have sliding menu. with this pattern, i think, i use LinearLayout or RelativeLayout instead of FrameLayout. we use FrameLayout becuase i want change contentView when click on the item of sliding menu. my idea is true? – user3209380 Jan 24 '14 at 07:37
  • I read tutorial in android site, but describe this with toggle button in top page, but i want implement this like google map, i mean drage and touch left to right, menu option shows. for this,how can i implement this? Thanks – user3209380 Jan 24 '14 at 09:08
0
Do i use LinearLayout or RelativeLayout instead of FrameLayout? 

No you can use FrameLayout only for DrawerLayout For details see http://developer.android.com/training/implementing-navigation/nav-drawer.html

Do i use sliding action bar menu for devices with android 2.2+? 
Which version of android can used this?

Yes , you can use SherlockNavigationDrawer library for that

https://github.com/nicolasjafelle/SherlockNavigationDrawer

keshav
  • 3,235
  • 1
  • 16
  • 22
  • Thanks for reply. Why i use library? i want to write this by me not use library. Can i write this by me? Why i cant use LinearLayout instead of FrameLayout? – user3209380 Jan 24 '14 at 06:53
  • see http://developer.android.com/training/implementing-navigation/nav-drawer.html – keshav Jan 24 '14 at 06:56