Chachako
05/06/2021, 4:32 PMCicero
05/06/2021, 6:01 PMpatrick
05/07/2021, 3:00 PMste
05/08/2021, 7:31 PM@Stable
or @Immutable
annotations, anti-patterns etc) as I'm quite new to compose 😅 Thank you!Zhelyazko Atanasov
05/09/2021, 3:38 AMandrew
05/09/2021, 3:10 PMDoris Liu
05/09/2021, 8:52 PMCustomLayout
has all the info they need to perform hit test. So if you want them to be dragged independently, the draggable
should be on the child level.Equilat
05/10/2021, 11:33 AMstruct DefaultButton: View {
var body: some View {
Button("Button"){}
.buttonStyle(ButtonDefaultStyle())
}
}
My style is in an external class.
struct ButtonDefaultStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.frame(width: 100, height: 40)
.foregroundColor(Color( colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)))
.background(configuration.isPressed ? Color( colorLiteral(red: 0.1254901961, green: 0.4666666667, blue: 0.4235294118, alpha: 1)) : Color( colorLiteral(red: 0.1411764706, green: 0.6784313725, blue: 0.5529411765, alpha: 1)))
.clipShape(RoundedRectangle(cornerRadius: 50))
.font(Font.custom("EuclidSquare-Medium", size: 16))
}
}
The best would be to be able to override a style by another style or by an attribute (Button().{}.style1(...).style2(...).color(...)...
Is there a way to do something similar in Compose ?
If not, did I misunderstood Compose philosophy or is it just something currently lacking ?
Thread in Slack ConversationFunkyMuse
05/11/2021, 7:12 AMShivam Sethi
05/11/2021, 4:27 PMorg.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.backend.jvm.lower
Orhan Tozan
05/12/2021, 1:16 PMMuhammad Zaryab Rafique
05/13/2021, 3:30 AMrobnik
05/13/2021, 2:22 PMandrew
05/14/2021, 1:22 PMTracy Chou
05/15/2021, 2:49 AMNurseyit Tursunkulov
05/15/2021, 6:03 AMNurseyit Tursunkulov
05/15/2021, 6:04 AMOutlinedTextField(
value = email,
isError = emailContainsError,
label = { Text(emailErrorText) }
)
but it gives me the following result
I got the desired result only when get focus:
how to show the error without focusing?Rafs
05/15/2021, 9:30 AMNurseyit Tursunkulov
05/15/2021, 5:04 PMColton Idle
05/16/2021, 10:00 PMmutableStateOf(listOf(T))
or mutableStateListOf(T)
and so I'm going over the state codelab to try and learn.
Compose codelab uses mutableStateOf(listOf(T))
but it has a TODO for switching over to mutableStateListOf(T)
but the switch wasn't made because of a bug that has since been fixed.
If it's recommended to actually go with mutableStateListOf, can the codelab be updated as per the TODO? https://github.com/googlecodelabs/android-compose-codelabs/blob/main/StateCodelab/[…]finished/src/main/java/com/codelabs/state/todo/TodoViewModel.ktKshitij Patil
05/17/2021, 9:53 AMdewildte
05/18/2021, 4:36 AMShakil Karim
05/18/2021, 7:43 AMste
05/18/2021, 12:15 PMDrawer
. When button1
is clicked, the drawer pops up and shows content1
, when button2
is clicked, content2
is shown instead. And so on.
It makes no sense to create two (or n
) drawers, because their visibility is mutually exclusive: it makes more sense to have a single Drawer
, and then dynamically change its content. This also improve performance.
Actually, I store a key: String
using rememberSaveable
, and I retrieve the drawer content using that key. Then, when buttonN
is clicked, I change the key to "contentN"
, so the drawer pops up displaying contentN
.
This solution works, however, is there a more elegant way to achieve this?Vinay Gaba
05/18/2021, 7:33 PMKlaas Kabini
05/18/2021, 7:37 PMChachako
05/19/2021, 4:52 AMjim
05/19/2021, 5:03 AMnitrog42
05/19/2021, 12:50 PMclasspath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
for classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"
🙃 in my main build.gradle