ShapeOfView
ShapeOfView copied to clipboard
Button elevation + animation elevation lost in DiagonalView
When I try to put a <Button>
in the <DiagonalView>
this one lost his elevation and on press elevation animation
<com.github.florent37.shapeofview.shapes.DiagonalView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:shape_diagonal_angle="10"
app:shape_diagonal_position="bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="@dimen/button_regular_height"
android:layout_gravity="center"
android:layout_marginStart="@dimen/button_regular_margin_start"
android:layout_marginTop="@dimen/margin_regular_x2"
android:layout_marginEnd="@dimen/button_regular_margin_end"
android:layout_marginBottom="@dimen/margin_regular_x2"
android:background="@drawable/button_white"
android:ellipsize="end"
android:enabled="false"
android:maxLines="1"
android:textAppearance="@style/DarwinBoldButton"
android:textColor="@color/brightGray" />
</LinearLayout>
</com.github.florent37.shapeofview.shapes.DiagonalView>
If I move the whole <LinearLayout><Button>
out of <DiagonalView>
, it's working correctly.
Any idea?
PS: Here is my custom button background
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:color="#33000000"
tools:targetApi="lollipop">
<item
android:id="@android:id/mask"
android:gravity="center">
<shape>
<solid android:color="@color/white" />
<corners android:radius="@dimen/corner_radius_regular" />
</shape>
</item>
<item android:id="@android:id/background">
<shape>
<solid android:color="@color/white" />
<corners android:radius="@dimen/corner_radius_regular" />
</shape>
</item>
</ripple>