Questions tagged [jetpack-compose]

33 questions
0
votes
2 answers

ArrayIndexOutOfBoundsException in assistedViewModel after upgrading

@Keep @Composable @InternalCoroutinesApi @ExperimentalCoroutinesApi fun SetupNavigationHost( navController: NavHostController, ) { NavHost( navController = navController, startDestination = Screen.MainScreen.route, ) …
0
votes
1 answer

Get an app icon and display in Jetpack Compose

Trying to load icons for applications on the phone, I use the following code: val drawable = packageManager.getApplicationIcon(app.packageName) Icon( drawable.toBitmap(config = Bitmap.Config.ARGB_8888).asImageBitmap() , contentDescription =…
Mehdi Haghgoo
  • 3,144
  • 7
  • 46
  • 91
0
votes
1 answer

Jetpack compose navigation if current destination is last destination of stack

I am using Jetpack compose with one activity & multiple composable destinations. Activity named is MainActiviy & Composable destinations are A->B->C Suppose I am in C & I backpress, I need to know in onBackPressed() of mainActivity that now in…
0
votes
1 answer

How to minimize number of recompositions of `AsyncImage` from Coli

I am writing simple item displaying image and some text, and also having functionality to add item to favorite. @Composable fun ItemView( item: Item, modifier: Modifier = Modifier, onFavoriteClick: (Item) -> Unit = {}, ) { …
0
votes
2 answers

Error message when building Kotlin and Jetpack Compose desktop project: ComposeComponentRegistrar plugin not compatible

I am currently developing a desktop project with Kotlin, Jetpack Compose, and Gradle in IntelliJ. I am experiencing a problem during the build phase, where I receive the following error message: Kotlin: The provided plugin…
0
votes
1 answer

Creating a Preview for a Composable that takes Google Billing API information such as a `ProductDetail`

Consider a Composable screen with the following parameters: @Composable fun PurchaseSubscriptionScreenContent( availableSubscriptions: List, selectedSubscription: ProductDetails, isLoading: Boolean, onPurchaseClicked:…
0
votes
0 answers

HorizontalPager: when scrolling horizontally shows the content of the previous tab

I am trying to make a menu with two tabs which have different screens. I used HorizontalPager for this but I can't get the content of the previous tab to be displayed when scrolling from one tab to the other. these are the versions I have: compose:…
0
votes
2 answers

Jetpack Compose: how to right align container that wraps content

I'd like to right-align a text bubble like so: What do I need to do to get the desired result, and what exactly is going on as far as when each view in the sequence is being measured?
Regress.arg
  • 352
  • 6
  • 16
0
votes
1 answer

collectAsState performance when we use By or =

What different performance when uiState init with collectAsState and use by or = ? val uiState by viewModel.uiState.collectAsState() vs val uiState = viewModel.uiState.collectAsState()
0
votes
0 answers

Expected start of the array '[', but had 'EOF' instead at path

I am learning to use apis in android and I am trying to get a list of images from the Dog Ceo api. I am using the kotlin serialization, coil and retrofit library. The Json response looks like this (Note: I've shortened the list because it's so…
0
votes
1 answer

Create multiple applicationScope in a jetpack compose/kotlin application

Is it possible to have multiple application scope in a jetpack compose/kotlin ? I want to manage the first start interface and main interface (with tray) in 2 different application scopes without having mixed code. I'm thinking about something like…
0
votes
2 answers

Minimize/Maximize window in Jetpack Compose

Is there a way to maximize or minimize programmatically the window with Jetpack Compose Desktop ? I'm thinking about that : fun main() { application { Window( title = "My Application", focusable = true, …
0
votes
0 answers

Material UI for Jetpack Compose for Web

I wanted to try out the current state of Jetpack Compose for a simple web application (no Android App). Starting off with the compose-jb/examples/web-landing example, I was wondering, is there already an implementation of Material Design / Material…
0
votes
0 answers

Jetpack Compose detectTransformGestures consumes all gestures

I have taken a look at the following answer and it didn't work How to use detectTransformGestures but not consuming all pointer event The problem: I have a LazyList that I need to scroll vertically, the children composables also are draggable…
yuroyami
  • 814
  • 6
  • 24
0
votes
0 answers

Update jetpcak composable when a static class member changes

I have a Paho MQTT connection, with a callback updating a object and i need to update a coposable.. I can see the in Logcat that i receive information, but the composable is not updated. I am suspecting that the issue is that i am using a static…
Alex P
  • 1
  • 1