reddit/IndicatorFastScroll

Question Java

Closed this issue · 10 comments

Hello guys,

My project is old so it's use Java.
I'm trying to use your libray but I have some issue

issue

It's seem that I cannot initialize the item.
Can anyone had this issue ?

I have try an another way but I still have issue

Issue2

Thanks in advance : )

I think you have two options:

  1. Enable Java 8 desugaring by adding this to your build.gradle:
android {
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

This will let you use Java 8 language features, like lambdas and method references.

  1. Instantiate an anonymous inner class (new Function1() { ... }) instead of a lambda.

I'd recommend option 1.

Steve,

I have already enable Java 8. All my lambdas functions are working like this one

image

For the option 2, I have tried to instiate anonymous inner class by I annot found wich one to use. I have this error for example:

image

Thanks for the tips anyway : )

Somebody else ?

Will try on a Java project and see what's up.

Maybe I need to enable Kotlin library for my project ?

Are you able to use Kotlin types like Function1?

I don't understand : (
Use it like a variable ?

image

If that class can't be imported, it's likely because our library isn't sharing the dependency. Sorry about that. I'll check and fix that.
In the meantime, adding the Kotlin standard library as a dependency will temporarily fix it.

Yeahhhh : D

After adding Kotlin in my Project it's working !!

image

Thanks a lot for your help. It's really a perfect library ! I was searching for it for a long time : )

Very glad to hear it! Will fix the dependency issue in an update.

This should be fixed in version 1.2.1. Let me know if you still see any issues.