Added support for Google Drive Shortcuts#84
Conversation
| } else if (file.isVideoFile) { | ||
| launchVideoPlayer(file) | ||
| } else if (file.isShortcut) { | ||
| if (file.shortcutDetails.targetMimeType == "application/vnd.google-apps.folder") { |
There was a problem hiding this comment.
Instead of doing this create variables such as here for cleaner code
There was a problem hiding this comment.
Made suggested changes. Type safety is a bit messy I suppose, but should work fine due to the logic flow. I have never worked with kotlin or android before, feel free to suggest further changes.
| @Keep | ||
| data class DriveFile( | ||
| val id: String, | ||
| var id: String, |
There was a problem hiding this comment.
I do not understand the purpose of making it non-final.
I can see its used to handle id for shortcuts for which you should rather use Kotlin copy() function and re-assign the id something like file.copy(id=shortcut.id)
There was a problem hiding this comment.
Made suggested edit.
|
|
||
| val isShortcutFolder = shortcutDetails.targetMimeType == "application/vnd.google-apps.folder" | ||
|
|
||
| val isShortcutVideo = shortcutDetails.targetMimeType?.startsWith("video/") |
There was a problem hiding this comment.
Pretty sure isShortcutVideo would return Boolean?. It can be avoided by adding a default false using the elvis operator
No description provided.