Android-----------ad Picture Carousel control

Source: Internet
Author: User

Banner Advertising Image Carousel control, support infinite loop and a variety of themes, you can flexibly set the carousel style, animation, carousel and switch time, location, picture loading frame!

There are ads in many Android apps, and I've used many times to write a blog post.

Let's take a look:

Using you can directly introduce dependencies:

Compile

It is recommended not to introduce, directly import the library package, because you can modify the relevant code inside, change to the effect you want.

The way to use it is simple:

< com . Youth.banner.Banner        android:id= "@+id/banner"        android:layout_width= " Match_parent "        android:layout_height=" 240DP "/>

Banner.setdelaytime (4000); // scrolling Time         // default is Circle_indicator         banner.setimages (Util.showlistimgurl ())                . Setbannertitles (Util.showlisttitle ())                . Setbannerstyle (Bannerconfig.not_indicator)                . Setimageloader (new  Glideimageloader ())                . Setonbannerlistener (this)                . Start ();

Related settings:

Banner Banner =(Banner) Findviewbyid (R.id.banner); //setting the banner styleBanner.setbannerstyle (Bannerconfig.circle_indicator_title); //set up the picture loaderBanner.setimageloader (NewGlideimageloader ()); //set up a collection of picturesbanner.setimages (images); //Set Banner animation effectsbanner.setbanneranimation (transformer.depthpage); //Sets the title collection (when the banner style has the title displayed)Banner.setbannertitles (titles); //Set automatic carousel, default to TrueBanner.isautoplay (true); //Set the carousel timeBanner.setdelaytime (1500); //Set the indicator position (when there is an indicator in banner mode)banner.setindicatorgravity (Bannerconfig.center); //Banner The last call when the Set method is completeBanner.start ();

Obfuscation code:

# Glide Code of Confusion  Public class Implements Com.bumptech.glide.module.GlideModule  Public enum com.bumptech.glide.load.resource.bitmap.imageheaderparser$** {  *[] $VALUES;    public *;} # Banner's Obfuscation code class com.youth.banner.** {    *;}

For more related properties, see: Https://github.com/youth5201314/banner

Code Portal

Android-----------ad Picture Carousel control

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.