make buttons distinguishable and translatable

This commit is contained in:
Minecon724 2024-08-08 14:33:41 +02:00
parent d29aa94f3b
commit 106a0b7b78
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
3 changed files with 12 additions and 3 deletions

View file

@ -21,8 +21,10 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Card import androidx.compose.material3.Card
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -227,14 +229,17 @@ fun InstanceDeleteDialog(
TextButton( TextButton(
onClick = { onConfirm() } onClick = { onConfirm() }
) { ) {
Text("Confirm") Text(stringResource(id = R.string.confirm))
} }
}, },
dismissButton = { dismissButton = {
TextButton( TextButton(
onClick = { onClose() } onClick = { onClose() },
colors = ButtonDefaults.textButtonColors().copy(
contentColor = MaterialTheme.colorScheme.error
)
) { ) {
Text("Dismiss") Text(stringResource(id = R.string.dismiss))
} }
}, },
title = { title = {

View file

@ -33,4 +33,6 @@
<string name="rent_on_website">Jeszcze nie możesz wynajmować z tej aplikacji</string> <string name="rent_on_website">Jeszcze nie możesz wynajmować z tej aplikacji</string>
<string name="instance_confirm_delete">Potwierdź usunięcie</string> <string name="instance_confirm_delete">Potwierdź usunięcie</string>
<string name="instance_confirm_delete_text">Instancja #%1$d (%2$s)</string> <string name="instance_confirm_delete_text">Instancja #%1$d (%2$s)</string>
<string name="dismiss">Anuluj</string>
<string name="confirm">Potwierdź</string>
</resources> </resources>

View file

@ -34,4 +34,6 @@
<string name="rent_on_website">You can\'t rent from this app yet</string> <string name="rent_on_website">You can\'t rent from this app yet</string>
<string name="instance_confirm_delete">Confirm deletion</string> <string name="instance_confirm_delete">Confirm deletion</string>
<string name="instance_confirm_delete_text">Instance #%1$d (%2$s)</string> <string name="instance_confirm_delete_text">Instance #%1$d (%2$s)</string>
<string name="dismiss">Dismiss</string>
<string name="confirm">Confirm</string>
</resources> </resources>