-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Movie/Show trailers #115
Conversation
companion object { | ||
const val YOUTUBE_WATCH_PAGE = "https://youtube.com/watch?v=" | ||
const val YOUTUBE_THUMBNAIL_URL = "https://img.youtube.com/vi/{id}/hqdefault.jpg" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💅 Better to move it to the end of the class
https://kotlinlang.org/docs/coding-conventions.html#class-layout
companion object { | ||
const val YOUTUBE_WATCH_PAGE = "https://youtube.com/watch?v=" | ||
const val YOUTUBE_THUMBNAIL_URL = "https://img.youtube.com/vi/{id}/hqdefault.jpg" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💅 Better to move it to the end of the class
https://kotlinlang.org/docs/coding-conventions.html#class-layout
.fillMaxWidth() | ||
.wrapContentSize(), | ||
) | ||
} else if (items.isNotEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to handle no trailers state
Box( | ||
modifier = Modifier | ||
.align(Alignment.BottomCenter) | ||
.fillMaxWidth() | ||
.background(Color.Black.copy(alpha = 0.7f)) | ||
.padding(4.dp), | ||
) { | ||
Text( | ||
modifier = Modifier | ||
.padding(horizontal = 12.dp, vertical = 4.dp), | ||
text = video.name, | ||
style = MaterialTheme.typography.titleMedium, | ||
overflow = TextOverflow.Ellipsis, | ||
minLines = 1, | ||
maxLines = 3, | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need this title
val body = result.body | ||
if (body == null) { | ||
Result.Failure(GeneralError.UnknownError(Throwable("Videos is null"))) | ||
} | ||
Result.Success(body!!.results.map { it.toVideos() }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 125 will always crash if body == null, you forgot to add if/else
if (body == null) { | ||
Result.Failure(GeneralError.UnknownError(Throwable("Videos is null"))) | ||
} | ||
Result.Success(body!!.results.map { it.toVideos() }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 140 will always crash if body == null, you forgot to add if/else
cecde1b
to
3295f07
Compare
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly.
Take a look at the contributing guidelines for this project.
Description
Checklist
Fixes #<issue_number_goes_here>