diff --git a/docs/compose.md b/docs/compose.md index 974d66ca..c43c0de5 100644 --- a/docs/compose.md +++ b/docs/compose.md @@ -59,7 +59,7 @@ fun ItemComposable( .onFocusChanged { focusState -> isFocused = focusState.hasFocus } - .focusTarget() + .focusable() .dpadClickable { onClick() }, diff --git a/docs/getting_started.md b/docs/getting_started.md index eacf8627..efe404c0 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -90,7 +90,7 @@ fun ItemComposable( .onFocusChanged { focusState -> isFocused = focusState.hasFocus } - .focusTarget() + .focusable() .dpadClickable { onClick() }, diff --git a/dpadrecyclerview-compose/src/androidTest/java/com/rubensousa/dpadrecyclerview/compose/TestComposable.kt b/dpadrecyclerview-compose/src/androidTest/java/com/rubensousa/dpadrecyclerview/compose/TestComposable.kt index bf13e836..eb89a9ce 100644 --- a/dpadrecyclerview-compose/src/androidTest/java/com/rubensousa/dpadrecyclerview/compose/TestComposable.kt +++ b/dpadrecyclerview-compose/src/androidTest/java/com/rubensousa/dpadrecyclerview/compose/TestComposable.kt @@ -18,6 +18,7 @@ package com.rubensousa.dpadrecyclerview.compose import androidx.compose.foundation.background import androidx.compose.foundation.clickable +import androidx.compose.foundation.focusable import androidx.compose.foundation.layout.Box import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -32,7 +33,6 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.focus.focusTarget import androidx.compose.ui.focus.onFocusChanged import androidx.compose.ui.graphics.Color import androidx.compose.ui.semantics.SemanticsPropertyKey @@ -98,7 +98,7 @@ fun TestComposableFocus( .onFocusChanged { focusState -> isFocused = focusState.isFocused } - .focusTarget() + .focusable() .background(backgroundColor) .clickable { onClick() diff --git a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DragButtonItem.kt b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DragButtonItem.kt index 38da6dcb..3e3183e1 100644 --- a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DragButtonItem.kt +++ b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DragButtonItem.kt @@ -17,6 +17,7 @@ package com.rubensousa.dpadrecyclerview.sample.ui.screen.drag import androidx.compose.foundation.background +import androidx.compose.foundation.focusable import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding @@ -36,7 +37,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.focus.focusTarget import androidx.compose.ui.focus.onFocusChanged import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource @@ -73,7 +73,7 @@ fun DragButtonItem( .onFocusChanged { focusState -> isFocused = focusState.hasFocus } - .focusTarget() + .focusable() .dpadClickable { if (isDragging) { onStopDragClick() diff --git a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableGridItem.kt b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableGridItem.kt index 1bd1dce2..62d83b3c 100644 --- a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableGridItem.kt +++ b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableGridItem.kt @@ -18,6 +18,7 @@ package com.rubensousa.dpadrecyclerview.sample.ui.screen.drag import androidx.compose.foundation.background import androidx.compose.foundation.border +import androidx.compose.foundation.focusable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxWidth @@ -33,7 +34,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.focus.focusTarget import androidx.compose.ui.focus.onFocusChanged import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp @@ -76,7 +76,7 @@ fun DraggableGridItem( .onFocusChanged { focusState -> isFocused = focusState.hasFocus } - .focusTarget() + .focusable() .dpadClickable { onClick() }, diff --git a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableItem.kt b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableItem.kt index 467e326b..6a3cebf7 100644 --- a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableItem.kt +++ b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/drag/DraggableItem.kt @@ -18,6 +18,7 @@ package com.rubensousa.dpadrecyclerview.sample.ui.screen.drag import androidx.compose.foundation.background import androidx.compose.foundation.border +import androidx.compose.foundation.focusable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape @@ -33,7 +34,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.focus.focusTarget import androidx.compose.ui.focus.onFocusChanged import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview @@ -76,7 +76,7 @@ fun DraggableItem( .onFocusChanged { focusState -> isFocused = focusState.hasFocus } - .focusTarget() + .focusable() .dpadClickable { onClick() }, diff --git a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/widgets/item/ItemComposable.kt b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/widgets/item/ItemComposable.kt index 3fef9290..5fb406fe 100644 --- a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/widgets/item/ItemComposable.kt +++ b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/widgets/item/ItemComposable.kt @@ -21,6 +21,7 @@ import androidx.compose.animation.core.FastOutSlowInEasing import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.tween import androidx.compose.foundation.background +import androidx.compose.foundation.focusable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxWidth @@ -38,7 +39,6 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.scale import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.focus.focusTarget import androidx.compose.ui.focus.onFocusChanged import androidx.compose.ui.graphics.Color import androidx.compose.ui.semantics.SemanticsPropertyKey @@ -85,7 +85,7 @@ fun ItemComposable( .onFocusChanged { focusState -> isFocused = focusState.hasFocus } - .focusTarget() + .focusable() .dpadClickable { onClick() },