Koneko Toujou
09/10/2021, 10:41 PMMehmet Peker
09/11/2021, 12:21 AMKoneko Toujou
09/11/2021, 2:35 AMKoneko Toujou
09/11/2021, 3:35 AMRafs
09/11/2021, 10:17 AMsheetBackgroundColor
and the backgroundColor
of the BottomSheetScaffold
are the same. I'm not sure if the shadow is there in the first image but I clearly cannot see it, it all looks flattened to me.Sean Proctor
09/11/2021, 12:12 PMColumn(modifier = Modifier.fillMaxSize()) {
LazyColumn(
modifier = Modifier
.fillMaxWidth()
.weight(1f)
) {
items(lines) { line ->
Text(line)
}
}
TextField(...)
}
If I put a SelectionContainer around the LazyColumn with the same modifier, it doesn't work as I expected. Anyone know why?Koneko Toujou
09/11/2021, 3:01 PMModifier.padding
Modifier.offset
(or any other position modifier)
Modifier.requiredHeight
(or any other size modifier)
For example
Text(
modifier = Modifier
.padding(horizontal = 16.dp)
.requiredHeight(50.dp)
.offset(10.dp)
)
And
Text(
modifier = Modifier
.requiredHeight(50.dp)
.offset(10.dp)
.padding(horizontal = 16.dp)
)
In which both have a height of 50 and offset of 10, and a padding of 16Koneko Toujou
09/11/2021, 3:53 PMModifier
implemented such that this
or it
does not need to be passed to it or any of its methods?
As the only way I can think of is as a command list builder or similar
As Modifier
seems to immediately be a very powerful tool to implement parameters and such with due to its simplicity and everything that can be modified is in a single class so it is easy to find a parameter of interest instead of having to search through lots of additional methods and such that might not be related to parameters at allCicero
09/11/2021, 3:54 PMrajesh
09/11/2021, 4:42 PMButton()
and fill it with white color, but it gets filled with theme's primary color and not the white color.
Button(
modifier = Modifier
.size(80.dp)
.clip(CircleShape)
.background(Color.White)
// .background(MaterialTheme.colors.surface) //It's also not working
.border(5.dp, Color.White, CircleShape),
onClick = { })
{
}
Mjahangiry75
09/11/2021, 4:43 PMscaleIn()
?Koneko Toujou
09/12/2021, 5:08 AMsaket
09/12/2021, 6:44 AMSoftwareKeyboardController#show
doesn’t work super reliably for their composable? I’m using it to auto-show the keyboard when a dialog is shown but I’m forced to use a small delay. I was wondering how are others showing keyboard?
val keyboardController = LocalSoftwareKeyboardController.current
val requester = remember { FocusRequester() }
TextField(
modifier = Modifier.focusRequester(requester),
value = ...,
onValueChange = ...
)
LaunchedEffect(Unit) {
delay(50)
focusRequester.requestFocus()
keyboardController?.show()
}
Florian
09/12/2021, 7:35 AMcollectAsState
on a Flow vs observeAsState
from LiveData?Florian
09/12/2021, 10:41 AMmodifier
parameter on my own composables and apply them to the outer-most composable in that function, right? Is the same also the case for my composable that just holds the entire screen content? it's not reusable and I don't need to pass any modifiers to it since it's handled internally.Rafs
09/12/2021, 1:14 PMLazyColumn
. Here is what I have but it looks too hacky to me even though it works really well. Code in thread....adjpd
09/12/2021, 2:17 PMColumn(horizontalAlignment = Alignment.CenterHorizontally)
to? Column(horizontalAlignment = .CenterHorizontally)
to improve readability? It would be a, seemingly, simply thing but would increase the readbility to codebases massively.Rob
09/12/2021, 4:30 PMArchie
09/12/2021, 5:05 PMresistance
in:
Modifier.swipeable(
state = swipeableState,
anchors = anchors,
reverseDirection = false,
thresholds = { _, _ -> FractionalThreshold(0.0f) },
resistance = resistanceConfig(anchors.keys, 0f, 0f), // This right here...
orientation = Orientation.Vertical,
)
No matter what value I set it in, I can’t seem to see the difference in the Swipe behaviorAyfri
09/12/2021, 6:45 PMSlackbot
09/12/2021, 7:26 PMrobercoding
09/12/2021, 8:10 PMmodifier.draggable(...)
to detect dragging from user.
I want to know when user stops dragging, what's the best way to get this information? Is it possible with draggable(...)
or there's other modifier that provides this exact information?Rick Regan
09/13/2021, 1:50 AMScaffold
within a Scaffold
. At the top level it has a Scaffold with a NavHost
in the lambda, and each screen listed in the NavHost (composable
) has a Scaffold (no lambda). I think I see at least one reason why it does this -- to have a single NavHost at the top and to give each screen its own topBar
-- but I wasn't expecting nested Scaffolds to be a thing (I had thought of it, obviously incorrectly, as a once-per-screen construct). In any case, I wanted to confirm that this is the best (only?) way to structure an app when using navigation.ritesh
09/13/2021, 8:16 AMAS Artic fox 2020.3.1 Patch 2
compose version - 1.0.1
theapache64
09/13/2021, 8:46 AMtheapache64
09/13/2021, 10:49 AMassertIs[Not]Displayed
and assert[DoesNot]Exists
? 🤔dead.fish
09/13/2021, 10:57 AMAndroidComposeTestRule
is not of much use for me, the implementation basically has two issues:
1. It doesn't work with Fragments, since setContent
is directly called on the Activity
of an ActivityScenario
, ignoring fragment semantics completely.
2. It's impossible to test the UI with the viewmodel in integration, as one basically has to manually connect the `ViewModel`s state flow to a separate setContent
call on the test rule, ignoring the beef of the viewmodel / view integration altogether.
I wish the test architecure in compose would have been written around the fact to have an injectable Recomposer
for testing purposes.Orhan Tozan
09/13/2021, 12:24 PMLukasz Burcon
09/13/2021, 12:44 PMderivedStateOf
is misleading, and it that SideEffect should be declared in remember
using no keys to really benefit from its caching mechanism.
Here’s a documentation using keys with remember with derivedStateOf:
<https://developer.android.com/jetpack/compose/side-effects#derivedstateof>
And here’s a documentation that doesn’t use keys in remembers:
<https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#derivedStateOf(kotlin.Function0)>
Any thoughts on that?Orhan Tozan
09/13/2021, 12:49 PMOrhan Tozan
09/13/2021, 12:49 PMFilip Wiesner
09/13/2021, 12:51 PMOrhan Tozan
09/13/2021, 12:51 PMFilip Wiesner
09/13/2021, 12:53 PMOrhan Tozan
09/13/2021, 12:54 PMFilip Wiesner
09/13/2021, 12:56 PMOrhan Tozan
09/13/2021, 12:57 PMFilip Wiesner
09/13/2021, 1:09 PMLocalDensity
with constant fontScale
. But again, I highly doubt non-scaling text is good UX. I think it's just a bad compromise for "nice" UI.
There is a reason why it's not a straightforward solution.eygraber
09/13/2021, 2:26 PMFilip Wiesner
09/13/2021, 2:34 PMLocalDensity
override was just the first thing that I thought of.Albert Chang
09/13/2021, 3:28 PMfontSize = with(LocalDensity.current) { 20.dp.toSp() }
should be enough.