Skip to content

Commit

Permalink
Use string res
Browse files Browse the repository at this point in the history
  • Loading branch information
FelberMartin committed Nov 22, 2024
1 parent 6834065 commit 8e19f24
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import de.tum.informatics.www1.artemis.native_app.feature.dashboard.R
import de.tum.informatics.www1.artemis.native_app.feature.dashboard.service.SurveyHintService
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -102,7 +104,7 @@ private fun SurveyHintImpl(
Spacer(modifier = Modifier.width(8.dp))

Text(
text = "Survey available",
text = stringResource(R.string.survey_hint_text),
)

Spacer(modifier = Modifier.weight(1f))
Expand All @@ -125,13 +127,13 @@ private fun SurveyDialog(

AlertDialog(
onDismissRequest = { onClose(false) },
title = { Text(text = "We need your help!") },
title = { Text(text = stringResource(R.string.survey_dialog_title)) },
text = {
Column(
modifier = Modifier,
verticalArrangement = Arrangement.spacedBy(32.dp)
) {
Text(text = "Do you have 5-10 minutes to take a short survey and help us improve the app?")
Text(text = stringResource(R.string.survey_dialog_do_you_have_time))

Icon(
modifier = Modifier
Expand All @@ -142,14 +144,14 @@ private fun SurveyDialog(
contentDescription = null,
)

Text("Thank you for your consideration!")
Text(stringResource(R.string.survey_dialog_thank_you))
}
},
confirmButton = {
Button(
onClick = { onClose(true) }
) {
Text(text = "Participate")
Text(text = stringResource(R.string.survey_dialog_button_participate))

Icon(
imageVector = Icons.AutoMirrored.Filled.OpenInNew,
Expand All @@ -162,7 +164,7 @@ private fun SurveyDialog(
TextButton(
onClick = { onClose(false) }
) {
Text(text = "Not now")
Text(text = stringResource(R.string.survey_dialog_button_not_now))
}
}
)
Expand Down
9 changes: 9 additions & 0 deletions feature/dashboard/src/main/res/values/survey_hint_strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="survey_hint_text">Survey available</string>
<string name="survey_dialog_title">We need your help!</string>
<string name="survey_dialog_do_you_have_time">Do you have 5–10 minutes to take a short survey and help us improve the app?</string>
<string name="survey_dialog_thank_you">Thank you for your consideration!</string>
<string name="survey_dialog_button_participate">Participate</string>
<string name="survey_dialog_button_not_now">Not now</string>
</resources>

0 comments on commit 8e19f24

Please sign in to comment.