Fix Discord launcher layout and controller navigation (#596)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-11 20:08:59 -04:00
1 parent 8f5ccbf23f
commit b1690852e9
20 files changed
+278 -75

No files matched your search

@@ -4,9 +4,9 @@ import org.junit.Assert.assertEquals
import org.junit.Test
class LiftSheetTest {
@Test fun theSheetTopIs82dpDownA360dpPane() {
assertEquals(82f, sheetTop(360f, 56f, 16f, 3f), 0.01f)
assertEquals(164f, sheetTop(720f, 56f, 16f, 3f), 0.01f)
@Test fun theSheetTopIs60dpDownA360dpPane() {
assertEquals(60f, sheetTop(360f, 56f, 16f, 3f), 0.01f)
assertEquals(120f, sheetTop(720f, 56f, 16f, 3f), 0.01f)
}
@Test fun theButtonKeeps16dpAboveIt() {
@@ -0,0 +1,29 @@
package com.droiddeck.launcher.ui
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
class StoreGridNavigationTest {
@Test fun downAndUpPreserveEveryColumnAcrossSeveralRows() {
for (columns in 1..6) for (index in 0 until columns * 3) {
val down = storeGridNeighbor(index, columns * 4, columns, 1)!!
assertEquals(index % columns, down % columns)
assertEquals(index, storeGridNeighbor(down, columns * 4, columns, -1))
}
}
@Test fun incompleteLastRowDoesNotWrapBackToTheLeft() {
assertEquals(8, storeGridNeighbor(4, 10, 4, 1))
assertEquals(9, storeGridNeighbor(5, 10, 4, 1))
assertNull(storeGridNeighbor(6, 10, 4, 1))
assertNull(storeGridNeighbor(7, 10, 4, 1))
assertNull(storeGridNeighbor(9, 10, 4, 1))
}
@Test fun firstRowCanLeaveUpwardsAndChangedColumnCountsAreUsed() {
assertNull(storeGridNeighbor(2, 10, 4, -1))
assertEquals(5, storeGridNeighbor(2, 10, 3, 1))
assertEquals(6, storeGridNeighbor(2, 10, 4, 1))
}
}