Conversation
|
|
||
| implementation 'com.squareup.retrofit2:retrofit:2.8.2' | ||
| implementation 'com.sqeareup.retrofit2:converter-gson:2.7.1' | ||
| implementation 'com.squareup.retrofit2:converter-gson:2.7.1' |
There was a problem hiding this comment.
fixed dependency typo.
| data class Movie(@SerializedName("rank")var rank: Int, @SerializedName("title")var title: String, | ||
| @SerializedName("country") var country: String, @SerializedName("boxOfficeGross")var boxOfficeGross: Double, | ||
| @SerializedName("openingWeekendGross")var openingWeekendGross: Double, @SerializedName("distributor")var distributor: String){ | ||
| data class Movie(@SerializedName("Rank")var rank: Int, @SerializedName("Title")var title: String, |
There was a problem hiding this comment.
SerializedName value should match JSON data feed
https://howtodoinjava.com/gson/gson-serializedname/
There was a problem hiding this comment.
Yes. Are these the names in the feed, with that capitalization?
|
|
||
| override fun toString(): String { | ||
| return title | ||
| return "$title" |
There was a problem hiding this comment.
Kotlin shortcut in case you ever wanted to return more than just the movie title
https://kotlinlang.org/docs/java-to-kotlin-idioms-strings.html#take-a-substring
There was a problem hiding this comment.
This is an extra step, if it's not actually a string. I'd leave it as it were, until more string details are needed.
|
What I learned from code review: |
|
From this review, I'd fix the spelling error, and validate that the @SerializedName matches the JSON feed. Scrap it if it doesn't. I wouldn't worry about the String shortcut, unless more is added to the String. |
Project Description:
Displays information about movie such as ranking and grossing based off of user search of movie name.
Project was available on time.
Not much commenting but classes were well organized and easy to follow.
Program compiled upon cloning.
Most changes were more 'best practice' suggestions.
JMaz-15/EasySurvey2@7ac28cb
JMaz-15/EasySurvey2@ce59acb
JMaz-15/EasySurvey2@589b0de