2

I need an effect like this PAGE, i have read this link and i interested in this effect (you can see that in this VIDEO LINK), here an example of the sequence:

enter image description here

I need two things:

  1. Create/implement the same slide/transition effect between two fragments
  2. How can i do to put the image under the action bar and the top bar?

Thanks, any ideas would be appreciated.

(EDIT 11/03/2014) I just need an example for overlay the actionbar and the NOTIFICATION BAR too (this have a symbol of battery, time, wifi, etc).

Gaston Flores
  • 2,457
  • 3
  • 23
  • 42

5 Answers5

3

I found a solution, These links helped me:

See the following image:

enter image description here

Here is the source code of this example: Github Link

Thanks.

Community
  • 1
  • 1
Gaston Flores
  • 2,457
  • 3
  • 23
  • 42
1

you might want to add this code to your onCreate method before you call setContentView method of your activity, also I think that what is show in the video is transition between activities and not fragments, this code works for all APIs >=11

getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
            getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00ffffff")));
            getSupportActionBar().setDisplayShowTitleEnabled(false);

this will make your actionbar transparent, but you will still be able to see that little shadow on the bottom of actionBar, as for the status bar, i am not sure if transparent statusbar is possible an OS version uder the API L. For the animation, you can create your own animations via XML files, this code is for slide in animation from the right side of the screen

<?xml version="1.0" encoding="utf-8"?>
<set>
    <translate xmlns:android="http://schemas.android.com/apk/res/android"
        android:fromXDelta="100%"
        android:toXDelta="0%"
        android:interpolator="@android:anim/decelerate_interpolator"
        android:duration="200"/>
</set>   

i hope some of this code will help you

1

I had the same Problem but this library Solved My problem Completely There is no need to Invent The wheel Again. :D just use it and enjoy

https://github.com/ManuelPeinado/FadingActionBar

Omid Heshmatinia
  • 5,089
  • 2
  • 35
  • 50
  • Thanks for your post, but I need change the color of statusbar, this library only can change the actionbar style. For now I use this solution http://stackoverflow.com/a/21135763/1563878 and https://github.com/Takhion/android-extendedactionbar, but use of these in the same time is so complex in my context because my application have fragments that must use only one. For example, in the main fragment, the actionbar and statusbar must be red background, in the detail fragment I must put an image below to actionbar and statusbar, so, these two must be transparent – Gaston Flores Nov 05 '14 at 12:47
1

To overlay the status bar you can customize your app's theme including:

<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>

Finally, you can use a ToolBar with more flexible UI to replace the ActionBar:

https://developer.android.com/reference/android/support/v7/widget/Toolbar.html

You can also customize the status bar color in Lollipop:

http://developer.android.com/training/material/theme.html#StatusBar

André Mion
  • 843
  • 9
  • 10
0
  1. Set fragment animation with: http://developer.android.com/reference/android/app/FragmentTransaction.html#setCustomAnimations(int, int, int, int)

  2. You can do it in your app theme using parameter:

    < item name="windowActionBarOverlay">true

More details with example: https://developer.android.com/training/basics/actionbar/overlaying.html

nister
  • 171
  • 6
  • Thanks for the link, but I need a bit more, in this link shows that overlay the actionbar but i need overlay the topbar too (time,battery, wifi, signal). I try to find one simple example, but i do not lucky. I have put the post like a bounty. Thanks – Gaston Flores Nov 03 '14 at 03:16