Is there a possibility to change the shadow direction of Y offset?
Right now I have the following layout
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container"
android:layout_width="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity" tools:ignore="MergeRootFrame" >
<TextView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginBottom="200dp"
android:elevation="5dp"
android:translationZ="5dp"
android:background="@android:color/darker_gray"
android:layout_gravity="bottom"/>
<TextView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginBottom="100dp"
android:elevation="4dp"
android:translationZ="5dp"
android:background="@android:color/holo_blue_dark"
android:layout_gravity="bottom"/>
<TextView
android:layout_width="match_parent"
android:layout_height="200dp"
android:elevation="3dp"
android:translationZ="5dp"
android:background="@android:color/holo_green_dark"
android:layout_gravity="bottom"/>
</FrameLayout>
that reproduces the result on the left, but I like to achieve the effect on the right image
Can anyone point me directions how to do that?
The
setOutlineProvider
method onView
added in API 21 may be of use. From the documentation:It allows customized shape for sure, but I'm not 100% certain that shadow direction can be altered.