Thank you for this tutorial. I believe arrayListOf is the more Kotlin way of declaring the list of Photo objs, rather than ArrayList<Photo> like you recommended.
Hey ! Your tutorial was really awesome. I loved it but I am having a bit of a problem, When I compile my project, it shows unresolved reference : PhotoHolder. Please help.
Thank you!
Hey guys,
In my honest opinion, despite this is a good use case for a real world app, I think it is over complicated for introducing a beginners topic.
Why choose to include networking with API, parsing JSON, etc in a tutorial specific for RecyclerView tutorial?
The data could have been in a local storage and the project could have been much smaller and simpler (by choosing a different kind of data to showcase, like pets)
Using the network calls gives us data to show and since the user doesnāt need to know how to use the API code (itās already there for them), it can just provide a reference for them if they are interested.
I am trying to learn just RecyclerView. I donāt want to sign up with another site to get some API keys. I donāt want to deal with other technologies.
I have the beginning of an app. Iāve collected all the data via web-scraping. Got it all in an ArrayList (Match is my class). I just want to display it in a List with Section headers. As far as I can tell, Android doesnāt have the concept of Sections or Section headers in a ListView or RecycleView. That I can work around, butā¦
I just want to display my data in a RecyclerView. Why canāt I find a tutorial that tells me just that?
I have been looking all over the internet for three weeks to find a Quick-and-Dirty RecyclerView tutorial. Iām not very impressed with any Android/Kotlin tutorials/resources out there. They are way too complicated or incomplete.
Could you copy the recyclerview class and adapter code and use just an array of your data? I would recommend starting your project and slowly build in the recyclerview class using parts of the code from the tutorial. There were lots of articles on the basics of recyclerviews out there and I wanted to add a bit more information for the adventurous (something the user would have to do a lot of different searches for). When Iām learning something new, I usually start with just the basic code outline and slowly add more code. I hope that helps.
Nice tutorial, there is a part might be a typo
āNext, in receivedNewPhoto(), add the following after photosList.add:
adapter.notifyItemInserted(photosList.size)ā
And next how it should show in code is:
adapter.notifyItemInserted(photosList.size-1)
Reading this article again in April, Iām able to follow it better, but Iāve found some typos:
In the code snippet that adds the photos variable, just before āNice job, Commander!ā, I believe there is a missing colon.
In the text just before the next code snippet, I believe the start of the last sentence should be changed from āAdd update getItemCount()ā¦ā to just: āUpdate getItemCount()ā¦ā
In the section, āKeeping Hold of Your Viewsā, the last line before the code snippet states: āAdd the following code at the bottom of the RecyclerAdapter class:ā When I first copied/pasted it, I put it outside the RecyclerAdapter class, which didnāt work. You might want to change your text to be more specific, like ājust before the last trailing ā}āā oslt.
I completed this tutorial and eagerly moved on to the intermediate tutorial, because Iām trying to get section headers, like the iOS grouped TableViews. (Canāt believe itās not built-in in Android Studio!)
But, the intermediate tutorial is completely different project, which means you canāt build on this project to add new features. Even trying to sift through the tutorial and apply the new elements found there to this project doesnāt work so well because the projects are so different, even when comparing similar methods.
This tutorial was updated at some point. Is there any chance that the other one could be updated, too? Or another one that truly follows this one?
Iām really struggling to add these section headersā¦
Hi - Iām a Kotlin NOOB and Iām trying to follow the tutorial.
TravelListAdapter.kt is giving many errors all related to the ViewHolder inner class
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView),
View.OnClickListener {
}
which gives the following error:
Class 'ViewHolder' is not abstract and does not implement abstract member*
public abstract fun onClick(pO: View!): Unit defined in *
android.view.View.OnClickListener*
You have to implement all of the functions of RecyclerView.ViewHolder. Usually you will see a red line underneath the ViewHolder class. If you click on ViewHolder you should see a red icon popup with a suggestion to implement that interface. Implement all functions.