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