From 1879e2c106c433d70d003a86e1b3acfd391b50c2 Mon Sep 17 00:00:00 2001 From: Walter Huf Date: Wed, 20 Apr 2022 08:23:42 -0700 Subject: [PATCH] Adds the top padding back to the map Testing another possible fix for #536 --- .../me/hufman/androidautoidrive/carapp/FullImageView.kt | 8 ++++---- .../me/hufman/androidautoidrive/carapp/maps/MapAppMode.kt | 2 +- .../java/me/hufman/androidautoidrive/FullImageViewTest.kt | 4 ++-- .../java/me/hufman/androidautoidrive/MapAppTest.kt | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/me/hufman/androidautoidrive/carapp/FullImageView.kt b/app/src/main/java/me/hufman/androidautoidrive/carapp/FullImageView.kt index 1c61bcdef..28ce47ad2 100644 --- a/app/src/main/java/me/hufman/androidautoidrive/carapp/FullImageView.kt +++ b/app/src/main/java/me/hufman/androidautoidrive/carapp/FullImageView.kt @@ -52,8 +52,8 @@ class FullImageView(val state: RHMIState, val title: String, val config: FullIma if (focused) { Log.i(TAG, "Showing map on full screen") imageComponent.setProperty(RHMIProperty.PropertyId.WIDTH.id, config.rhmiDimensions.visibleWidth) - imageComponent.setProperty(RHMIProperty.PropertyId.HEIGHT.id, config.rhmiDimensions.visibleHeight) - frameUpdater.showWindow(config.rhmiDimensions.visibleWidth, config.rhmiDimensions.visibleHeight, imageModel) + imageComponent.setProperty(RHMIProperty.PropertyId.HEIGHT.id, config.rhmiDimensions.appHeight) + frameUpdater.showWindow(config.rhmiDimensions.visibleWidth, config.rhmiDimensions.appHeight, imageModel) focusEvent.triggerEvent(mapOf(0 to inputList.id, 41 to 3)) } else { Log.i(TAG, "Hiding map on full screen") @@ -114,8 +114,8 @@ class FullImageView(val state: RHMIState, val title: String, val config: FullIma imageComponent.setVisible(true) imageComponent.setProperty(RHMIProperty.PropertyId.POSITION_X.id, -config.rhmiDimensions.paddingLeft) // positionX - imageComponent.setProperty(RHMIProperty.PropertyId.POSITION_Y.id, -config.rhmiDimensions.paddingTop) // positionY +// imageComponent.setProperty(RHMIProperty.PropertyId.POSITION_Y.id, -config.rhmiDimensions.paddingTop) // positionY imageComponent.setProperty(RHMIProperty.PropertyId.WIDTH.id, config.rhmiDimensions.visibleWidth) - imageComponent.setProperty(RHMIProperty.PropertyId.HEIGHT.id, config.rhmiDimensions.visibleHeight) + imageComponent.setProperty(RHMIProperty.PropertyId.HEIGHT.id, config.rhmiDimensions.appHeight) } } \ No newline at end of file diff --git a/app/src/main/java/me/hufman/androidautoidrive/carapp/maps/MapAppMode.kt b/app/src/main/java/me/hufman/androidautoidrive/carapp/maps/MapAppMode.kt index b505d7016..0a3131ccd 100644 --- a/app/src/main/java/me/hufman/androidautoidrive/carapp/maps/MapAppMode.kt +++ b/app/src/main/java/me/hufman/androidautoidrive/carapp/maps/MapAppMode.kt @@ -26,7 +26,7 @@ class DynamicScreenCaptureConfig(val fullDimensions: RHMIDimensions, } override val maxWidth: Int = fullDimensions.visibleWidth - override val maxHeight: Int = fullDimensions.visibleHeight + override val maxHeight: Int = fullDimensions.appHeight override val compressFormat: Bitmap.CompressFormat = Bitmap.CompressFormat.JPEG override val compressQuality: Int get() { diff --git a/app/src/test/java/me/hufman/androidautoidrive/FullImageViewTest.kt b/app/src/test/java/me/hufman/androidautoidrive/FullImageViewTest.kt index aec5b44c7..26af294b9 100644 --- a/app/src/test/java/me/hufman/androidautoidrive/FullImageViewTest.kt +++ b/app/src/test/java/me/hufman/androidautoidrive/FullImageViewTest.kt @@ -35,12 +35,12 @@ class FullImageViewTest { val fullImageView = FullImageView(this.fullImageState, "Map", fullImageConfig, mock(), mock()) fullImageView.initWidgets() assertEquals(703, fullImageView.imageComponent.properties[RHMIProperty.PropertyId.WIDTH.id]?.value) - assertEquals(480, fullImageView.imageComponent.properties[RHMIProperty.PropertyId.HEIGHT.id]?.value) + assertEquals(400, fullImageView.imageComponent.properties[RHMIProperty.PropertyId.HEIGHT.id]?.value) appSettings[AppSettings.KEYS.MAP_WIDESCREEN] = "true" fullImageView.initWidgets() assertEquals(1211, fullImageView.imageComponent.properties[RHMIProperty.PropertyId.WIDTH.id]?.value) - assertEquals(480, fullImageView.imageComponent.properties[RHMIProperty.PropertyId.HEIGHT.id]?.value) + assertEquals(400, fullImageView.imageComponent.properties[RHMIProperty.PropertyId.HEIGHT.id]?.value) } @Test diff --git a/app/src/testGmap/java/me/hufman/androidautoidrive/MapAppTest.kt b/app/src/testGmap/java/me/hufman/androidautoidrive/MapAppTest.kt index 3d9a244e2..3733cf9c3 100644 --- a/app/src/testGmap/java/me/hufman/androidautoidrive/MapAppTest.kt +++ b/app/src/testGmap/java/me/hufman/androidautoidrive/MapAppTest.kt @@ -142,7 +142,7 @@ class MapAppTest { // show the map screen mockClient.rhmi_onHmiEvent(1, "", app.fullImageView.state.id, 1, mapOf(4.toByte() to true)) - verify(mockMap).changeImageSize(703, 480) + verify(mockMap).changeImageSize(703, 400) verify(mockController).showMap() // Send the fullsize map @@ -150,7 +150,7 @@ class MapAppTest { whenever(mockMap.getFrame()).then { mock { on { width } doReturn 703 - on { height } doReturn 480 + on { height } doReturn 400 } }.thenReturn(null) whenever(mockMap.compressBitmap(any())).thenReturn(ByteArray(5))