I am trying to create a custom button on android with animation. I made my ripple and enlarging animation.
In other words when you touch the button it makes ripple effect inside button. After I let go my hand from screen button gets bigger and go back to its own size.
However the ripple effect doesnt work as intended. It doesnt make the button fully black inside but grey.
here is the buttonwith out the animation:
How to make the button fully dark?
<?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#000000"> <item> <shape android:shape="oval"> <solid android:color="#ffffff"/> <corners android:radius="5dp" /> <stroke android:width="10px" android:color="#000000" /> </shape> </item> </ripple>
2.I have also a second question, when I first touch the button the button becames grey. I believe it is the effect of button click and after that with ripple effects it gets darker. I want to get rid of that click effect too. How?
here is my main activity:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="#ffffff" xmlns:android="http://schemas.android.com/apk/res/android" > <Button android:id="@+id/scale" android:layout_width="70dip" android:layout_height="70dip" android:layout_margin="10dp" android:background="@drawable/round_button" android:layout_centerInParent="true" android:gravity="center_vertical|center_horizontal"/> </RelativeLayout>
No comments:
Post a Comment