The first one is basically a regular ActionBar
with a layout containing two custom spinners side by side, right below it. The bottom shadow of the ActionBar
has been disabled by setting windowContentOverlay
attribute to null by adding the following line to the app theme (in res/values/styles):
<item name="android:windowContentOverlay">@null</item>
You'll also notice a subtle shadow at the bottom of the layout containing spinners. That can be added by creating a shape drawable in xml with a gradient. This gradient is set to have a 270 degree angle with a dark start color and a light/transparent end color (can include a middle color as well). And now, you can add a View
under the spinner container as follows:
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@drawable/<name_of_your_shape_drawable"/>
Now, coming to the second picture, we can clearly see that ActionBar
overlay mode is enabled, which can be done by adding the following line to the app theme:
<item name="android:windowActionBarOverlay">true</item>
If you only want a specific activity to have an overlay ActionBar
, then you can add the following line before setContentView
:
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
Moving on to the parallax effect of the top image, you'll first need to get the yScroll value in pixels of the scrollview/listview, and then simply translate that ImageView
by half of the yScroll value:
imageView.setTranslationY((float) (yScroll/2));
Refer to this link in order to get scroll values from a ScrollView
: http://cyrilmottier.com/2013/05/24/pushing-the-actionbar-to-the-next-level/
I'm not so sure about the last bit which involves an animation to color the ActionBar
when the title layout touches it. Might have to look into the source code for that.