Android-convenientbanner is a general-purpose banner control that lets you easily achieve your ad head effect. Support Infinite loop, can set auto page turn and time (and very smart, touch the finger to pause the page, leaving the automatic start page. You can also set the interface OnPause do not auto-page, after Onresume continue to automatically page),
and offers a variety of flip effects. Compared to other banner controls, most of them need to make changes to the source code to load the network pictures, or to help you integrate not the image cache library you need. And this library can make you happy with code cleanliness, do not need to modify the library source code you can use any of your favorite network picture library to cooperate. Customize your holder, achieve more complex interface, not necessarily the picture page, any other control page can also.
Operating effect:
Full Source: http://www.itlanbao.com/code/20150907/10000/100508.html
Various page flipping effects
Transformerlist.add (Transformer.DefaultTransformer.getClassName ());
Transformerlist.add (Transformer.AccordionTransformer.getClassName ());
Transformerlist.add (Transformer.BackgroundToForegroundTransformer.getClassName ());
Transformerlist.add (Transformer.CubeInTransformer.getClassName ());
Transformerlist.add (Transformer.CubeOutTransformer.getClassName ());
Transformerlist.add (Transformer.DepthPageTransformer.getClassName ());
Transformerlist.add (Transformer.FlipHorizontalTransformer.getClassName ());
Transformerlist.add (Transformer.FlipVerticalTransformer.getClassName ());
Transformerlist.add (Transformer.ForegroundToBackgroundTransformer.getClassName ());
Transformerlist.add (Transformer.RotateDownTransformer.getClassName ());
Transformerlist.add (Transformer.RotateUpTransformer.getClassName ());
Transformerlist.add (Transformer.StackTransformer.getClassName ());
Transformerlist.add (Transformer.ZoomInTransformer.getClassName ());
Transformerlist.add (Transformer.ZoomOutTranformer.getClassName ());
Transformerarrayadapter.notifydatasetchanged ();
}
/**
* Get resource ID by file name example: Getresid ("icon", R.drawable.class);
*
* @param variableName
* @param c
* @return
*/
public static int Getresid (String variableName, class<?> c) {
try {
Field IDfield = C.getdeclaredfield (variableName);
Return Idfield.getint (IDfield);
} catch (Exception e) {
E.printstacktrace ();
return-1;
}
}
Start Auto-Paging
@Override
protected void Onresume () {
Super.onresume ();
Start Auto-Paging
Convenientbanner.startturning (5000);
}
Stop Auto-Paging
@Override
protected void OnPause () {
Super.onpause ();
Stop paging
Convenientbanner.stopturning ();
}
Click the Toggle Effect
@Override
public void Onitemclick (adapterview<?> adapterview, view view, int position, long ID) {
String name = Transformerlist.get (position);
Transformer Transformer = transformer.valueof (name);
Convenientbanner.setpagetransformer (transformer);
}
}
Android-convenientbanner easy to achieve ad head effect