Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button elevation + animation elevation lost in DiagonalView #61

Open
gm4s opened this issue Jul 2, 2019 · 0 comments
Open

Button elevation + animation elevation lost in DiagonalView #61

gm4s opened this issue Jul 2, 2019 · 0 comments

Comments

@gm4s
Copy link

gm4s commented Jul 2, 2019

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant