0

I have to deal with two ActionBar displayed at the same time on the screen. There's an onClickListener on the second one which allows the second activity to be shown on the entire screen after a click, with an animation. I have no idea how to do that. Two activies, fragments? ViewPager? ... Absolutely no idea. Could you please help me? Thank you.

EDIT : here is a picture of what I wanna achieve http://romainpellerin.eu/so_android.png You have to see it in order to clearly understand my problem.

Romain Pellerin
  • 2,470
  • 3
  • 27
  • 36

1 Answers1

1

Definitely Fragments.

When you bring in the second fragment specify animations in the fragment transaction before you commit it.

There are tons of tutorials online. Here some more help.

Android Fragments and animation

SDK http://developer.android.com/guide/components/fragments.html

how to make fragments backwards compatible http://developer.android.com/training/basics/fragments/support-lib.html

Community
  • 1
  • 1
WIllJBD
  • 6,144
  • 3
  • 34
  • 44
  • Thanks, but is it possible to have a second ActionBar even if using Fragments? And what about FragmentActivity ? Should I use it? – Romain Pellerin Jul 13 '13 at 21:09
  • 1
    Don't bother with the action bar, implement your own. Its not that hard to create a horizontal linear layout, and add some images/text, and then using filters make it show which one is active or being touched. In fact I go through this almost every time some lame client wants their app to be a clone of ios, when android can do so much more. It is also much more highly customizable. – WIllJBD Jul 13 '13 at 21:13
  • I've seen it, thanks. Last question before programming, what about FragmentActivity, should I use them? – Romain Pellerin Jul 13 '13 at 21:18
  • 1
    It depends, Fragment Activity is part of the support library, for if you want it to be backward compatible behind 4.0, otherwise activity will do fine. – WIllJBD Jul 13 '13 at 21:21
  • I can't figure out how to make the fragment fill the whole screen, even the actionbar. Any idea? – Romain Pellerin Jul 14 '13 at 01:53
  • Get the patent activities handle on the Window and set is flags to full screen. You could prbly google this, as well as how to hide the action bar. – WIllJBD Jul 14 '13 at 04:53
  • Sorry, when I say 'whole screen' screen I mean the ActionBar too, not the status bar. The only thing I've found about hidding ActionBar is .hide() which is not what I'm looking for. – Romain Pellerin Jul 14 '13 at 15:33
  • Well if you forwent the action bar, and used linear layouts instead (made your own), you could easily just display on top of it, switch out what is in it, or just say layout.setvisibility(View.GONE); In my opinion the action bar is worthless. try requestWindowFeature(Window.FEATURE_NO_TITLE); or something along those lines. – WIllJBD Jul 14 '13 at 17:07