Skip to content

Commit

Permalink
add English string resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskr committed Oct 10, 2022
1 parent a48baef commit 5e1e51a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/com/virtualtag/app/ui/components/Buttons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.virtualtag.app.R

@Composable
fun PrimaryButton(text: String, onClick: () -> Unit) {
Button(
onClick = { onClick() },
modifier = Modifier

.padding(top = 8.dp, bottom = 8.dp),
contentPadding = PaddingValues(all = 16.dp),
elevation = ButtonDefaults.elevation(defaultElevation = 2.dp)
Expand Down Expand Up @@ -69,7 +70,8 @@ fun ColorButton(colors: List<Color>, onColorSelected: (Color) -> Unit) {
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = "Change card background color", color = MaterialTheme.colors.secondary
text = stringResource(R.string.color_button_text),
color = MaterialTheme.colors.secondary
)
Canvas(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import androidx.compose.ui.unit.dp

@OptIn(ExperimentalMaterialApi::class)
@Composable
fun CardContainer(onClick: () -> Unit, enabled: Boolean, color: Color, children: @Composable () -> Unit) {
fun CardContainer(
onClick: () -> Unit,
enabled: Boolean,
color: Color,
children: @Composable () -> Unit
) {
Card(
elevation = 2.dp,
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp


@Composable
fun ColorPickerDialog(
colorList: List<Color>,
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<resources>
<string name="app_name">VirtualTag</string>
<string name="app_name" translatable="false">VirtualTag</string>
<string name="card_added_success">Card added successfully!</string>
<string name="add_new_card">Add new card</string>
<string name="scan_success">NFC tag scanned successfully</string>
<string name="name">Name</string>
<string name="cancel">Cancel</string>
<string name="empty_name_error">Please set a name for your card</string>
<string name="color_button_text">Change card background color</string>
<string name="edit">Edit card</string>
<string name="scan_new_card">Scan new card</string>
<string name="ready_to_scan">Ready to scan</string>
<string name="scan_description">Hold your device near your NFC tag to scan</string>
</resources>

0 comments on commit 5e1e51a

Please sign in to comment.