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

Consider padding drawing ripple effect #78

Open
altairmizuchi opened this issue Apr 18, 2017 · 1 comment
Open

Consider padding drawing ripple effect #78

altairmizuchi opened this issue Apr 18, 2017 · 1 comment

Comments

@altairmizuchi
Copy link

Hi!!!
I have next problem.
I want to have ripple effect for button with custom shape. I wish I could use ripple xml but I need to support some older than 21 api devices. I also want my button to have height same to standard one.
Because I use custom background I need to specify its size to 36dp manually. BUT... Google recommends to have 48 height touch zone for button with 36 dp.

If I do next

    <com.balysv.materialripple.MaterialRippleLayout
        app:mrl_rippleOverlay="true"
        android:id="@+id/btn_clear_all_btn"
        android:layout_width="wrap_content"
        android:layout_height="36dp"
        android:layout_alignTop="@id/fab_add_item"
        android:layout_centerHorizontal="true"
        app:mrl_rippleRoundedCorners="18dp">
        <TextView
            style="?attr/buttonStyle"
            android:background="@drawable/cashdup_button_black"
            android:text="@string/clear_all_weeks"
            android:layout_width="wrap_content"
            android:layout_height="match_parent" />
    </com.balysv.materialripple.MaterialRippleLayout>

I will have "incorrect" touch zone with 36 dp height.
But if I do next

    <com.balysv.materialripple.MaterialRippleLayout
        app:mrl_rippleOverlay="true"
        android:id="@+id/btn_clear_all_btn"
        android:paddingBottom="6dp"
        android:paddingTop="6dp"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:layout_alignTop="@id/fab_add_item"
        android:layout_centerHorizontal="true"
        app:mrl_rippleRoundedCorners="16dp">
        <TextView
            style="?attr/buttonStyle"
            android:background="@drawable/cashdup_button_black"
            android:text="@string/clear_all_weeks"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </com.balysv.materialripple.MaterialRippleLayout>

I will have incorrect ripple animation out of border.
That's why it would be great if MaterialRippleLayout considers specified paddings for animation.

Thank you!

@Splitters
Copy link

I agree. That would make things easier.

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

2 participants