Android-convenientbanner easy to achieve ad head effect

Source: Internet
Author: User

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

Related Article

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.