https://kotlinlang.org logo
g

Geert

10/08/2020, 8:59 AM
I was updating to alpha04, but I saw gravity was deprecated and align was the automatic replacement. So i used Android Studio to replace it, but align wasn’t imported, and could not be. Except doing this by hand I noticed. Also the autocomplete for this is gone. Is this a known issue?
a

allan.conda

10/08/2020, 9:01 AM
Not an issue, align is now under ColumnScope, RowScope, BoxScope
g

Geert

10/08/2020, 9:01 AM
Yeah, I know that I had to import
import androidx.compose.foundation.layout.RowScope.Companion.align
a

allan.conda

10/08/2020, 9:02 AM
Not just import, you have to be under the scope
1
Copy code
// works
Column {
  Row(Modifier.align(...)
} 
// just this won't work
Row(Modifier.align())
// unless you have something like
fun ColumnScope.SomeSubComponent() {
   Row(Modifier.align())
}
1
✔️ 1
12 Views