Android-Flipviewcontroller use (JAR file)

Source: Internet
Author: User

1. The role of this control

Like a book, a control that can page up and down,

2.

The effect of page up and down

3. Implementing the Code

  

Package Com.duguang.baseanimation.ui.flip;import Android.app.activity;import Android.content.context;import Android.os.bundle;import Android.view.layoutinflater;import Android.view.view;import Android.view.ViewGroup; Import Android.widget.baseadapter;import Com.aphidmobile.flip.flipviewcontroller;import Com.duguang.baseanimation.r;public class Issue51activity extends Activity {/** * like a book-flipping control that can page up and down, detailed code can be viewed * https:// github.com/openaphid/android-flip/blob/master/flipview/fliplibrary/src/com/aphidmobile/flip/ Flipviewcontroller.java * */private flipviewcontroller flipview;@ overrideprotected void onCreate (Bundle savedInstance State) {super.oncreate (savedinstancestate); Settitle (r.string.activity_title); flipView = new Flipviewcontroller (th is);//Set Adapter Flipview.setadapter (new Mybaseadapter (this)); Setcontentview (FlipView);} @ overrideprotected void Onresume () {super.onresume (); Flipview.onresume ();} @ overrideprotected void OnPause () {super.onpause (); Flipview.onpaUse ();} Custom adapter private static class Mybaseadapter extends Baseadapter {//tools ready to load layout private Layoutinflater inflater;private Myba Seadapter (Context context) {Inflater = Layoutinflater.from (context);} @ overridepublic int GetCount () {return 3;} @ overridepublic Object getItem (int position) {return position;} @ overridepublic long getitemid (int position) {return position;}                              @ overridepublic View GetView (int position, view Convertview,                              ViewGroup parent) {if (position = = 0) {return inflater.inflate (R.layout.activity_flip_page1, NULL);} else if (position = = 1) {return inflater.inflate (r.layout.activity_flip_page2, null);} else {return inflater.inflate (r.layout.activity_flip_page3, NULL);}}}}

Android-Flipviewcontroller use (JAR file)

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.