Git Product home page Git Product logo

banner-android's People

Contributors

zhzc0x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

banner-android's Issues

缺少android.useAndroidX=true配置以及 AndroidManifest 缺少 android:exported="true", 编译失败。

  1. 因为缺少 android.useAndroidX=true 的 配置导致编译失败,出现如下的编译错误。
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 

  1. 因为 AndroidManifest.xml 的 Activity 缺少 android:exported="true",导致编译失败。出现了如下编译错误日志
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(...);
}
添加到混淆文件

how to set data in the banner View in Java ?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.