rajesh
06/29/2021, 6:31 PMfun doSomething(onClick: ()->Unit) {
//doing something
Text("some text", modifier = Modifier.clickable(onClick = onClick + //something that I want to execute here which can't be sent in onClick param)
}
Peter Mandeljc
06/30/2021, 7:10 AMjulioyg
06/30/2021, 7:47 AMproduceState
delegate from the network and it's called every time I go back, is that the expected behavior or something I'm doing wrong?rajesh
06/30/2021, 8:56 AMmartinsumera
06/30/2021, 9:21 AMshowLayoutBounds
is supported within compose but it is integrated deep inside the UI core. I wonder if it is possible to create something like this on my own without tampering with the core. For example, by some modifier which adds some behavior to all subsequent composables.Tin Tran
06/30/2021, 9:24 AMscale(Scale.FILL)
but it didn’t workOrhan Tozan
06/30/2021, 9:28 AMBerkeli Alashov
06/30/2021, 10:31 AMDaniele Segato
06/30/2021, 10:46 AMval scale by animateFloatAsState(
targetValue = when {
badgeText.isNullOrBlank() -> 0f
else -> 1f
},
animationSpec = spring(
dampingRatio = Spring.DampingRatioMediumBouncy
)
)
This makes my badge jump a bit with an animation when a new badge is shown on my icon.
I also want to make it bounce a bit when it changes value (ex. badgeText "1" -> "2"), say bounce to 1.2f scale and than back to 1f.
What's the best way to cause this nudge? I suppose I have to use a LaunchEffect
but than I do not know how to nudge the scale value in an efficient way, thanks in advance for any answerStefMa
06/30/2021, 11:07 AMsuppress
compiler argument".
Is there something in the pipeline?
Or is compose, unfortunately, now 100% coupled to an specific Kotlin release and we have to wait for a new release of compose each time a new Kotlin version comes out?Marko Novakovic
06/30/2021, 11:11 AMPiotr Prus
06/30/2021, 11:15 AMliteMode
and SnapshotReadyCallback. With this code(code in thread), I am getting crash with error: Bitmap size needs to be more than 0. How can I set the initial size of the googleMap?Nick
06/30/2021, 1:13 PMAppWidget
on Android. Compose doesn’t work in AppWidgets
. I believe I saw someone on here mention being able to convert a Composable
to an ImageView
? Is that possible?Colton Idle
06/30/2021, 1:57 PMjulioromano
06/30/2021, 2:37 PMBasicTextField
, that pressing the Android back button triggers a “de-focus” of the textfield. This results in the user having to press back twice for backwards navigation: the first press is to de-focus the text field and the second is to actually navigate to the previous screen.
Has anyone experienced this too? I assume this is by design, how to work around this (i.e. navigate back immediately without the de-focus first)?alorma
06/30/2021, 3:11 PMAlertDialog
with custom content? like I want to show a list of itms to select one (like old android AlertDialog.singleChoice())KoskiA
06/30/2021, 3:37 PMTransactionTooLargeException
). Compose inflated our saved state by 3x for the Fragment! Kind of surprising given the functional, state-hoisting nature of Compose.
I've done some investigating, and there is no smoking-gun culprit, just some inefficiencies (assuming their not required) that add up on complex screens. Findings in 🧵Daniele Segato
06/30/2021, 4:27 PMTextField
when opening?
I've a big form with TextFields. When i click on one close to the bottom of the screen the IME open up and cover it is there a way to make the view scroll up just enough so that the TextField is visible?
Is this supposed to happen or am I doing something wrong?Hardeep Singh
06/30/2021, 5:02 PMsaket
06/30/2021, 5:31 PMerror: this version (1.0.0-beta09) of the Compose Compiler requires Kotlin version 1.5.10 but you appear to be using Kotlin version 1.4.31 which is not known to be compatible. Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
I’ve already tried declaring kotlinCompilerVersion
and kotlinCompilerExtensionVersion
under composeOptions
.Orhan Tozan
06/30/2021, 9:30 PMColton Idle
06/30/2021, 10:22 PMvar myCount by remember { mutableStateOf(0) }
val shouldDisplay = remember { derivedStateOf { (myCount > 1) } }
mattinger
06/30/2021, 10:31 PMBen Abramovitch
06/30/2021, 10:59 PMColton Idle
07/01/2021, 3:28 AMOutlinedTextFieldWithFocusLostError
I have this
var focusLostCount by remember { mutableStateOf(0) }
val shouldDisplayError by remember { derivedStateOf { (focusLostCount > 1) } }
OutlinedTextField( modifier = Modifier.fillMaxWidth(1f)
.onFocusChanged { focusState -> if (!focusState.isFocused) { focusLostCount++ } },
So basically I just want a quick solution on a user clicking on a text field, and then clicking away onto another text field, hence triggering shouldDisplayError which itself runs some validation to check if the input is empty. Having a counter seems a little fishy though, hence the question.Bagadeshkumar R
07/01/2021, 5:18 AMlhwdev
07/01/2021, 7:38 AMgraphicsLayer { /* this lambda */ }
so far harder to debug.
Why does this happen?Marcin Środa
07/01/2021, 7:48 AMnull
value during loading data from network?
version: 3.0.0, compose: 1.0.0-beta08Law Gimenez
07/01/2021, 8:07 AMcreateDataStore
method not found. I already added the library on Gradle. I’m following Google’s documentation by the wayLaw Gimenez
07/01/2021, 8:07 AMcreateDataStore
method not found. I already added the library on Gradle. I’m following Google’s documentation by the waypatrick
07/01/2021, 8:13 AMLaw Gimenez
07/01/2021, 8:20 AMpatrick
07/01/2021, 8:28 AMval Context.myDataStore by preferencesDataStore(
name = "settings",
produceMigrations = { context ->
listOf(
SharedPreferencesMigration(context, "settings")
)
}
)
?Law Gimenez
07/01/2021, 8:30 AMpatrick
07/01/2021, 8:33 AMval Context.myDataStore by preferencesDataStore(
name = "filename",
produceMigrations = { context ->
listOf(
SharedPreferencesMigration(context, "settings")
)
}
)
object OnlineJobPreferences{
fun save(context: Context, jobPreferences: String){
val dataStore = context.myDataStore
dataStore.updateData { ... }
}
}
You can access the datastore anywhere in your codebase by calling myDataStore
on a context and the migration should happen automaticallyLaw Gimenez
07/01/2021, 8:36 AMpatrick
07/01/2021, 8:37 AMLaw Gimenez
07/01/2021, 8:37 AM