Skip to content

Commit

Permalink
fix: missing init values for LandscapeInputUIMode
Browse files Browse the repository at this point in the history
Supply the initial values so it can correctly converting `String` to `enum`.

Fix #930
  • Loading branch information
goofyz committed Nov 24, 2023
1 parent 83c2f74 commit 19b62f5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ enum class LandscapeInputUIMode {
;

companion object {
private val convertMap: HashMap<String, LandscapeInputUIMode> = hashMapOf()
private val convertMap: HashMap<String, LandscapeInputUIMode> =
hashMapOf(
Pair("AUTO_SHOW", AUTO_SHOW),
Pair("ALWAYS_SHOW", ALWAYS_SHOW),
Pair("NEVER_SHOW", NEVER_SHOW),
)

fun fromString(mode: String): LandscapeInputUIMode {
val type = convertMap[mode.uppercase(Locale.getDefault())]
Expand Down

0 comments on commit 19b62f5

Please sign in to comment.