zoha131
01/22/2021, 4:38 PMKshitij Patil
01/22/2021, 4:56 PM7094152
snapshot of accompanist have been released properly or still there are some files to be uploaded? I’m getting read timeout for metadata.xmlShakil Karim
01/22/2021, 6:32 PMchris-horner
01/23/2021, 1:25 AMshowSnackbar
, but if my UI gets recomposed because of a configuration change the Snackbar will show again.
Is the recommended approach to handle the timing in whatever produces state, and after a period of time output state with showSnackbar = false
?Colton Idle
01/23/2021, 5:53 AMHitanshu Dhawan
01/23/2021, 6:15 AMKshitij Patil
01/23/2021, 7:46 AM7094152
and found that LaunchedEffect
no longer accepts subject which used to re-launch the block()
on value changes. What is the alternative then?Kshitij Patil
01/23/2021, 8:18 AMonActive { focusRequester.requestFocus() }
keyboard doesn’t open, when focused manually, it works fine, what could be the issue? is there any other way of doing the same? also, I noticed onActive { }
callback is getting deprecated. What should we use instead?Kshitij Patil
01/23/2021, 1:00 PMClassCastException
for String to AnnotatedString when passing in String to TextFieldValue
in Compose snapshot 7094152
Stacktrace ⤵️Tuba Kesten
01/23/2021, 4:45 PM@Composable
Outer() {
profileResult = viewmodel.field.observeAsState()
Inner(profileResult)
}
@Composable
Inner(myProfileResult: ProfileResult){
NavHost(
navController = editProfileNavController,
startDestination = EditProfileScreen.EditProfile
) {
Timber.d("profileResult1 ${myProfileResult.workEducationItems}")
composable(EditProfileScreen.EditProfile) {
Timber.d("profileResult2 ${myProfileResult.workEducationItems}")
ScrollableColumn(
modifier.padding(top= 100.dp).fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally
) { ....
}
Hi guys, I have a question related to recomposition of NavHost Composable. When the data is refreshed, profileResult1
holds the new data but profileResult2
still hold the old data (even it is recomposed). Anybody has any idea why this is happening 😄 Any solution for that other than passing with Ambient 😄 Thanks!judrummer
01/23/2021, 7:35 PM@Composable
fun TestScreen() {
val context = AmbientContext.current
val nativeView = remember {
EditText(context)
.apply {
layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
addTextChangedListener {
}
}
}
Column(modifier = Modifier.fillMaxWidth()) {
Text(text = "Some Label")
AndroidView(viewBlock = { nativeView })
Text(text = "Some Text")
}
}
I can reproduce in this case
Pixel2XL Android11 -> Keyboard ManMan
But in below list. It’s work fine
Pixel2XL Android11 -> GKeyboard
Oneplus7t Pro Android10 -> Keyboard ManMan
Oneplus7t Pro Android10 -> GKeyboardMehdi Haghgoo
01/23/2021, 7:41 PMjim
01/23/2021, 7:46 PMAndroidView
directly in their apps, and maybe it's because we made the API too pleasant to use or maybe it's because we never really communicated the intent to the community. 🤷. Certainly I never expected to see people remembering the view and then just referencing that view in the viewBlock
, I suppose no API survives first encounter with the user.
Composables are epitomized by their convenient declarative APIs. The older android Views often have imperative APIs with sometimes surprising semantics that need to be papered over, and this wallpaper isn't always straight forward to get right. The intent/expectation was that users would write a composable function who's sole purpose was to wrap a particular Android View, and would provide this wallpaper, such that the widget was pleasant to use in the rest of their application.
Maybe we need to make AndroidView have some more boilerplate and look uglier 😛 😉🤣Colton Idle
01/23/2021, 9:48 PMText
s. (you could even argue that this shouldn't be a separate compasable)
Either way it's legitimately being used in my app and now I've been watching @ppvi (it says Jose if offline, so hopefully that doesn't ping him. Wasn't my intention.) compose testing talk and I want to write a test, but I've never really tested individual views before (not an android and not in any language) and now I'm not sure what to really assert. Maybe since it's such a contrived example there's not much to test and so it's actually a bad candidate, but should I just test that my composable is there with the text that I passed in the parameter? Any guidance would be appreciated.Shakil Karim
01/23/2021, 10:05 PMColton Idle
01/24/2021, 2:28 AMColton Idle
01/24/2021, 4:19 AM@Preview(showBackground = true)
@Composable
fun Beep(){
Text("Boop")
}
is just interesting that it takes like 5 minutes in my old project (because my existing project is super large it just builds slow overall) vs in a brand new project.
What am I actually after? I want to be able to create and iterate on composables quickly and I feel like it might just be easier to create composable in compose-desktop and then just copy pasta back into my actual app.magnumrocha
01/24/2021, 11:29 AMandroidx.ui:ui-tooling:1.0.0-alpha10
?
Execution failed for task ':samples:android:mergeDebugResources'.
> Could not resolve all files for configuration ':samples:android:debugRuntimeClasspath'.
> Could not find androidx.ui:ui-tooling:1.0.0-alpha10.
Searched in the following locations:
- <https://kotlin.bintray.com/kotlinx/androidx/ui/ui-tooling/1.0.0-alpha10/ui-tooling-1.0.0-alpha10.pom>
- <https://dl.google.com/dl/android/maven2/androidx/ui/ui-tooling/1.0.0-alpha10/ui-tooling-1.0.0-alpha10.pom>
- <https://jcenter.bintray.com/androidx/ui/ui-tooling/1.0.0-alpha10/ui-tooling-1.0.0-alpha10.pom>
Required by:
project :android
Ayomide
01/24/2021, 1:02 PMTextField
, and to highlight of the text with colours, say given a list of words to highlight. Basically - syntax highlighting. The image attached gives you an idea of what I mean. Would I have to make my own TextField
component for this?Jason Ankers
01/24/2021, 1:57 PMMihai Hrincescu
01/24/2021, 4:29 PMYashar
01/24/2021, 5:14 PMBox {
Card(...) {
Row(...)
) {
Surface(
modifier = Modifier
.fillMaxHeight()
.fillMaxWidth(0.5f)
.clickable(onClick = { ... }),
color = Color.Red
) {
...
}
Surface(modifier = Modifier.fillMaxSize().clickable(onClick = { ... }), color = Color.Blue) {
...
}
}
}
Card(
modifier = Modifier
.fillMaxWidth()
.height(boxHeight)
.padding(horizontal = 40.dp, vertical = 16.dp)
.swipeable(
state = swipeableState,
anchors = anchors,
thresholds = { _, _ -> FractionalThreshold(0.3f) },
orientation = Orientation.Horizontal
)
.offset { IntOffset(swipeableState.offset.value.roundToInt(), 0) }
) {
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.clickable(onClick = { ... })) {
...
}
}
}
Colton Idle
01/24/2021, 6:29 PMResources
into a composable as a parameter?
👍 or 👎Orhan Tozan
01/24/2021, 7:55 PMJason Ankers
01/25/2021, 7:19 AMPrashant Priyadarshi
01/25/2021, 12:45 PMLilly
01/25/2021, 5:02 PMslideInVertically
slideOutVertically
be buggy? The initialOffsetY/ targetOffsetY should return the half of the content's height but this doesn't match. My content's height is 120 dp but value returns 376 dp 🤔
@Composable
fun SlideVerticallyAnimationComponent(
visibility: Boolean,
offset: Int,
content: @Composable () -> Unit
) {
AnimatedVisibility(
visible = visibility,
enter = slideInVertically(initialOffsetY = { value ->
Timber.e("valueIn: $value") // output: 376 dp
offset
}) + fadeIn(),
exit = slideOutVertically(targetOffsetY = { value ->
Timber.e("valueOut: $value") // output: 376 dp
offset
}),
content = content
)
}
Geert
01/25/2021, 7:47 PMRick Regan
01/25/2021, 9:39 PMText
or TextField
to display a repeating decimal, e.g., 2.(0123456789) (I am resorting to parentheses notation because to the best of knowledge, Android does not support overline, as discussed on this channel last week: https://kotlinlang.slack.com/archives/CJLTWPH7S/ ). The problem I have now is that line breaking rules will break the line after the "." (FYI it breaks up ".(" but not ".1(", for example). I’ve been trying to look for a solution but I really only found this 9-year old one for the regular UI (and it seems like overkill in any case): https://stackoverflow.com/questions/6134457/how-to-prevent-edittext-from-breaking-a-line-after-punctuation.
What I want is a line break only when the text string (in my case digits with other characters like "(", ")", "/", "+", "-", etc.) exceeds the width of the view. Essentially I just want the line breaking rules turned off. Can this be done in Compose? (I am porting a prototype of my app that uses JavaFX, which breaks lines as I desire.)enighma
01/26/2021, 2:22 AMAmbientIndication
but it's not obvious to me what I need to do or r as there call. Do to set it up using Providers(...)
?
I'm trying to change from ripple to something else.enighma
01/26/2021, 2:22 AMAmbientIndication
but it's not obvious to me what I need to do or r as there call. Do to set it up using Providers(...)
?
I'm trying to change from ripple to something else.Kirill Grouchnikov
01/26/2021, 2:25 AMenighma
01/26/2021, 2:26 AMKirill Grouchnikov
01/26/2021, 2:51 AMAlexjlockwood
01/26/2021, 3:13 AMMaterialTheme.kt
as a reference https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]tlin&ss=androidx%2Fplatform%2Fframeworks%2Fsupport:compose%2F
(but also sounds weird that you would be removing the ripple effect too tbh)Louis Pullen-Freilich [G]
01/26/2021, 1:43 PMenighma
01/26/2021, 7:13 PMLouis Pullen-Freilich [G]
01/26/2021, 7:37 PMRippleTheme
to customize the ripples used by components, but this doesn't support replacing / changing what a ripple is.enighma
01/26/2021, 9:07 PMLouis Pullen-Freilich [G]
01/26/2021, 9:33 PMMaterialTheme(...) {
Providers(AmbientRippleTheme provides MyCustomRippleTheme) {
// rest of app
}
}
enighma
01/27/2021, 1:44 AM