Skip to content

Commit

Permalink
Adds the top padding back to the map
Browse files Browse the repository at this point in the history
Testing another possible fix for #536
  • Loading branch information
hufman committed Apr 20, 2022
1 parent b1344d6 commit 1879e2c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ 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
reset(mockMap)
whenever(mockMap.getFrame()).then {
mock<Bitmap> {
on { width } doReturn 703
on { height } doReturn 480
on { height } doReturn 400
}
}.thenReturn(null)
whenever(mockMap.compressBitmap(any())).thenReturn(ByteArray(5))
Expand Down

0 comments on commit 1879e2c

Please sign in to comment.