首先需要将轮播图的依赖导入
implementation 'com.github.xiaohaibin:XBanner:1.6.1'
接下来就是在项目目录下bulidgradle中导入(allprojects)
//Xbanner第一步 maven { url 'https://jitpack.io' }
ext { // Sdk and tools minSdkVersion = 17 //和model 下的build.gradle版本对应 targetSdkVersion = 28 compileSdkVersion = 28 buildToolsVersion = '28.0.2' //support版本 supportVersion = '28.1.0' constraintLayout = '1.0.2' junit = '4.12' testRunner = '1.0.1' espressoCore = '3.0.1' interceptor = "3.11.0" retrofit = '2.3.0' converterGson = '2.3.0' rxandroid = '1.2.1' rxjava = '1.3.0' rxbus = '1.0.6' adapterRxjava = '2.0.2' }
//在轮播图回调方法中调用
@Override public void BannerSuccess(final List<HFragment_Bean_banner.Result