Questions tagged [android-jetpack-compose]
Jetpack Compose is Android’s modern toolkit for building native declarative UI made by Google. If you're targeting desktop with Compose for Desktop, use both this and [compose-desktop] tags.
android-jetpack-compose
13,159
questions
0
votes
1
answer
53
views
Composable recomposing even with strong-skipping mode enabled
I have tested this using Kotlin 2.0.0, 2.0.10-RC and 1.9.20 just to be sure thisn't some weird Kotlin compiler issue. However, I am currently struggling to understand how lambdas affect the ability to ...
1
vote
1
answer
54
views
Android compose: offset at a fraction of parent size
I want to place some composables at specific positions on top of an image. However, the image will be responsive (it will resize), so I can't use Modifier.offset(some_fixed_offset.dp).
Modifier.offset(...
0
votes
0
answers
12
views
How to remove unexpected shadow on ElevatedCard in Jetpack Compose?
I have an ElevatedCard in my app and it looks really good:
and its code is here:
ElevatedCard(
content = {
Text(
fontSize = 20.sp,
text = "All cars",
...
1
vote
0
answers
16
views
How Do You Pass A Function Into Foreground Services In Android Studio
I'm trying to create an application in Android Studio that consists of a timer that runs in the background. To achieve this I'm passing the timer functionality into a foreground service class. However,...
1
vote
1
answer
47
views
There is a delay when saving data into a Room Database
I'm trying to create a stop watch application. Everything works fine at first. The stop watch goes up from the milliseconds, to the seconds, to the minutes just fine. There are two timers, one of the ...
0
votes
0
answers
22
views
"Dagger Hilt: @Binds methods' parameter type must be assignable to the return type error"
I'm working on a Dagger Hilt setup in my Android project and encountered an error when using @Binds methods.
The error message is:
error: @Binds methods' parameter type must be assignable to the ...
0
votes
0
answers
22
views
Dialog in Compose with undesired gap when displayed inside a Transparent Activity
I have a transparent Activity in my code that has the following theme:
<style name="Theme.MyApp.Transparent" parent="Theme.MaterialComponents.Light.NoActionBar">
<item ...
0
votes
0
answers
16
views
Bouncing content inside the BottomSheetScaffold
I want to make navigation in BottomSheetScaffold that involves constant content change and I wanted the bottom shield to smoothly handle resizing for this in the root composable, I use Modifier....
0
votes
0
answers
7
views
Compose Multiplatform - TLS sessions are not supported on Native platform on iOs
I'm using Compose Multiplatform and trying to API call. The process is done without any warning on Android but on iOS i facing this error: "TLS sessions are not supported on Native platform"....
0
votes
1
answer
26
views
Why is my @Composable function in Jetpack Compose called after onResume instead of onCreate?
I'm learning how to develop an Android app using Jetpack Compose, and I'm currently working through understanding the activity lifecycle. I noticed an unexpected behavior: my @Composable function is ...
0
votes
0
answers
10
views
Navigation takes me to an empty page
I want my app to navigate to SearchResults when I first open it so I put the logic to change the uiState in the ViewModel init block. Then I used an if statement to check the ViewModel and navigate to ...
0
votes
2
answers
17
views
How to Achieve a Glassmorphic Background in Jetpack Compose Android?
play music
I'm trying to create a glassmorphic background effect in Jetpack Compose for my Android app. Specifically, I want a background that has a frosted glass effect with a blurred background ...
0
votes
1
answer
29
views
Is there a way to set text overlay bounds so text would not go out of video and also split into multiple lines automatically (Compose)?
I am using Media3 Transformer and Exoplayer to make a TextureOverlay of texts so I can export a video with added static text on it. But I could only fix text size using RelativeSizeSpan and change ...
0
votes
2
answers
30
views
Ripple effect shows a circle on clicked expanding card
After the Compose Material3 1.3.0 ripple API change the ripple effect looks a bit weird on an expanding clickable card, but it doesn't look like it will be fixed soon:
var expanded by remember { ...
0
votes
0
answers
18
views
DataStore compose multiplatform
I try to use A DataStore instance in compose multiplatform, for desktop
I share this here because i didn't find anywhere else.
If you try to use DataStore in kotlin multiplatform you surely end there ...
-2
votes
0
answers
22
views
Jetpack compose navigation IllegalStateException: Restoring the Navigation back stack failed
When the app is open, if I go to the settings and revoke one of the permissions, the app's configurations change. Upon returning to the app, it throws an error:
`java.lang.IllegalStateException: ...
0
votes
0
answers
29
views
How to update the counter in LazyColumn items that are out of focus?
I have a LazyColumn list, in which, when I add an element to it, when the “add” button is pressed, the element has a timer that starts counting, everything is fine here, but when there are more ...
0
votes
0
answers
18
views
Android Compose Strong Skipping Mode: Unexpected Behaviour
I have an Android Compose screen with a Pager and some content below it. I have created a custom scope that accepts two Composable functions that should fill the content in the pager and below it.
I ...
0
votes
1
answer
41
views
Sweep gradient circular progress bar in jetpack compose
I want to create a circular progress bar with a gradient like this using jetpack compose
I tried to do it using the Brush.sweepGradient however, it didn't work correctly as the start angle of the ...
1
vote
1
answer
59
views
How to create a Semicircular Slider using Jetpack Compose canvas?
I am pretty new in Android Studio and need to make a Slider to view data received by an Arduino via Wi-Fi (Temperature and Light).
I want to have a SemicircularSlider.kt composable that receives the ...
0
votes
1
answer
23
views
Why does my animatedWidth variable doesn't change with the function animateTo?
I have an animation it's a green rectangle that grows in length inside a white outlined rectangle. It was working fine before I adjusted the layout. Now the green rectangle simply doesn't grow. If I ...
0
votes
0
answers
30
views
I need help regarding backhandler on my login screen
I have a small Android app in Kotlin that I have structured like this:
MainActivity() ->
Composable(Library.kt) ->
Composable(Navgraph.kt) which contains the NavLog ->
Composable(HomeScreen....
1
vote
1
answer
81
views
Jetpack Compose PopUp clips content out of bounds after 16.dp
I'm working on building tooltip with caret that can has varying height. However Popup clips anything out of its bounds when the dimensions is bigger than 16.dp in vertical direction. I tried setting ...
1
vote
1
answer
19
views
Any solution to apply rounded corners in Jetpack Glance
Is there any solution to apply rounded corners in Rows or Columns in Jetpack Glance
cornerRadius works only in android S+, so any workaround ?
@Composable
fun ParkingSessionsWidget(sessions: List<...
0
votes
0
answers
13
views
Jetpack Compose Preview Warning Shown
i currently migrate some Fragments to Compose. When launching the Preview of a Composeable i get this warning screen.
compileSdk = 34
defaultConfig {
minSdk = 26
targetSdk = 34
Is there any ...
0
votes
0
answers
19
views
Android - Room Database enter loop on data update
I’m developing an app using Jetpack Compose, Room, Flow, Kotlin, and following the MVVM architecture. My app includes the following screens:
HomeScreen: Displays the budget and a list of products.
...
0
votes
1
answer
22
views
How to animate the show/hide of the keyboard with jetpack compose?
Example of what i need can be found in very first video in https://developer.android.com/develop/ui/views/layout/sw-keyboard
1
vote
0
answers
14
views
How to avoid Jetpack Compose recomposition?
I have a small composable function with just one parameter:
@Composable
private fun LeftControlContainers(
uiControl: EditorUiControl,
) {
val controls = rememberUpdatedState(uiControl)
...
0
votes
0
answers
17
views
Kotlin Compose Google SignIn with Firebase returns null
I'm trying to create a button in my kotlin compose app that lets users to sign in with a google account. To do so I've realizaed the code below that sends a request to firebase but instead of ...
2
votes
1
answer
55
views
How to center text views in a custom progress bar in jetpack compose
I'm trying to create a custom progress bar in Compose, where each step is represented by a dot, and beneath each dot, there's a text label. However, I'm having trouble aligning the text labels so that ...
1
vote
2
answers
60
views
Passing nullable to a Jetpack Composable
New Android developer here, I imagine I'm probably missing something fundamental...
I have a class instance which is not initialised straight away. I pass this to a composable and want to use it after ...
0
votes
1
answer
34
views
Jetpack Compose or XML, which is better for creating a large application with very many features, and complex features [closed]
I'm new android developer and i complete all the fundamentals and foundation of the android development with Kotlin, Now i look at build app like Instagram or Facebook or very complex app with complex ...
2
votes
1
answer
38
views
App Crashes Whenever Trying To Read File Saved Into Internal Storage In Android application
I'm trying to create a simple android application where value from a text field is saved into a file and is then later displayed on screen in a text composable on a button press, however the ...
0
votes
0
answers
21
views
Swipe back gesture for iOS in KMP [closed]
I have a compose multiplatform app, and i wanted to implement swipe back gesture for the ios client.
Is that currently possible or is there any workaround to it?
I have made some research and can't ...
1
vote
1
answer
35
views
FlowRow make elements in row stretch to available width
In Jetpack Compose FlowRow, how can I make the elements within the rows stretch the full width of the screen.
If this code is run on a Pixel 8, the first 4 names are on one row which is what I want, ...
1
vote
1
answer
24
views
How can I retrieve the value from my roomDatabase before the Text composable needs it so it doesn't display null?
In my app, a Text composable calls the roomViewModel to display the energyState, but it shows null. I want the observer (the Text composable), to display the value of the "energy" column ...
3
votes
2
answers
90
views
How to create a draggable and rotatable box in Jetpack Compose?
I'm working on a Jetpack Compose application and I want to create a Box that can be both dragged and rotated using mouse interactions. I should be able to click and drag the entire Box to move it ...
1
vote
1
answer
35
views
I would like some help regarding an async between a compose navigation and a ViewModel update
I'm quite new to android kotlin and i have a little problem regarding my login. When i press the login button i immediately get directed to the home screen but before the ViewModel can be updated so i ...
1
vote
1
answer
47
views
Best Practices for Using testTag in Jetpack Compose
I’m currently exploring best practices for UI testing in Compose and noticed the use of testTag for component identification. While I understand its utility for stable UI tests, I'm concerned about ...
0
votes
0
answers
25
views
Is it possible to replace the start destination in Jetpack Compose Navigation without losing the backstack?
I have a NavGraph setup so you can change the start destination while being on another screen entirely (e.g. A is the start destination - I navigate to C and change the start destination to B) - ...
-1
votes
1
answer
34
views
ModalBottomSheet with scrollable content issue (Jetpack Compose)
I am using ModalBottomSheet from material3.
Inside of ModalBottomSheet has a scrollable content, when I scroll to bottom ModalBottomSheet automatic closed, and when I scroll to top ModalBottomSheet ...
0
votes
0
answers
50
views
How to show/hide bottom navigation in Compose?
I have a code which calculates if bottom navigation bar should be visible, but once I got to specific screen the navigation resets to first home tab. I guess recomoposition occurs for whole Scaffold, ...
-1
votes
0
answers
28
views
Jetpack Compose: Creating a Curved Image
I'm working on a Jetpack Compose UI element where I want to achieve a specific visual effect. Here's the desired outcome:
In this image, an image sits on top of the background, clipped to a curved ...
0
votes
2
answers
36
views
How to make CircularProgressIndicator background transparent
I am trying to show an CircularProgressIndicator in my login screen. When I enter username and password and click the login button I need to show a CircularProgressIndicator at the center of screen ...
0
votes
1
answer
31
views
How to make the height of Row with painter Modifier depend on the content inside Compose kotlin
i have a code:
Row(
modifier = Modifier
.fillMaxWidth()
.background(Color.Black)
.paint(
painter = painterResource(resource = Res.drawable.toolbar_background),
...
0
votes
0
answers
25
views
Content of the activity jumps under the status bar when Admob's Interstitial is shown in Jetpack Compose
Here's the default example of empty activity created with Jetpack Compose, just replaced a text with a button to show fullscreen ad (Admob Interstitial)
class MainActivity : ComponentActivity() {
...
-1
votes
1
answer
41
views
Can we publish compose multiplatform iOS on app Store?
As we all know that now we can develop iOS applications in Kotlin Multiplatform (KMP) with shared UI or using Compose Multiplatform (CMP).
Now CMP is currently in Beta so can we publish compose ...
0
votes
0
answers
26
views
How to add pressed state / animation to compose dragAndDropSource
I have some compose Boxes and I want to be able to drag and drop them and also click them.
This works so far, but the problem is there is no pressed state at all. I want to have a ripple effect.
Using ...
3
votes
1
answer
71
views
Why are every composables recomposed?
Could you explain why both TextField are being recomposed when I enter text in one ?
Using Compose (composeBom = "2024.06.00"), Voyager 1.0.0, Kotlin 1.9.23:
class RootScreen : Screen {
...
0
votes
1
answer
32
views
How to know if my composable screen was open trough a deepLink
I have an activity with several composable screens.
Each screen has the feature to be opened with an intent or by user click.
Also, each composable screen has a back arrow.
What I want to do is to ...