Skip to content

Commit

Permalink
feat: add new timezone device config
Browse files Browse the repository at this point in the history
closes #957
  • Loading branch information
andrekir committed Apr 9, 2024
1 parent 19553b5 commit 4f29e7a
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.geeksville.mesh.ui.components.config
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.Divider
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand All @@ -11,6 +12,8 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import com.geeksville.mesh.ConfigProtos.Config.DeviceConfig
import com.geeksville.mesh.copy
Expand Down Expand Up @@ -132,6 +135,22 @@ fun DeviceConfigItemList(
}
item { Divider() }

item {
EditTextPreference(title = "POSIX Timezone",
value = deviceInput.tzdef,
maxSize = 64, // tzdef max_size:65
enabled = enabled,
isError = false,
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Text, imeAction = ImeAction.Done
),
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
onValueChanged = {
deviceInput = deviceInput.copy { tzdef = it }
},
)
}

item {
PreferenceFooter(
enabled = deviceInput != deviceConfig,
Expand Down

0 comments on commit 4f29e7a

Please sign in to comment.