You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.
Im using kotlin and have been following the guide in the readme.
Problem 1
I came across the section below in the readme and i cannot get it to work.
class BookCell(item: Book) : SimpleCell<Book>(item) {
override fun getLayoutRes(): Int {
return R.layout.cell_book
}
override fun onBindViewHolder(holder: SimpleViewHolder, position: Int, context: Context, payload: Any) {
holder.textView.text = item.title
}
}
Android Studio does not recognize textView in this line: holder.textView.text = item.title
I did create the layout file and have a textView with the matching Id so im not sure whats going on.
I was under the impression that maybe you were doing some sort of compile time generation to generate the holder to be used based off of the layout file, but that cant be because com.jaychang.srv.kae.SimpleCell uses SimpleViewHolder explicitly which only extends com.jaychang.srv.SimpleViewHolder.
Problem 2
Cant create list of SimpleCell type in kotlin that is shown in the Multiple Types section of the readme.
val books:MutableList<Book> = DataUtils.getBooks();
val ads:MutableList<Ad> = DataUtils.getAds();
val cells:MutableList<SimpleCell> = mutableListOf()
Android Studio is complaining about SimpleCell in the list declaration ( MutableList<SimpleCell> ) stating that I must add the Type argument.
One type argument expected for class SimpleCell<T>
I am very confused and would greatly appreciate it if you could provide a more detailed guide for using this library with kotlin and perhaps several kotlin example activities in the source.
I suppose for the time being i can write this in java but that also means other areas of my app that are already in kotlin will have to be converted back to java, which is a bummer. :(
The text was updated successfully, but these errors were encountered:
Im using kotlin and have been following the guide in the readme.
Problem 1
I came across the section below in the readme and i cannot get it to work.
Android Studio does not recognize
textView
in this line:holder.textView.text = item.title
I did create the layout file and have a textView with the matching Id so im not sure whats going on.
I was under the impression that maybe you were doing some sort of compile time generation to generate the holder to be used based off of the layout file, but that cant be because
com.jaychang.srv.kae.SimpleCell
uses SimpleViewHolder explicitly which only extendscom.jaychang.srv.SimpleViewHolder
.Problem 2
Cant create list of SimpleCell type in kotlin that is shown in the Multiple Types section of the readme.
My version, In Kotlin
Android Studio is complaining about
SimpleCell
in the list declaration (MutableList<SimpleCell>
) stating that I must add the Type argument.One type argument expected for class SimpleCell<T>
I am very confused and would greatly appreciate it if you could provide a more detailed guide for using this library with kotlin and perhaps several kotlin example activities in the source.
I suppose for the time being i can write this in java but that also means other areas of my app that are already in kotlin will have to be converted back to java, which is a bummer. :(
The text was updated successfully, but these errors were encountered: