Android Studio Phase 19th-Glin architecture

Source: Internet
Author: User

This write is loader the package after the network architecture, on this basis, the API to everyone, add some custom controls, easy to develop ~ Continuous Update ~ Thank you ~

650) this.width=650; "Width=" src= "Http://s5.51cto.com/wyfs02/M02/8A/0F/wKiom1glNrHSGwoDAANYFnM4RR4495.jpg" Title= "13_conew1.jpg" alt= "Wkiom1glnrhsgwodaanyfnm4rr4495.jpg"/>

Address: Https://github.com/geeklx/MakeJarAAR

Api:

1.GlideUtil: Picture cache frame, support rounded corners

1glideutil.display (Mainactivity.this, Iv1, "http://img0.bdstatic.com/img/image/touxiang01.jpg", Glideoptionsfactory.get (GlideOptionsFactory.Type.RADIUS));//2glideoptions glideoptions = new Glideoptions ( R.drawable.pic_head, R.drawable.pic_head, 300); Glideutil.display (Mainactivity.this, Iv2, "http://img0.bdstatic.com/img/image/touxiang01.jpg", glideoptions);// 3glideutil.display (Mainactivity.this, Iv3, "http://img0.bdstatic.com/img/image/touxiang01.jpg");

2. Request Network method: Donewwork ("id");

Private void donewwork (string user_id)  {    demoparams p =  new demoparams (user_id);     net.build (Demoapi.class, getclass (). GetName ()) . Getdemomodel (Paramsutils.just (P)). Enqueue (new callback<demomodel> ()  {          @Override         public void  Onresponse (Result<demomodel> result)  {             if  (Result.isok ())  {                 demomodel = new demomodel ();                 demoModel_item = new  Demomodel_item ();                 demomodel_list = neW arraylist<demomodel_list> ();                 demomodel_item = result.getresult (). Getpage_info ();                 demoModel_list =  Result.getresult (). Getfood_list ();                 if  (Demomodel_list != null && demomodel_list.size ()  > 0)  {                     //has data status                      //handle your own logic   If you don't   God can't save you ~                      Toastutil.showtoastcenter ("with data");                } else {                      //No data status                      //can use a custom layout   reference:http://liangxiao.blog.51cto.com/3626612/1851105                      Toastutil.showtoastcenter ("no Data");                 }            } else  {                //No network status                  Toastutil.showtoastcenter ("No network status   please re-Request the server! ");            }         }    });}

Not to be continued ....

650) this.width=650; "Width=" src= "Http://s1.51cto.com/wyfs02/M00/8A/0B/wKioL1glORTgHZmnAAWi8RwxbhI926.png" Title= "Shining044.png" alt= "Wkiol1glortghzmnaawi8rwxbhi926.png"/>


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

Android Studio Phase 19th-Glin architecture

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.