|
|
@ -1,30 +1,16 @@ |
|
|
|
package org.jetbrains.compose.resources.demo.shared |
|
|
|
package org.jetbrains.compose.resources.demo.shared |
|
|
|
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Column |
|
|
|
import androidx.compose.foundation.layout.* |
|
|
|
import androidx.compose.foundation.layout.PaddingValues |
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth |
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.padding |
|
|
|
|
|
|
|
import androidx.compose.foundation.rememberScrollState |
|
|
|
import androidx.compose.foundation.rememberScrollState |
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape |
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape |
|
|
|
import androidx.compose.foundation.verticalScroll |
|
|
|
import androidx.compose.foundation.verticalScroll |
|
|
|
import androidx.compose.material3.CardDefaults |
|
|
|
import androidx.compose.material3.* |
|
|
|
import androidx.compose.material3.MaterialTheme |
|
|
|
import androidx.compose.runtime.* |
|
|
|
import androidx.compose.material3.OutlinedCard |
|
|
|
|
|
|
|
import androidx.compose.material3.OutlinedTextField |
|
|
|
|
|
|
|
import androidx.compose.material3.Text |
|
|
|
|
|
|
|
import androidx.compose.material3.TextFieldDefaults |
|
|
|
|
|
|
|
import androidx.compose.runtime.Composable |
|
|
|
|
|
|
|
import androidx.compose.runtime.LaunchedEffect |
|
|
|
|
|
|
|
import androidx.compose.runtime.getValue |
|
|
|
|
|
|
|
import androidx.compose.runtime.mutableStateOf |
|
|
|
|
|
|
|
import androidx.compose.runtime.remember |
|
|
|
|
|
|
|
import androidx.compose.runtime.setValue |
|
|
|
|
|
|
|
import androidx.compose.ui.Modifier |
|
|
|
import androidx.compose.ui.Modifier |
|
|
|
import androidx.compose.ui.unit.dp |
|
|
|
import androidx.compose.ui.unit.dp |
|
|
|
import components.resources.demo.shared.generated.resources.Res |
|
|
|
import components.resources.demo.shared.generated.resources.Res |
|
|
|
import org.jetbrains.compose.resources.stringResource |
|
|
|
|
|
|
|
import org.jetbrains.compose.resources.stringArrayResource |
|
|
|
import org.jetbrains.compose.resources.stringArrayResource |
|
|
|
import org.jetbrains.compose.resources.readResourceBytes |
|
|
|
import org.jetbrains.compose.resources.stringResource |
|
|
|
|
|
|
|
|
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun StringRes(paddingValues: PaddingValues) { |
|
|
|
fun StringRes(paddingValues: PaddingValues) { |
|
|
@ -56,7 +42,7 @@ fun StringRes(paddingValues: PaddingValues) { |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
value = stringResource(Res.string.app_name), |
|
|
|
value = stringResource(Res.string.app_name), |
|
|
|
onValueChange = {}, |
|
|
|
onValueChange = {}, |
|
|
|
label = { Text("Text(stringResource(Res.string.app_name)") }, |
|
|
|
label = { Text("Text(stringResource(Res.string.app_name))") }, |
|
|
|
enabled = false, |
|
|
|
enabled = false, |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
@ -68,7 +54,7 @@ fun StringRes(paddingValues: PaddingValues) { |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
value = stringResource(Res.string.hello), |
|
|
|
value = stringResource(Res.string.hello), |
|
|
|
onValueChange = {}, |
|
|
|
onValueChange = {}, |
|
|
|
label = { Text("Text(stringResource(Res.string.hello)") }, |
|
|
|
label = { Text("Text(stringResource(Res.string.hello))") }, |
|
|
|
enabled = false, |
|
|
|
enabled = false, |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
@ -80,7 +66,7 @@ fun StringRes(paddingValues: PaddingValues) { |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
value = stringResource(Res.string.multi_line), |
|
|
|
value = stringResource(Res.string.multi_line), |
|
|
|
onValueChange = {}, |
|
|
|
onValueChange = {}, |
|
|
|
label = { Text("Text(stringResource(Res.string.multi_line)") }, |
|
|
|
label = { Text("Text(stringResource(Res.string.multi_line))") }, |
|
|
|
enabled = false, |
|
|
|
enabled = false, |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
@ -92,7 +78,7 @@ fun StringRes(paddingValues: PaddingValues) { |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
modifier = Modifier.padding(16.dp).fillMaxWidth(), |
|
|
|
value = stringResource(Res.string.str_template, "User_name", 100), |
|
|
|
value = stringResource(Res.string.str_template, "User_name", 100), |
|
|
|
onValueChange = {}, |
|
|
|
onValueChange = {}, |
|
|
|
label = { Text("Text(stringResource(Res.string.str_template, \"User_name\", 100)") }, |
|
|
|
label = { Text("Text(stringResource(Res.string.str_template, \"User_name\", 100))") }, |
|
|
|
enabled = false, |
|
|
|
enabled = false, |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
colors = TextFieldDefaults.colors( |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
|
disabledTextColor = MaterialTheme.colorScheme.onSurface, |
|
|
|