Drifting Android
($)
Copyright NOTICE: Welcome attention to public number: ytf0422 http://blog.csdn.net/ytfunnysite/article/details/77152513
method of Use;
Configuration Engineering
First, we clone the project locally on GitHub;
Https://github.com/facebook/shimmer-android
Next we import the required module in Android studio, i.e. shimmer-android;
Finally, you need to configure your own Gradle to reference the module:
dependencies {
Compile project (': Shimmer-android ')
}
XML layout file that will need to add special effects to the control with Shimmerframelayout package
<!--Membership Level-<Com.facebook.shimmer.ShimmerFrameLayoutAndroid:id="@+id/shimmercontent"Android:layout_width="Wrap_content"android:layout_height="Wrap_content" ><ButtonAndroid:id="@+id/btn_huiyuanlevel"Android:layout_width="60DP"android:layout_height= "18DP" android:layout_marginleft= "10DP" android:layout_margintop= "2DP" android:layout_torightof= "@id/huiyan_name" android:background= "@drawable/qingtonghuiyuanbg" android:gravity=" center "android:text=< Span class= "Hljs-value" > "bronze Member" android:textcolor= "#648728" android:textsize= "12sp"/> </ COM.FACEBOOK.SHIMMER.SHIMMERFRAMELAYOUT>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
Setting the startup Glow Word configuration property in Java code
Shimmerframelayout shimmerframelayout = (shimmerframelayout) Findviewbyid (R. ID. shimmercontent); Shimmerframelayout. Setrepeatmode (Objectanimator. REVERSE); Shimmerframelayout. Setduration (1000); Shimmerframelayout. Setdropoff (0.4f) ;//set the width of the light shimmerframelayout.setbasealpha ((float) Span class= "Hljs-number" >0.9) ;//set the transparency of places without illumination//Shimmerframelayout.setintensity (6) ;//set the intensity of light//Set the shape of light, Linear Shimmerframelayout.setmaskshape (Shimmerframelayout.startshimmeranimation () Span class= "Hljs-comment",
- Previous ListView animate item (displacement, gradient, rotation, etc.)
- Next Android Development bulk modify the specified string to remove excess red lines from the pasted copy code
Android Development to create Flash control effects