Extraidos textos
This commit is contained in:
parent
49aef16922
commit
4b1d224620
|
|
@ -17,10 +17,11 @@ import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
|
import ies.teis.genol_salatiel_ex2tdist.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ExerciseOneCompose() {
|
fun ExerciseOneCompose() {
|
||||||
|
|
@ -30,7 +31,7 @@ fun ExerciseOneCompose() {
|
||||||
TopAppBar(title = {
|
TopAppBar(title = {
|
||||||
Row() {
|
Row() {
|
||||||
Text(
|
Text(
|
||||||
text = "Contadores",
|
text = stringResource(R.string.ej1_contadores),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 10.dp)
|
.padding(horizontal = 10.dp)
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
|
|
@ -38,7 +39,7 @@ fun ExerciseOneCompose() {
|
||||||
if (viewModel.counters.isNotEmpty()) {
|
if (viewModel.counters.isNotEmpty()) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Refresh,
|
Icons.Default.Refresh,
|
||||||
contentDescription = "Reload the app",
|
contentDescription = stringResource(R.string.ej1_reload),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 15.dp)
|
.padding(horizontal = 15.dp)
|
||||||
.clickable { viewModel.resetAll() }
|
.clickable { viewModel.resetAll() }
|
||||||
|
|
@ -86,11 +87,11 @@ fun InputCount(
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = inputState,
|
value = inputState,
|
||||||
onValueChange = { inputState = it },
|
onValueChange = { inputState = it },
|
||||||
placeholder = { Text(text = "Número de contadores:") },
|
placeholder = { Text(text = stringResource(R.string.ej1_num_contadores)) },
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number)
|
||||||
)
|
)
|
||||||
Button(onClick = { onClick(inputState.toInt()) }) {
|
Button(onClick = { onClick(inputState.toInt()) }) {
|
||||||
Text(text = "Mostrar")
|
Text(text = stringResource(R.string.ej1_mostrar))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,13 +137,13 @@ fun ButtonCounter(
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Button(onClick = onIncrement) {
|
Button(onClick = onIncrement) {
|
||||||
Text(text = "Incrementar")
|
Text(text = stringResource(R.string.ej1_incrementar))
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(text = valor.toString())
|
Text(text = valor.toString())
|
||||||
|
|
||||||
Button(onClick = onDecrement) {
|
Button(onClick = onDecrement) {
|
||||||
Text(text = "Decrementar")
|
Text(text = stringResource(R.string.ej1_decrementar))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,10 @@
|
||||||
<string name="launcher_button_two">Exercise Two</string>
|
<string name="launcher_button_two">Exercise Two</string>
|
||||||
<string name="launcher_button_three">Exercise Three</string>
|
<string name="launcher_button_three">Exercise Three</string>
|
||||||
<string name="launcher_button_four">Exercise Four</string>
|
<string name="launcher_button_four">Exercise Four</string>
|
||||||
|
<string name="ej1_contadores">Contadores</string>
|
||||||
|
<string name="ej1_reload">Reload the app</string>
|
||||||
|
<string name="ej1_num_contadores">Número de contadores:</string>
|
||||||
|
<string name="ej1_mostrar">Mostrar</string>
|
||||||
|
<string name="ej1_incrementar">Incrementar</string>
|
||||||
|
<string name="ej1_decrementar">Decrementar</string>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue