Fixed
Status Update
Comments
ti...@google.com <ti...@google.com>
co...@google.com <co...@google.com>
ma...@google.com <ma...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 23a7d960caf43390a554700d3c56ada189a9d10e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Aug 10 15:11:36 2020
IconButton / IconToggleButton API scrub
Test: ./gradlew updateApi
Bug: b/161809385
Bug: b/161807956
Relnote: "Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton"
Change-Id: I0a9419b1a631cadad451395302ad87b7f9214f96
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
https://android-review.googlesource.com/1394868
Branch: androidx-master-dev
commit 23a7d960caf43390a554700d3c56ada189a9d10e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Aug 10 15:11:36 2020
IconButton / IconToggleButton API scrub
Test: ./gradlew updateApi
Bug:
Bug:
Relnote: "Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton"
Change-Id: I0a9419b1a631cadad451395302ad87b7f9214f96
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
ma...@google.com <ma...@google.com>
ja...@gmail.com <ja...@gmail.com> #3
This issue also present in androidx.compose.material package
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit cdd989b146a4758f9974b63c2e53e4eb767e961e
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Aug 09 19:42:40 2023
[Menu] Fix offset calculations
Same logic as aosp/2681138, ported to the M2 version.
Bug: b/294103942 , b/293137081
Test: updated MenuTest.kt
Relnote: "Fixed DropdownMenu's `offset` calculation so x offsets
depend solely on the local layout direction, and y offsets will no
longer be reversed when the menu is near the bottom of the screen."
Change-Id: Iccc743f3306d9b259f0cc21d1089d9479df203fb
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidMenu.android.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Menu.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidMenu.android.kt
https://android-review.googlesource.com/2701713
Branch: androidx-main
commit cdd989b146a4758f9974b63c2e53e4eb767e961e
Author: Max Alfonso-Ying <maxying@google.com>
Date: Wed Aug 09 19:42:40 2023
[Menu] Fix offset calculations
Same logic as aosp/2681138, ported to the M2 version.
Bug:
Test: updated MenuTest.kt
Relnote: "Fixed DropdownMenu's `offset` calculation so x offsets
depend solely on the local layout direction, and y offsets will no
longer be reversed when the menu is near the bottom of the screen."
Change-Id: Iccc743f3306d9b259f0cc21d1089d9479df203fb
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
M compose/material/material/src/androidMain/kotlin/androidx/compose/material/AndroidMenu.android.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Menu.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/AndroidMenu.android.kt
ma...@google.com <ma...@google.com>
vi...@gmail.com <vi...@gmail.com> #5
Since offset.y is now always added, what is the recommendation for handling the offset when the popup is top aligned? Is there a mechanism to know that so that I can apply a negative offset to shift it up?
Description
compose-bom = "2023.06.01"
compose-compiler = "1.5.1"
Jetpack Compose component(s) used:
DropdownMenu
Android Studio Build:
Android Studio Giraffe | 2022.3.1
Kotlin version:
1.9.0
Emulator version:
33.1.6
Emulated device:
Pixel 4 (33 api) + google services
Steps to Reproduce or Code Sample to Reproduce:
With i use y offset value from -127.dp to -231.dp DropdownMenu draw in incorrect location
Sample
```
import android.util.Log
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.DropdownMenu
import androidx.compose.material.DropdownMenuItem
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp
@Composable
private fun Test() {
var expanded by remember {
mutableStateOf(false)
}
var yOffset by remember {
mutableStateOf((-125).dp)
}
Box(
modifier = Modifier
.fillMaxSize()
.clickable {
yOffset -= 1.dp
expanded = true
},
contentAlignment = Alignment.Center,
) {
Text(text = "Current offset: $yOffset")
val menuOffset = remember(yOffset) {
DpOffset(200.dp, yOffset).also {
Log.d("TestOffset", "OFFSET = $it")
}
}
DropdownMenu(
expanded = expanded,
offset = menuOffset,
onDismissRequest = { expanded = false },
) {
DropdownMenuItem(onClick = { /*TODO*/ }) {
Text(text = "Item 1")
}
DropdownMenuItem(onClick = { /*TODO*/ }) {
Text(text = "Item 2")
}
DropdownMenuItem(onClick = { /*TODO*/ }) {
Text(text = "Item 3")
}
}
}
}
@Preview
@Composable
fun TestPreview() {
Test()
}
```