Use of Jazzygridview and Jazzylistview

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.