1. Implementation results
Button normal effect
Button-click Validity Period
2. Now the pivot effect button
The button for implementing the perspective effect focuses on two points:
1. Button background implementation
2. Button font color implementation
2.1 button background implementation
The Perspective color is mainly added to the background color value.AlphaValue
Button perspective Implementation
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:useLevel="false"> <padding android:left="10px" android:top="5px" android:bottom="5px" android:right="10px" /> <corners android:radius="10px" /> <solid android:color="#7fE6E6E6" ></solid></shape>
Button click background implementation
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:useLevel="false"> <padding android:left="10px" android:top="5px" android:bottom="5px" android:right="10px"/> <corners android:radius="10px"/> <solid android:color="#0040FF"></solid></shape>
2.2 button font color implementation
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:state_window_focused="false" android:color="@color/black"></item><item android:state_pressed="true" android:color="@color/white"></item><item android:color="@color/black"></item></selector>
Small application to achieve the above effect [Sports weight calculator]
Application: http://www.appchina.com/soft_detail_275718_0_10.html
Http://static.apk.hiapk.com/html/2012/05/576305.html market for Android