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

Clicking on a button which is close to another one causes animation to be played on both buttons #30

Open
zunjae opened this issue Jan 24, 2016 · 3 comments

Comments

@zunjae
Copy link

zunjae commented Jan 24, 2016

Only happens if they both have shadow enabled and are close to each other

example code:

        <info.hoang8f.widget.FButton
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="Hello"
            fbutton:buttonColor="#8074feb4"
            fbutton:shadowEnabled="true"
            fbutton:shadowHeight="8dp"
            android:textColor="#FF000000"
            fbutton:cornerRadius="0dp"/>

    <info.hoang8f.widget.FButton
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_width="wrap_content"
            android:text="World"
            fbutton:buttonColor="#8074feb4"
            fbutton:shadowEnabled="true"
            fbutton:shadowHeight="8dp"
            android:textColor="#FF000000"
            fbutton:cornerRadius="0dp"/>
@Dhaval2404
Copy link

Happen with me too.

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:orientation="horizontal">

        <info.hoang8f.widget.FButton
            android:id="@+id/btn_to_date"
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:text="From Date"
            android:textAppearance="?android:attr/textAppearanceButton"
            android:textColor="@color/white"
            fbutton:buttonColor="@color/orange_500"
            fbutton:cornerRadius="3dp"
            fbutton:shadowColor="@color/grey_700"
            fbutton:shadowEnabled="true"
            fbutton:shadowHeight="2dp" />

        <View
            android:layout_width="10dp"
            android:layout_height="1dp" />

        <info.hoang8f.widget.FButton
            android:id="@+id/btn_from_date"
            android:layout_width="120dp"
            android:layout_height="wrap_content"
            android:text="To Date"
            android:textAllCaps="true"
            android:textAppearance="?android:attr/textAppearanceButton"
            android:textColor="@color/white"
            fbutton:buttonColor="@color/orange_500"
            fbutton:cornerRadius="3dp"
            fbutton:shadowColor="@color/grey_700"
            fbutton:shadowEnabled="true"
            fbutton:shadowHeight="2dp" />

</LinearLayout>

@rzdchen
Copy link

rzdchen commented Sep 22, 2016

Happen with me too.
How to deal with it?

fbutton

@Testencio
Copy link

Testencio commented Feb 5, 2017

The problem isn't they are near. The problem comes with setPadding at onTouchEvent. You have both buttons at same LinearLayout and setting padding to one flatbutton moves the other one due to padding. This move effect seems like a click but isn't a real click, just your shadow is hidding because is moving out the linearlayout.

You can "fix" it if you set this buttons in a RelativeLayout or inside a FrameLayout

Hope it helps!

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

4 participants