lisawray / groupie

Groupie helps you display and manage complex RecyclerView layouts.
MIT License
3.67k stars 293 forks source link

README.md uses Depricated code! #390

Open Morons opened 3 years ago

Morons commented 3 years ago

the sample in README.MD the use of kotlinandroidextensions can you update please! sais 'GroupieViewHolder' is deprecated. Kotlin-Android-Extensions is deprecated since 1.4.20, therefore so is the `kotlin-android-extensions` integration in Groupie. Use `groupie-viewbinding` instead.

import com.xwray.groupie.kotlinandroidextensions.Item
import com.xwray.groupie.kotlinandroidextensions.GroupieViewHolder
import kotlinx.android.synthetic.main.song.*

class SongItem(private val song: Song) : Item() {

    override fun getLayout() = R.layout.song

    override fun bind(viewHolder: GroupieViewHolder, position: Int) {
        viewHolder.title.text = song.title
        viewHolder.artist.text = song.artist
    }
}

Library version 2.9.0

qualiky commented 3 years ago

Same here, I'm currently trying to use

implementation 'com.github.lisawray.groupie:groupie:2.0.3' implementation 'com.github.lisawray.groupie:groupie-kotlin-android-extensions:2.0.3'

which does result in gradle sync successfully but I can neither import GroupAdapter nor GroupieViewHolder.

I also tried using latest version 2.9.0 but none of it currently works. Super confused about where I went wrong 🤔 This is the error that I get when I try to build when I use the latest version

`Could not determine the dependencies of task ':app:compileDebugKotlin'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.lisawray.groupie:groupie:2.9.0. Searched in the following locations:

Zhuinden commented 3 years ago

The artifacts are as follows:

com.github.lisawray.groupie:groupie-databinding:2.9.0
com.github.lisawray.groupie:groupie:2.9.0
com.github.lisawray.groupie:groupie-kotlin-android-extensions:2.9.0
com.github.lisawray.groupie:groupie-viewbinding:2.9.0

The oldest version I see on Jitpack is 2.7.1.

I would advise moving from Kotlin Synthetics and kotlin-android-extensions as soon as possible, considering that they will no longer be supported by Kotlin after September 2021. The only thing that awaits the kotlin-android-extensions artifact is eventual removal.

qualiky commented 3 years ago

Thank you for the heads up. I added the latest version back again, but did not forget to add jcenter() to repositoryhandler in settings.gradle and in project level build.gradle as well. It works great, but I'm soon going to move on from the kotlin-android-extensions. It's sad to see such an amazing artifact getting killed off :(

Buggyy commented 3 years ago

Any progress regarding this bug?

Zhuinden commented 3 years ago

It's not a bug, Kotlin-android-extensions is deprecated along with the artifact, and the Readme has warnings as such. It is optional, just don't add it. If there's a new version, it'd be 3.0, and that artifact would be removed entirely.

MohsinAShaikh commented 2 years ago

I'm trying to use groupie in my project but it is giving some problem Failed to resolve: com.github.lisawray.groupie:groupie-kotlin-android-extensions:2.9.0 cause of this I'm not able to use GroupAdapter please help me out this is my first time using it

Zhuinden commented 2 years ago

Jitpack build says

Build artifacts:
com.github.lisawray.groupie:groupie-kotlin-android-extensions:2.10.0
com.github.lisawray.groupie:groupie-viewbinding:2.10.0
com.github.lisawray.groupie:groupie-databinding:2.10.0
com.github.lisawray.groupie:groupie:2.10.0

Therefore you are probably missing the Jitpack.io repository from your settings.gradle. @MohsinAShaikh

MohsinAShaikh commented 2 years ago

Thank you for helping me out it works for me just by adding jitpack.io in settings.gradle. @Zhuinden