Source Address: Http://git.oschina.net/zj2012zy/Android-Demo/tree/master/AndroidDemo/setpregister
The effect is as follows:
Basic ideas:
1. Define an abstract class:
Registerstep
1 Public Abstract classRegisterstep {2 Public InterfaceOnnextactionlistener {3 voidnext ();4 5 voidsubmit ();6 }7 8 protectedActivity mactivity;9 protectedContext Mcontext;Ten One PrivateView Mcontentview; A - protectedOnnextactionlistener Monnextactionlistener; - the PublicRegisterstep (activity activity, View Contentview) { -Mactivity =activity; -Mcontext =(Context) mactivity; -Mcontentview =Contentview; + - initviews (); + initevents (); A } at - Public Abstract voidinitviews (); - - Public Abstract voidinitevents (); - - Public Abstract Booleanvalidate (); in - PublicView Findviewbyid (intID) { to returnMcontentview.findviewbyid (ID); + } - the Public voiddoprevious () { * $ }Panax Notoginseng - Public voidDonext () { the monnextactionlistener.submit (); + } A the Public voidnextanimation () { + - } $ $ Public voidpreanimation () { - - } the - Public voidSetonnextactionlistener (Onnextactionlistener onnextactionlistener) {WuyiMonnextactionlistener =Onnextactionlistener; the } -}
The Submit function in interface Onnextactionlistener is used to perform set-up data submission.
Validate, which is used to detect whether the set value of each step is legal.
2, define a series of specific sub-categories, stepone,steptwo ....
See source for details.
To pick up-android when a new user is registered, a multi-step framework for filling in user profiles