-
-
Notifications
You must be signed in to change notification settings - Fork 179
feat: Added Basic Support for Android TV (#322) #1393
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
base: main
Are you sure you want to change the base?
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 |
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract these components, it has become to long.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRY (Don't repeat yourself). Extact a component, and just take the parameters, and make distinction by giing them diffetent values.
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