refactor: move hardcoded texts to strings.xml

This commit is contained in:
robin committed 2026-10-03 17:02:17 +02:00
1 parent cfa8da108d
commit c373c523a5
2 files changed
+4 -1

No files matched your search

@@ -16,6 +16,7 @@ import androidx.compose.ui.unit.dp
import android.appwidget.AppWidgetManager import android.appwidget.AppWidgetManager
import android.content.ComponentName import android.content.ComponentName
import de.schanbro.weekfocus.ui.theme.WeekFocusTheme import de.schanbro.weekfocus.ui.theme.WeekFocusTheme
import androidx.compose.ui.res.stringResource
class MainActivity : ComponentActivity() { class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@@ -63,7 +64,7 @@ fun WordListScreen(modifier: Modifier = Modifier) {
OutlinedTextField( OutlinedTextField(
value = textInput, value = textInput,
onValueChange = { textInput = it }, onValueChange = { textInput = it },
label = { Text("Neues Wort eingeben...") }, label = { Text(stringResource(R.string.hint_new_word)) },
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
singleLine = true singleLine = true
) )
+2
View File
@@ -1,3 +1,5 @@
<resources> <resources>
<string name="app_name">WeekFocus</string> <string name="app_name">WeekFocus</string>
<string name="hint_new_word">Neues Wort eingeben...</string>
</resources> </resources>