mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-11 08:12:26 +01:00
car: Waze gets the cards taken out of its stable area too, and the areas each app is given go in the log
This commit is contained in:
1 parent
bcde51ad56
commit
57803988d4
2 files changed
+4
-1
No files matched your search
@@ -134,7 +134,9 @@ private fun AppSurface(
|
|||||||
LaunchedEffect(template, size, measured, measuredStable, cardsAtEnd) {
|
LaunchedEffect(template, size, measured, measuredStable, cardsAtEnd) {
|
||||||
if (width > 0 && height > 0) {
|
if (width > 0 && height > 0) {
|
||||||
val visible = visibleAreaFor(template, width, height, measured, cardsAtEnd)
|
val visible = visibleAreaFor(template, width, height, measured, cardsAtEnd)
|
||||||
val stable = if (!isContentTemplate(template)) {
|
// Waze seems to centre its car in the stable area rather than the visible one, so it
|
||||||
|
// gets the cards taken out of that too. Test: see whether its car moves out from under them.
|
||||||
|
val stable = if (!isContentTemplate(template) && connection.appPackage != "com.waze") {
|
||||||
visibleAreaFor(template, width, height, measuredStable, cardsAtEnd)
|
visibleAreaFor(template, width, height, measuredStable, cardsAtEnd)
|
||||||
} else {
|
} else {
|
||||||
visible
|
visible
|
||||||
|
|||||||
@@ -600,6 +600,7 @@ class CarAppConnection(private val context: Context) {
|
|||||||
fun reportAreas(visible: Rect, stable: Rect) {
|
fun reportAreas(visible: Rect, stable: Rect) {
|
||||||
areas = visible to stable
|
areas = visible to stable
|
||||||
val callback = surfaceCallback ?: return
|
val callback = surfaceCallback ?: return
|
||||||
|
GearslipLog.i("host: areas for $appPackage: visible=${visible.toShortString()} stable=${stable.toShortString()}")
|
||||||
runCatching { callback.onStableAreaChanged(stable, noop("onStableAreaChanged")) }
|
runCatching { callback.onStableAreaChanged(stable, noop("onStableAreaChanged")) }
|
||||||
runCatching { callback.onVisibleAreaChanged(visible, noop("onVisibleAreaChanged")) }
|
runCatching { callback.onVisibleAreaChanged(visible, noop("onVisibleAreaChanged")) }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user