Questions tagged [android-jetpack-compose-ui]

37 questions
4
votes
1 answer

remember derivedStateOf or not

In the examples I find (here or here) I see that derivedStateOf is always wrapped in a remember block. Checking the Recomposition counts, I don't see a difference between val foo = remember { derivedStateOf { someState } } and val foo =…
Kuno
  • 3,492
  • 2
  • 28
  • 44
3
votes
1 answer

Android Jetpack compose material 3 why Card need this annotation @OptIn(ExperimentalMaterial3Api::class)

I am new in Jetpack Compose(JC). I started JC and used card but it shows me an error and recommend me to add this annotation @OptIn(ExperimentalMaterial3Api::class). Also showing this message This material API is experimental and is likely to change…
3
votes
0 answers

Jetpack Compose: Moving up and down multiple multi-line BasicTextFields with physical keyboard

I noticed that if I have multiple multi-line BasicTextField in a Column, if one the text fields has focus and I press the up and down arrow keys on my physical keyboard (using Android Studio emulator), the focus is moved to a different text field…
3
votes
1 answer

Android Compose: Is there any way to dismiss dialog on click of “Done” key from keyboard

I'm new to Android compose. Is there any way to dismiss dialog on click of Done key from keyboard using ImeAction? Currently below code is clearfocus on click of Done along with how to dismiss the dialog: TextField( value = text, …
2
votes
2 answers

Problem, Recomposition is not happening when i change UI State (2d LIST) in android jetpack compose

My problem is that i change the uiState but the effect is not there class BoardViewModel : ViewModel() { private var board = mutableListOf>() private val _uiState = MutableStateFlow(BoardUiState(board.toList())) val…
2
votes
1 answer

Search with DropDownItem in OutlineTextField not overlaying over content

I am trying to achieve search functionality in compose using DropDownItem but it is displaying below OutlineTextField. All the available option is not displaying over the content like DropDown menu. Effort 1: Tried using DropDownMenu but in that…
2
votes
2 answers

Jetpack Compose UI - Button width changes on click inside AlertDialog

I'm facing this weird issue with fillMaxWidth(fraction = ...) with an AlertDialog and Button, where the Button shows up initially at one size, and on click it shrinks to wrapping its content. Here is the most basic example I can create. I've tried…
2
votes
0 answers

Listening to SwipeableState.progress.fraction lags the app

A bit of previous context is good to understand the purpose and if there's a better solution or find the mistake here. Basically I have a LazyColumn with nested scroll and swipeableState. Nested Scroll is listening for delta values and use the…
2
votes
2 answers

Showing a BottomSheetScaffold with a BottomNavigation - Compose UI - Android

Using Compose UI, I have a bottom navigation bar and a Bottom Sheet, so starting a "BottomSheetScaffold" from "Catalogue" screen is causing the "Bottom Nav Bar" to stay visible. How can I show "BottomSheetScaffold" making it cover the whole Screen…
1
vote
1 answer

Blank Fragment shown on activity restart/config change in compose TabRow

I am trying to implement TabRow in compose with existing fragments being shown in FragmentContainerView. When the child fragments are added to the activity/host fragments they work fine. But upon activity restart the fragments dont appear to be…
1
vote
0 answers

In Compose ui HorizontalPager when scroll is call page content 2 times

In Compose ui HorizontalPager when scroll is call page content 2 times this mean if you in first page and scroll to second one page content will call two time. HorizontalPager( pageCount = tabs.size, state = pagerState, modifier =…
1
vote
0 answers

remove indicator color from NavigationBarItem in BottomMenu android compose

As per our requirement I need to set the container color of the BototmNav with 60% opacity. Due to this, when any icon is selected, container colors is displayed as background to the selected icon in the active state. It looks very weird. I looked…
1
vote
1 answer

Jetpack Compose DropDown with generic implementation

Currently, I have a DropDown implemented with particular types. I would like to make that drop-down menu generic so I can reuse it everywhere with custom objects and remove boilerplate code. Current Implementation @Composable fun…
1
vote
1 answer

MaterialTheme.colorScheme.surface is always white in Compose Preview - Material 3

I am starting to learn Compose UI and it seems that each time I use any color from MaterialTheme.colorScheme the previews only show the same color in previews. So: for MaterialTheme.colorScheme.surface, it always shows White. for…
1
vote
1 answer

VisualTransformation for the American Phone number in compose

I'd want to add phone number formatting as the user types in the field. So far, it's functioning, but the cursor is in the wrong location when the field is empty. When we have the initial value, it moves the cursor to the right location. Note: I…
1
2 3