Skip to content

Conversation

@srdalai
Copy link
Contributor

@srdalai srdalai commented Aug 15, 2025

Commit Details:

  • Added Focus support to Folder & Video listing screen
  • Added Required Resources
  • Made Changes in the app-level manifest file

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:

  1. I have taken a var "isTvLayout" in the "ApplicationPreferences" which is initialised in the "NextPlayerApplication". And that var is used in the code to make the required changes for TV.
  2. Pull to refresh does not work on the TV properly. I have tried but have not found a solution to disable the pull functionality. So I have used a separate Widget for TV. This is not the ideal solution, but it works. Maybe someone can suggest the ideal solution.
  3. As the Long click is not working properly in TV, I have changed "combinedClickable" to "clickable" for TV

Screengrab:

ScreenRecord_AndroidTV.mp4

- Added Focus support to Folder & Video listing screen
- Added Required Resources
- Made Changes in the app level manifest file
@Pentaphon
Copy link

@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,

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) {

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.

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) {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants