Skip to content

Commit

Permalink
Fix cameras locations (#5)
Browse files Browse the repository at this point in the history
* fix cameras button locations
  • Loading branch information
makeevrserg authored Sep 2, 2024
1 parent c82c540 commit 1358f05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ import com.flipperdevices.ifrmvp.model.buttondata.ButtonData.ButtonType

internal class CameraMap : BrandMap by BrandMap.Default(
getMap = {
val singleButtonLocations = buildList {
Position(x = 0, y = 0).run(::add)
Position(x = 1, y = 0).run(::add)
Position(x = 3, y = 0).run(::add)
Position(x = 4, y = 0).run(::add)
(0..4).map { x -> Position(x = x, y = 1) }.run(::addAll)
(0..4).map { x -> Position(x = x, y = 10) }.run(::addAll)
}.toMutableList()
val navigationLocations = mutableListOf(
Position(x = 1, y = 7, containerHeight = 3, containerWidth = 3)
)
ButtonType.entries.associateWith {
when (it) {
ButtonType.POWER -> mutableListOf(
Expand All @@ -15,24 +26,15 @@ internal class CameraMap : BrandMap by BrandMap.Default(
ButtonType.UNKNOWN,
ButtonType.TEXT,
ButtonType.ICON,
ButtonType.BASE64_IMAGE -> buildList {
Position(x = 0, y = 0).run(::add)
Position(x = 1, y = 0).run(::add)
Position(x = 3, y = 0).run(::add)
Position(x = 4, y = 0).run(::add)
(0..4).map { x -> Position(x = x, y = 1) }.run(::addAll)
(0..4).map { x -> Position(x = x, y = 10) }.run(::addAll)
}.toMutableList()
ButtonType.BASE64_IMAGE -> singleButtonLocations


ButtonType.SHUTTER -> mutableListOf(
Position(x = 1, y = 3, containerHeight = 3, containerWidth = 3)
)

ButtonType.OK_NAVIGATION,
ButtonType.NAVIGATION -> mutableListOf(
Position(x = 1, y = 7, containerHeight = 3, containerWidth = 3)
)
ButtonType.NAVIGATION -> navigationLocations


ButtonType.VOLUME,
Expand Down

This file was deleted.

0 comments on commit 1358f05

Please sign in to comment.