Skip to content

Support unlimited picture rotation BannerLayout, the minimum implementation of the code banner

License

Notifications You must be signed in to change notification settings

7449/BannerLayout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

06881dc · Feb 3, 2023

History

99 Commits
Feb 3, 2023
Feb 3, 2023
Feb 3, 2023
Feb 3, 2023
Feb 3, 2023
Feb 3, 2023
Feb 3, 2023
Aug 19, 2020
May 26, 2017
Nov 29, 2022
Nov 28, 2022
Nov 29, 2022
Jan 19, 2017
Oct 26, 2016
Nov 29, 2022
Nov 29, 2022
Feb 3, 2023

Repository files navigation

BannerLayout

allprojects {
	repositories {
		maven { url 'https://jitpack.io' }
	}
}

implementation 'com.github.7449.BannerLayout:banner:release.version'
implementation 'com.github.7449.BannerLayout:banner-page:release.version'
implementation 'com.github.7449.BannerLayout:banner-shadow:release.version'
implementation 'com.github.7449.BannerLayout:banner-transformer:release.version'

api

banner.resource(items,boolean)

banner.start()
banner.stop()
banner.release()

banner.delayTime(Long)
banner.touchMode(boolean)
banner.duration(Int)
banner.setTransformer(PageTransformer)

banner.getItem(position)
banner.itemCount
banner.checkViewPager

banner.setOnBannerImageLoader()

banner.addOnItemClickListener()
banner.removeOnBannerClickListener()

banner.addOnBannerResourceChangedListener()
banner.removeOnBannerResourceChangedListener()

banner.doOnPageScrolled()
banner.doOnPageSelected()
banner.doOnPageScrollStateChanged()

banner.addOnBannerChangeListener()
banner.removeOnBannerChangeListener()

ImageLoaderManager

class GlideImageLoader : OnBannerImageLoader<SimpleBannerItem> {
    override fun instantiateItem(
        container: ViewGroup,
        item: SimpleBannerItem,
    ): View {
        return ImageView(container.context).apply {
            Glide.with(container.context)
                .applyDefaultRequestOptions(RequestOptions().centerCrop())
                .load(item.bannerUrl)
                .into(this)
        }
    }
}