Questions tagged [android-jetpack-compose-tv]

Jetpack Compose for TV is Android’s modern toolkit for building native declarative UI for TV using the framework made by Google.

Check out Compose for TV packages which makes it simpler to use Jetpack Compose to build TV applications.

Links

34 questions
5
votes
2 answers

Android Jetpack Compose TV Focus restoring

I have TvLazyRows inside TvLazyColumn. When I navigate to the end of all lists(position [20,20]) navigate to next screen and return back, focus is restored to the first visible position [15,1], not the position where I was before [20,20]. How can I…
5
votes
1 answer

How to set default focus item in Android jetpack Compose

I have a screen with several focusable widgets for TV. Every time I have to click the direction key then Box01 get focused. Does anyone know how to set Box01 focused by default? My Code: @Composable fun DefaultFocusSample(){ …
3
votes
1 answer

Focus restoration on navigation popBackStack and focus restoration using state Modifiers

In the JetStream tv app sample, it has a createInitialFocusRestorerModifiers() function which acts as the focus restorers of a TvLazyRow/Column for its children. As said from the function's KDoc: Returns a set of modifiers [FocusRequesterModifiers]…
3
votes
2 answers

Enabling System Sounds on Android TV with Jetpack Compose

Hello Stack Overflow community, I am currently working on an Android TV app using Jetpack Compose and am facing a problem that I can't seem to find a solution for. In traditional Android development, I could easily use the AudioManager class to…
3
votes
1 answer

Fix item at a given pivot in Jetpack Compose's TvLazyRow/TvLazyColumn

I am using the TvLazyRow composable from the jetpack compose for tv library and using PivotOffsets to position the focused item at a fixed position in the row. When I scroll the row to the very end, the fixed position value is not respected and the…
3
votes
1 answer

Jetpack Compose focus jumps erratically using D-Pad navigation on Android TV

I have been experiencing very erratic jumping when using Jetpack Compose’s LazyColumns on Android TV. D-Pad navigation is supposed to be supported in Compose for a while now, but it seems simple cases are not supported—or I am doing something…
3
votes
0 answers

LazyColumn with nested LazyRows - memory issue

In my app there's a LazyColumn that contains nested LazyRows. I have a memory issue - when there are 30-40 rows and about 10-20 elements per row in the grid, it's possible to reach Out-of-Memory (OOM) by simply scrolling the list vertically up and…
2
votes
2 answers

Jetpack Compose - Modify scroll behavior to hold focus on a fix position on screen

Using jetpack compose to create an AP for TV platforms and I've been trying to create a row in jetpack compose which scrolls about the fix position on screen, here is the target behaviour as observed on google TV launcher: Target Behaviour Here we…
2
votes
1 answer

How to set a focused state to a Button with jetpack compose?

compose_version = '1.0.0-beta02'. I can set a focused state TextField by FocusRequester, but Button not. val requester1 = FocusRequester() TextField(value = text1, { newValue -> text1 = newValue …
1
vote
0 answers

How to request focus on first item in LazyColumn/LazyVerticalGrid? (Jetpack compose)

I need first item to be in focus when I enter the screen. I'm making a TV app @Composable fun TwoColumnGrid( animals: List, onAnimalClicked: (Animal) -> Unit ) { val firstItemFocusRequester = remember { FocusRequester() } var…
1
vote
1 answer

ComposeView steals focus from content in AndroidTV

I'm trying to use Jetpack Compose in my existing AndroidTV App. I need to make a button with microphone icon which will change its color if it's focused. Like this^ Unfocused Focused Here's my ComposeView
1
vote
1 answer

How to always focus on the first item while focussing on a TVLazyRow?

I am trying to implement a TVLazyRow where when we focus on the row from some other composable above the row it must always focus on the first item first. Currently, when pressing down, the focus goes to whichever item in the row is directly below…
1
vote
1 answer

Jetpack Compose TV is not scrollable and not clickable

I'm very new to Jetpack Compose for Android TV and don't understand how scrolling and clicking works. For example: TvLazyColumn( modifier = Modifier .padding(24.dp) …
1
vote
0 answers

How does AnimatedContent work in jetpack compose?

I am working on a project on Android TV based on jetpack compose. I have treid to animate my UI using AnimatedVisibility but it naturally removes the content that I want to animate from the screen, which I don't want. I want to keep a part of the…
1
vote
1 answer

Is there anyway to remove default focus highlighting on a composable in a lazyrow?

When I move focus to any of the items in a lazy row (Box composable), android by default darkens the background of that element to show that it being focussed. I don't need this as I am adding my own focus effects. Is there some way to remove…
1
2 3