Skip to content

Commit e5e9625

Browse files
committed
BookItemのボタンのラベルを文字列リソースに格納する
1 parent 4188445 commit e5e9625

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/ui/src/main/java/jp/co/mixi/androidtraining/ui/BookItem.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import androidx.compose.material3.Text
1010
import androidx.compose.runtime.Composable
1111
import androidx.compose.ui.Alignment
1212
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.res.stringResource
1314
import androidx.compose.ui.text.font.FontWeight
1415
import androidx.compose.ui.tooling.preview.Preview
1516
import androidx.compose.ui.unit.dp
@@ -39,7 +40,7 @@ fun BookItem(
3940
)
4041
}
4142
Button(onClick = { }) {
42-
Text(text = "読む")
43+
Text(text = stringResource(R.string.read))
4344
}
4445
}
4546
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<resources>
22
<string name="app_name">UI</string>
3+
<string name="read">読む</string>
34
</resources>

0 commit comments

Comments
 (0)