Adding 'when' to substitute if#56
Merged
maestromac merged 3 commits intoforem:masterfrom Mar 30, 2020
Merged
Conversation
ALSO: * Removed the 'm' from 'mFilePathCallback'. The hungarian notation is not recommended anywhere, only on the AOSP but not for kotlin files. Here's a good discussion about it: https://stackoverflow.com/questions/111933/why-shouldnt-i-use-hungarian-notation\#112080
VarunBarad
reviewed
Oct 15, 2019
VarunBarad
suggested changes
Oct 15, 2019
Contributor
VarunBarad
left a comment
There was a problem hiding this comment.
Overall it looks good but it would be better to keep the call to startActivityForResult verbose as it was.
The ActivityCompat is a helper class to validate versions of the SDK and remove that code from the developer side. It's not needed in this case as the minSDK and the targetSDK are pointing to highe values than 16. The method startActivityForResult on this helper class checks for SDK >= 16.
VarunBarad
approved these changes
Oct 17, 2019
maestromac
approved these changes
Mar 30, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
whento substituteif-elseifas in kotlin there's noif-elseif-else, onlyif-else. this change doesn't affect the previous flow but adds readability.Related Tickets & Documents
Discussion on hungarian notation: https://stackoverflow.com/questions/111933/why-shouldnt-i-use-hungarian-notation\#112080
Kotlin puzzlers on if-elseif-else -> https://github.com/angryziber/kotlin-puzzlers/blob/master/src/syntax/weirdChaining/WeirdChaining.kts
[optional] What gif best describes this PR or how it makes you feel?