Android Studio Phase 13th-Recycleview all usage

Source: Internet
Author: User

Combine all the scene usages of the Hongyang and loader Recycleview:

1.ListView List Paging usage core code:

private void Createadapter () {madapter = new RecycleAdapter1 (this);    Linearlayoutmanager mLinearLayoutManager1 = new Linearlayoutmanager (this);    Mlinearlayoutmanager1.setorientation (orientationhelper.vertical);    Recyclerview.setlayoutmanager (MLinearLayoutManager1); Recyclerview.setadapter (Madapter);}

Effects such as:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/87/F9/wKiom1flARPDMtE5ABpuOKO98Tk420.gif "title=" f1.gif "alt=" Wkiom1flarpdmte5abpuoko98tk420.gif "/>

2.GridView List Paging usage core code:

private void Createadapter () {madapter = new RecycleAdapter2 (this);    Recyclerview.setlayoutmanager (New Gridlayoutmanager (this, 2)); Recyclerview.setadapter (Madapter);}

Effects such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/F5/wKioL1fk_13AHQlRABnF9lC5vAo823.gif "title=" f2.gif "alt=" Wkiol1fk_13ahqlrabnf9lc5vao823.gif "/>

3.ListView list Addheadandaddfooter usage Core code:

    private void createadapter ()  {         ll_header =  (LinearLayout)  view.inflate (this,                 r.layout.activity_addheader, null);         ll_footer =  (LinearLayout)  view.inflate (this,                 r.layout.activity_ Addfooter, null);        madapter = new  RecycleAdapter3 (This);        linearlayoutmanager  Mlinearlayoutmanager1 = new linearlayoutmanager (This);         mlinearlayoutmanager1.setorientation (orientationhelper.vertical);         recyclerview.setlayoutmanager (MlinearlayOutManager1);//        recyclerview.setadapter (Madapter);     }    private void addadapter ()  {         mheaderandfooterwrapper = new headerandfooterwrapper (MAdapter);         mheaderandfooterwrapper.addheaderview (Ll_header);         mheaderandfooterwrapper.addfootview (Ll_footer);         recyclerview.setadapter (mheaderandfooterwrapper);     }

Effects such as:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/F9/wKiom1fk_3zgS3dfABg_ri8v8yc613.gif "title=" f3.gif "alt=" Wkiom1fk_3zgs3dfabg_ri8v8yc613.gif "/>

4.GridView list Addheadandaddfooter usage Core code:

   private void createadapter ()  {         ll_header =  (LinearLayout)  view.inflate (this,                 r.layout.activity_addheader, null);         ll_footer =  (LinearLayout)  view.inflate (this,                 r.layout.activity_ Addfooter, null);        madapter = new  RecycleAdapter4 (this);         recyclerview.setlayoutmanager (new  Gridlayoutmanager (this, 2));//        recyclerview.setadapter ( Madapter);     }    private void addadapter ()  {         mheadeRandfooterwrapper = new headerandfooterwrapper (Madapter);         mheaderandfooterwrapper.addheaderview (Ll_header);         Mheaderandfooterwrapper.addfootview (Ll_footer);         Recyclerview.setadapter (mheaderandfooterwrapper);     }

Effects such as:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/F9/wKiom1flAHywNJFkAByJ-Pe18hk218.gif "title=" f5.gif "alt=" Wkiom1flahywnjfkabyj-pe18hk218.gif "/>

Attached: Provides the use of several common controls:

Usage of 1.SwipeReFreshLayout:

Onrefresh ();

Usage of 2.ShapeLoading:

SHOWLOADINGUTIL.SHOWPROGRESSDIALOG2 (Mainactivity4.this, "Loading ...");

This time is good enough ~ Ah da ~ work Fat Home ~ Eat Rice ~

Address: Https://github.com/geeklx/MyApplication/tree/master/p010_recycleviewall



This article is from the "Liangxiao Technology Center" blog, please be sure to keep this source http://liangxiao.blog.51cto.com/3626612/1855928

Android Studio Phase 13th-Recycleview all usage

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.