16 questions
-1
votes
2
answers
129
views
How to set a drawable object instance as a background of a LazyColumn?
I mean a Drawable generated dynamically, not a file from res/drawable.
I tried setting it as a background of the modifier, but it doesn't accept a Drawable instance object. In Java, it was done like ...
2
votes
2
answers
99
views
How to align specific children in a LazyColumn?
How can I align horizontally a particular children in a LazyColumn? it worked perfectly using Column, but it doesn't work in LazyColumn because I can't import Modifier.align for each particular item ...
0
votes
0
answers
131
views
Why my tablayout row content doesnt fit the screen in jetpack compose?
I created a TabLayout on one screen in Jetpack compose and created two pages.I created a TabLayout on one screen in Jetpack compose and created two pages, but there is a problem: even if the content ...
0
votes
1
answer
895
views
Jetpack Compose: swipeable anchors depend on the on size of the component
The documentation provides a sample of the swipeable modifier. However, the sample defines anchors with hardcoded values.
@OptIn(ExperimentalMaterialApi::class)
@Composable
private fun SwipeableSample(...
7
votes
2
answers
3k
views
Preview java.lang.NoSuchMethodError: androidx.compose.foundation.layout.SizeKt.fillMaxWidth$default
I started migrate our code to Compose and have problem with @Preview.
For example, when I use modifier.fillMaxWidth() without default param "fraction = 1f" I have render problem
java.lang....
1
vote
1
answer
201
views
Why is requiredSizeIn not the same as requiredWidthIn + requiredHeightIn with the same parameter values?
I have the below code
LazyColumn(
contentPadding = PaddingValues(all = 64.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
item {
Box(
...
0
votes
1
answer
163
views
Restrict compose modifier that only accessible from my composable function
I have a composable function:
@Composable
fun GapText(
modifier: Modifier,
text: String,
) {
Row(modifier = modifier) {
Text(text = text)
...
}
}
Now I want to create ...
0
votes
0
answers
116
views
detectTransformGestures detecting a second gesture (with zoom = 1f) after every gesture (when refactored to custom modifier)
I'm trying to refactor my code for a pinch/zoom functionality into a custom modifier. However, when I move the code to a custom modifier, the PointerInputScope.detectTransformGestures onGesture lambda ...
2
votes
2
answers
4k
views
Android Compose ModalBottomSheetLayout outside click
I want to catch event when user clicks outside of ModalBottomSheetLayout.
I wrapped ModalBottomSheetLayout with Box which is full size of the screen and set click listener. But Click listener only ...
1
vote
1
answer
2k
views
Compose: 2 AppBars with different ScrollBehavior for single page
A "genius" designer wants a screen with 2 app-bars and different scroll behaviors. The top one should appear only when user scrolls till the begin of the screen, the second one should appear ...
1
vote
2
answers
496
views
How to add compose modifiers based on other surrounding views?
I am unable to get the expected results as shown in the picture below. There are 2 rules to follow
The horizontal line should not continue till the bottom text. Instead, it should just be the height ...
2
votes
1
answer
776
views
In Jetpack Compose, Does paddingFromBaseline alter the padding of a Text element?
@Composable
fun Sample(){
val startPadding = 10.dp
Column {
Text(
text = "sample text",
modifier = Modifier
.paddingFromBaseline(top = ...
2
votes
0
answers
801
views
How to create a lint warning like "Modifier parameter should be the first optional parameter"?
How to create a lint warning like this?
Lint Warning
I am clear on Why this warning is shown and how to fix it.
I am interested in understanding how this lint warning is created and is there a way to ...
1
vote
1
answer
2k
views
Jetpack compose merge two Modifier.clickable [duplicate]
I'm trying to design a modifier that can be used in composable where if you click, it'll automatically log something. e.g. Modifier.logClick = then(Modifier.clickable{ //log })
The problem here is ...
0
votes
1
answer
71
views
Weird behaviour from Interactive Line in Cavnas
I created an interactive line, but that might be irrelevant. Even if there was no interaction, this renders unexpected results:-
@Composable
fun PowerClock() {
var dynamicAngle by remember { ...
3
votes
3
answers
4k
views
Scroll Two Lazy Scrollers Together
This question has been asked before, but in different forms, regarding some specific use cases, and so far there has been no answer. I finally got it working, so I am sharing this here, but this ...