Skip to content

Commit

Permalink
Update README.md - remove Ambient (#1139)
Browse files Browse the repository at this point in the history
Fixes #1094
  • Loading branch information
riggaroo committed Jun 1, 2023
2 parents 20494aa + f169ae8 commit becc40a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Jetchat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The [ProfileFragment](app/src/main/java/com/example/compose/jetchat/profile/Prof
[ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel), served via [LiveData](https://developer.android.com/topic/libraries/architecture/livedata).

### Back button handling
When the Emoji selector is shown, pressing back in the app closes it, intercepting any navigation events. This feature shows a way to integrate Compose and APIs from the Android Framework like [OnBackPressedDispatcherOwner](https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher) via [Ambients](https://developer.android.com/reference/kotlin/androidx/compose/Ambient). The implementation can be found in [ConversationUiState](app/src/main/java/com/example/compose/jetchat/conversation/BackHandler.kt).
When the Emoji selector is shown, pressing back in the app closes it, intercepting any navigation events. The implementation can be found in [UserInput](app/src/main/java/com/example/compose/jetchat/conversation/UserInput.kt).

### Text Input and focus management
When the Emoji panel is shown the keyboard must be hidden and vice versa. This is achieved with a combination of the [FocusRequester](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/FocusRequester) and [onFocusChanged](https://developer.android.com/reference/kotlin/androidx/compose/ui/focus/package-summary#(androidx.compose.ui.Modifier).onFocusChanged(kotlin.Function1)) APIs.
Expand Down

0 comments on commit becc40a

Please sign in to comment.