ebanx / swipe-button

A button that activates by swipe instead of touch
487 stars 101 forks source link

the width of the Button image is stretched horizontally, until button is enabled and re-disabled #11

Closed simmorsal closed 7 years ago

simmorsal commented 7 years ago

I applied my custom button and background and all works well, until I add disabled and enabled images. doing this makes the button image stretch to almost 45% of the background (without right and left padding). when i run the app it stays at that 45%, but when i enable the button and disable it again, it will get the perfect square form that i gave it, taking about 15%.

If it helps, I have a render issue with this message:

Failed to find the style corresponding to the id -l

leandroBorgesFerreira commented 7 years ago

Hello SIMMORSAL, I didn't understand what you mean by: " I add disabled and enabled images". Can you provide some code so I can reproduce this bug?

An image would be also great!

simmorsal commented 7 years ago

This is my code for creating it in XML:

<com.ebanx.swipebtn.SwipeButton
    android:id="@+id/swipeButton"

    android:layout_below="@id/textView"
    android:layout_width="match_parent"
    android:layout_height="110dp"
    android:layout_marginStart="20dp"
    android:layout_marginEnd="20dp"
    android:paddingTop="28dp"
    android:paddingBottom="28dp"

    app:inner_text="Swipe"
    app:inner_text_top_padding="16dp"
    app:inner_text_bottom_padding="16dp"
    app:inner_text_size="16sp"
    app:inner_text_background="@drawable/swipebuttonbackground"

    app:button_bottom_padding="18dp"
    app:button_top_padding="18dp"
    app:button_left_padding="0dp"
    app:button_right_padding="0dp"
    app:button_background="@drawable/swipebuttonimage"
    app:button_image_disabled="@drawable/swipebuttondisabled"
    app:button_image_enabled="@drawable/swipebuttonenabled"
    app:initial_state="disabled"/>

img

leandroBorgesFerreira commented 7 years ago

Thanks for detailed explanation. You are right, this bug exists. You will try to fix this as soon as I can.

simmorsal commented 7 years ago

You're welcome, and thanks.

leandroBorgesFerreira commented 7 years ago

@SIMMORSAL Hello. This problem is fixed now in the 0.7.0 version. Now you can set the the height and the width of the moving part with the app:button_image_height and app:button_image_width. The collapse animation will set the width to the app:button_image_width value.

simmorsal commented 7 years ago

Thanks for the heads up. I'm gonna use it.

On Jul 28, 2017 1:17 AM, "Leandro Borges Ferreira" notifications@github.com wrote:

@SIMMORSAL https://github.com/simmorsal Hello. This problem is fixed now in the 0.7.0 version. Now you can set the the height and the width of the moving part with the app:button_image_height and app:button_image_width. The collapse animation will set the width to the app:button_image_width value.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ebanx/swipe-button/issues/11#issuecomment-318481645, or mute the thread https://github.com/notifications/unsubscribe-auth/AXrBU-WMUskDWjOA-OunSHtfhwMTsnC4ks5sSPdFgaJpZM4OPOST .

leandroBorgesFerreira commented 7 years ago

You are welcome!