Questions tagged [composable]

160 questions
21
votes
3 answers

How to control DropDownMenu position in Jetpack Compose

I have a row with a text align at the start and a image align at the end. When I press the image I'm showing a DropdownMenu, but this appear in the start of the row and I want that appear at the end of the row. I'm trying to use Alignment.centerEnd…
S.P.
  • 2,274
  • 4
  • 26
  • 57
21
votes
4 answers

How to manage Focus state in Jetpack's Compose

I have a custom composable View (Surface + Text essentially) and I want to change the color of the surface depending on the focus state. The FocusManager#FocusNode is marked internal and I am unaware of any way to achieve this. Is this simply just…
15
votes
1 answer

How to individually/separately align child composables inside a Row?

I'm new in jetpack compose and I'm trying to do a simple thing that I can't achieve it. That I want to do is in the same row align one component, in this case a surface, at the start and the other one, the column, at the end of the row. How can get…
S.P.
  • 2,274
  • 4
  • 26
  • 57
14
votes
5 answers

Fixed Grid inside LazyColumn in Jetpack Compose?

Currently in Jetpack Compose, this code throws an IllegalStateException because you cannot nest two vertically scrolling Composables: @ExperimentalFoundationApi @Composable fun MyLazyColumn() { LazyColumn { item { Text(text =…
Majesty
  • 165
  • 1
  • 6
14
votes
2 answers

Why is there only ".sp" in fontSize of Text("") composable and not ".dp" in Jetpack Compose-beta08

I want the size of the text to be in .dp so that it doesn't change according to the system font. How to achieve this in Jetpack Compose "Text" composable
11
votes
2 answers

Jetpack Compose - How can add multiple modifier to a composable and is the order important?

I wanted to know how we can add multiple modifier, for example adding background, padding and more to an android jetpack composable?
Parisa Baastani
  • 1,713
  • 14
  • 31
9
votes
2 answers

decrease size of icon in jetpack compose to match row height

I have the following composable. @Composable fun Temp() { Row( modifier = Modifier .background(Color.Red) .height(IntrinsicSize.Min) .fillMaxWidth() ) { Text(text = "Hello", fontSize =…
6
votes
1 answer

What's the best/recommended way to pass reactive props from components to composables in Vue 3 Composition API?

I'm currently trying out Vue 3's Composition API, using a main app and several composition funtions, aka 'composables'. I studied official docs and several tuts. It seems there are many ways of accomplish the same tasks, so I was wandering what is…
Luca Reghellin
  • 7,426
  • 12
  • 73
  • 118
5
votes
1 answer

How to create a new composable function in Android Studio?

Each time, I need to create a composable function, I do: Right click on a package -> New -> Kotlin Class/File And I end up with this: class MyClass {} Now I have to do three changes manually: Add @Composable annotation Change class with…
Joan P.
  • 2,368
  • 6
  • 30
  • 63
5
votes
0 answers

code reuse for props, emits, useStore in Vue 3

Imagine I have an application that has 10 components that are similar in some ways, but contain different content and some functional differences. But they all receive the same 3 props as a base (in other words they may define more but all define at…
WillD
  • 5,170
  • 6
  • 27
  • 56
5
votes
1 answer

JetPack Compose no effect for clickable item

I have a column with a card in the middle. There should be an action when you click on column, but nothing should happen when you click on the card. (like cancelable dialogs) When I did this with XML, this problem was solved when set the clickable…
5
votes
1 answer

Vue3: how to mix composition api and options api for composable/mixin namespacing

Good day! Let's say I want to use Vue with options api but also do not want to use mixins as they causes a lot of problem. I want to use composables as mixins to give namespacing for mixins/composables. So, my "solution" was to combine options api…
ayb jax
  • 121
  • 1
  • 7
4
votes
0 answers

Compose preview with coil image from url

In my Android app I use Jetpack Compose for the UI. In a screen I'm rendering an image, using a lottie file that is downloaded from a url. The lottie image file is rendered like this: @Composable private fun Image(assetUrl: String) { val…
4
votes
2 answers

Changing the jetpack compose remember variable from within another function

I am developing an application for android devices, using the jetpack compose library. Example I created inside a compose function var taskVeriable = remember {mutableStateOf("Hello World")} I need to update the value of variable from another…
Yavo
  • 43
  • 5
4
votes
1 answer

How to get LatLngBounds from visible map in jetpack compose

I try to use the composable GoogleMap in my project but now I need the LatLngBounds of the visible google map in onMapLoaded so I'm able to load some POI for within this boundaries, but I can't find an answer on how I could get this information. May…
1
2 3
10 11