Animation effect of the GridView and ListView controls Scrub
----------------------------------------------------------------------------
Learning content from GitHub excellent source
Https://github.com/twotoasters/JazzyListView
Contains two parts:
1, Jazzygridview
2, Jazzylistview
Animation effect of the GridView and ListView controls Scrub
Download (only source src files and res/values/attrs.xml files, all source code on github download):
Http://yunpan.cn/cFJxMmVWq8Bb7 (Extract code: c808)
First, the use of the steps:
1, prepare the operation:
Copy the Res/values/attrs.xml file from the source to the appropriate location for your personal project
Copy the COM folder under the SRC folder in the source to the SRC folder of your personal project
You can see that the effects folder is animated by sliding, and another four Java class files
Second, the use of Jazzygridview
1. Add the Jazzygridview control to the layout file (note the label name Package name + class name):
<Com.twotoasters.jazzylistview.JazzyGridView Android:id="@+id/gridview"Android:numcolumns="3"android:gravity="Center"Android:layout_width="match_parent"Android:layout_height="wrap_content"></com.twotoasters.jazzylistview.JazzyGridView>
2, and normal use of the same as the GridView control. Adding data sources and Adapters
Private Gridviewadapter adapter; Private list<string> list; Private Jazzygridview GridView;
New Arraylist<string>(); for (int1; i++) { List.add (i+""); } New Gridviewadapter (this, list); = (Jazzygridview) Findviewbyid (R.id.gridview); Gridview.setadapter (adapter);
3, animate the Jazzygridview control, the parameters can be any one of the animation effect classes under the Effects folder in the Java file, we can also modify the animation effect for the actual demand based on the source author
Gridview.settransitioneffect (new helixeffect ());
4.:
Third, the use of Jazzylistview
1. Add the Jazzylistview control to the layout file (note the label name Package name + class name):
<com.twotoasters.jazzylistview.jazzylistview
Android:id= "@+id/list"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"/>
2, and normal use of the same as the ListView control. Adding data sources and Adapters
Private list<string> List;
Private Jazzylistview ListView;
Private arrayadapter<string> adapter;
ListView = (Jazzylistview) Findviewbyid (r.id.list);
List = new arraylist<string> ();
for (int i=0;i<30;i++) {
List.add ("+i+", "list item");
}
adapter = new Arrayadapter<string> (this, r.layout.item,list);
Listview.setadapter (adapter);
3, animate the Jazzylistview control, the parameters can be any one of the animation effect classes under the Effects folder in the Java file
Listview.settransitioneffect (New Twirleffect ());
4.:
Use of Jazzygridview and Jazzylistview