feat: Added Basic Support for Android TV (#322)#1393
Open
srdalai wants to merge 1 commit intoanilbeesetti:mainfrom
Open
feat: Added Basic Support for Android TV (#322)#1393srdalai wants to merge 1 commit intoanilbeesetti:mainfrom
srdalai wants to merge 1 commit intoanilbeesetti:mainfrom
Conversation
- Added Focus support to Folder & Video listing screen - Added Required Resources - Made Changes in the app level manifest file
|
@anilbeesetti please make this a priority |
Comment on lines
+144
to
+153
| MediaView( | ||
| isLoading = mediaState is MediaState.Loading, | ||
| rootFolder = (mediaState as? MediaState.Success)?.data, | ||
| preferences = preferences, | ||
| onFolderClick = onFolderClick, | ||
| onDeleteFolderClick = onDeleteFolderClick, | ||
| onVideoClick = onPlayVideo, | ||
| onDeleteVideoClick = onDeleteVideoClick, | ||
| onVideoLoaded = onAddToSync, | ||
| onRenameVideoClick = onRenameVideoClick, |
There was a problem hiding this comment.
Why don't you extract it to a private function? It is repeated a few lines below.
| ) { | ||
| Column( | ||
| modifier = Modifier.fillMaxSize(), | ||
| if (!preferences.isTvLayout) { |
There was a problem hiding this comment.
extract these components, it has become to long.
Comment on lines
+210
to
+230
| video = video, | ||
| preferences = preferences, | ||
| isRecentlyPlayedVideo = rootFolder.isRecentlyPlayedVideo(video), | ||
| modifier = Modifier.combinedClickable( | ||
| onClick = { onVideoClick(Uri.parse(video.uriString)) }, | ||
| onLongClick = { | ||
| haptic.performHapticFeedback(HapticFeedbackType.LongPress) | ||
| showMediaActionsFor = video | ||
| }, | ||
| ), | ||
| ) | ||
| } else { | ||
| var borderColor by remember { mutableStateOf(Color.Transparent) } | ||
| VideoItem( | ||
| video = video, | ||
| preferences = preferences, | ||
| isRecentlyPlayedVideo = rootFolder.isRecentlyPlayedVideo(video), | ||
| modifier = Modifier | ||
| .border(width = 2.dp, color = borderColor, shape = RoundedCornerShape(12.dp)) | ||
| .onFocusChanged { focusState -> | ||
| borderColor = if (focusState.isFocused) { |
There was a problem hiding this comment.
DRY (Don't repeat yourself). Extact a component, and just take the parameters, and make distinction by giing them diffetent values.
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.
Commit Details:
Note:
I don't have in-depth knowledge about Compose. So some of the code will seem non-conventional. But that's the best I can do without messing up with the existing code. I will try to implement any changes that are suggested.
Changes Made:
Screengrab:
ScreenRecord_AndroidTV.mp4