14,347 questions
0 votes
0 answers
32 views
Android Hybird Fragment Compose layout, extra padding added after software keyboard shown
I have a hybird fragment, compose layout. After I tap on a text input, some extra padding is added under the app bar My layout looks like this <?xml version="1.0" encoding="utf-8&...
Best practices
0 votes
2 replies
43 views
Should a ViewModel live as long as the entire app? ViewModel inside Scaffold with BottomSheet + Google Maps
I am building a Jetpack Compose app that uses a Scaffold with a persistent bottom sheet. The main content of the Scaffold show Google Maps, and the bottom sheet shows a menu. I have a MapViewModel ...
2 votes
1 answer
38 views
How to handle errors in compose viewmodels?
Imagine something like this: class FileModel: ViewModel() { private val _state: MutableStateFlow<FileState> = MutableStateFlow(initialState) val state: StateFlow<FileState> = ...
-4 votes
0 answers
30 views
Jetpack Compose [closed]
How can I implement the following behavior using Jetpack Compose? I have cards with multiple images (one or more). I want to implement a behavior where clicking on an image causes the image to animate ...
-1 votes
1 answer
66 views
How i disable bounce effect if button is not enabled?
I have disabled ripple effect in my entire project using CompositionLocalProvider. @Composable fun SpotifyTheme( content: @Composable () -> Unit, ) { val colorScheme = colorScheme ...
0 votes
1 answer
57 views
How to access AnimatedContentScope in navigation 3 in compose navigation?
Jetpack navigation 3 is now stable, and I am learning how to work with this type of navigation. One thing I'm missing is the AnimatedContentScope of shared elements using navigation. In navigation 2, ...
0 votes
1 answer
44 views
Latest version of Compose Maps dependency throws "IllegalArgumentException: source must not be null"
When using com.google.maps.android:maps-compose in version 6.12.2 I get the following error building the project: org.jetbrains.kotlin.util.FileAnalysisException: While analysing <redacted>/...
-1 votes
0 answers
50 views
How can I resolve "None of the following candidates is applicable" when I want to add an image in Jetpack Compose? [closed]
I was learning and practicing how to use Jetpack Compose by doing a Columns exercise adding items. I started with Text() which allowed to add text and modify it at will. The problem is when I set ...
Advice
0 votes
1 replies
23 views
Android Jetpack Compose UI testing: equivalent of espresso clearFocus()?
It is common to test inline errors by filling out a textfield and then clearing focus, as the validation happens after the user is done with it. In espresso that can look like: onView(allOf(...
Advice
0 votes
2 replies
49 views
how can I improve seat rendering in compose when the layout is separated by section, row, and column
I confused why my apps is lagging when I scroll down to this seat layout, what's wrong with my code? Can somebody tell me how can I improve the performance. Here is my code that I used for to create ...
-3 votes
0 answers
48 views
Get current location (longitude, latitude) once directly without using Google APIs? [duplicate]
I'm using Kotlin and Compose, and I can't figure how to get the current location once via only GPS. I don't want to use Fused Location Provider. The location doesn't have to be precise and it's not ...
Advice
0 votes
2 replies
53 views
How to lock orientation in the age of adaptive layouts?
I sat down for the first time in a while to work on a personal project - a simple edge-to-edge 'touch to draw' app. I planned to lock the orientation to landscape only to prevent refreshes on rotation....
-2 votes
1 answer
65 views
How to prevent Dropdown view from being pushed [closed]
problem gifAs you can see in the gif, when I drop down, the view below is pushed out. I want the dropdown to be above the view below without being pushed out. How can I do this? In particular, I'd ...
0 votes
0 answers
49 views
How to keep a specific LazyColumn item visible when the keyboard opens?
I have a bottom sheet used for search, and it has two UI states. Both states share the same LazyColumn. State 1: LazyColumn { item { Row { ... } } // search categories item { Text(text = &...
-2 votes
0 answers
88 views
How to create horizontally scrolling category chips in Jetpack Compose like this UI? [closed]
I am trying to build a horizontally scrolling list of category chips in Jetpack Compose, similar to this design: I want the categories to: scroll horizontally look like rounded chips highlight the ...