Skip to content
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

Focus Issue On Android Tv #8

Closed
rahat14 opened this issue Nov 9, 2023 · 2 comments
Closed

Focus Issue On Android Tv #8

rahat14 opened this issue Nov 9, 2023 · 2 comments

Comments

@rahat14
Copy link

rahat14 commented Nov 9, 2023

Item does not scroll with dpad

Repository owner deleted a comment from oleksandrbalan-etn Nov 14, 2023
@oleksandrbalan
Copy link
Owner

Hey 👋
Thx for trying ProgramGuide!

I guess you are referring to the issue, when the program guide is not scrolled automatically on the focused item. In this case I would recommend to add an onFocusChanged modifier to your composables for program cell / channel / timeline, and use an appropriate ProgramGuideState::animateTo* method for each.

For example for cell item it would be:

ProgramCell(
    program = program,
    onClick = {
        ...
    },
    modifier = Modifier
        .onFocusChanged { focusState ->
            if (focusState.hasFocus) {
                val index = programs.indexOf(program)
                scope.launch { state.animateToProgram(index) }
            }
        }
)

This way the focused item will always be visible, see the video below:

Screen.Recording.2023-11-14.at.13.24.48.mp4

@rahat14
Copy link
Author

rahat14 commented Nov 15, 2023

i will definitely try and give feed back to u

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

No branches or pull requests

2 participants