zhzc0x / banner-android Goto Github PK
View Code? Open in Web Editor NEWAndroid Kotlin基于ViewPage2和ViewBinding的轻量级BannerView轮播图;简洁、高效、功能强大,一行代码轻松实现循环轮播,一屏三页任意变,Item样式任意定制扩展
License: Apache License 2.0
Android Kotlin基于ViewPage2和ViewBinding的轻量级BannerView轮播图;简洁、高效、功能强大,一行代码轻松实现循环轮播,一屏三页任意变,Item样式任意定制扩展
License: Apache License 2.0
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
* What went wrong:
Execution failed for task ':banner:generateDebugRFile'.
Configuration `debugRuntimeClasspath` contains AndroidX dependencies, but the `android.useAndroidX` property is not enabled, which may cause runtime issues.
Set `android.useAndroidX=true` in the `gradle.properties` file and retry.
The following AndroidX dependencies are detected:
debugRuntimeClasspath -> androidx.viewpager2:viewpager2:1.1.0-beta02
Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.spring.usekotlin.MainActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
建议添加上这两个配置代码。
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
for (func in itemKClass.functions) {
if (func.name == "inflate" && func.parameters.size == 3) {
val itemBinding = func.call(LayoutInflater.from(parent.context), parent, false)
@Suppress("UNCHECKED_CAST")
return ViewHolder(itemBinding as VB)
}
}
throw IllegalStateException("ViewBinding instantiation exception")
}
上面这段代码,在ViewBinding被混淆后,因为找不到"inflate",所有if (func.name == "inflate" && func.parameters.size == 3) 一直未false,导致一直崩溃了。
建议:
-keepclassmembers class * implements androidx.viewbinding.ViewBinding {
public static ** inflate(...);
}
添加到混淆文件
i use this library in my java project but i couldn't figure out how to add images to it in java ?
you are using data class in a list in kotlin but doing that in java isnt possible.
is there a way to load single items to the view without the need to add a list
kotlin.UninitializedPropertyAccessException: lateinit property numberTv has not been initialized
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.