Open zunjae opened 8 years ago
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>
Happen with me too. How to deal with it?
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!
Only happens if they both have shadow enabled and are close to each other
example code: