Skip to content

Commit

Permalink
Added a contentDescription to the FlipCard
Browse files Browse the repository at this point in the history
  • Loading branch information
guraooo committed Sep 8, 2024
1 parent 3b937b0 commit 79eda44
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string name="enter_validate_format">%1$sを入力してください</string>
<string name="add_validate_format">%1$sを追加してください</string>
<string name="url_is_invalid">URLの形式が正しくありません</string>
<string name="flip">裏返す</string>
<string name="qrcode">QRコード</string>
<string name="share">共有する</string>
<string name="edit">編集する</string>
<string name="share_description">DroidKaigiのプロフィールカードを作成しました!イベントでつながりましょう。#DroidKaigi</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string name="enter_validate_format">Please enter a %1$s</string>
<string name="add_validate_format">Please add %1$s</string>
<string name="url_is_invalid">The URL format is incorrect</string>
<string name="flip">Flip</string>
<string name="qrcode">QR code</string>
<string name="share">Share</string>
<string name="edit">Edit</string>
<string name="share_description">Check out my DroidKaigi Profile Card! Let's connect at the event. #DroidKaigi</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.unit.dp
import conference_app_2024.feature.profilecard.generated.resources.flip
import io.github.droidkaigi.confsched.droidkaigiui.WithDeviceOrientation
import io.github.droidkaigi.confsched.profilecard.ProfileCardRes
import io.github.droidkaigi.confsched.profilecard.ProfileCardUiState.Card
import io.github.droidkaigi.confsched.profilecard.hologramaticEffect
import io.github.droidkaigi.confsched.profilecard.tiltEffect
import kotlinx.coroutines.delay
import org.jetbrains.compose.resources.stringResource

const val ProfileCardFlipCardTestTag = "ProfileCardFlipCardTestTag"

Expand Down Expand Up @@ -57,7 +60,9 @@ internal fun FlipCard(
modifier = modifier
.testTag(ProfileCardFlipCardTestTag)
.size(width = 300.dp, height = 380.dp)
.clickable { isFlipped = isFlipped.not() }
.clickable(onClickLabel = stringResource(ProfileCardRes.string.flip)) {
isFlipped = isFlipped.not()
}
.draggable(
orientation = Orientation.Horizontal,
state = rememberDraggableState { delta ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import conference_app_2024.feature.profilecard.generated.resources.card_back_ora
import conference_app_2024.feature.profilecard.generated.resources.card_back_pink
import conference_app_2024.feature.profilecard.generated.resources.card_back_white
import conference_app_2024.feature.profilecard.generated.resources.card_back_yellow
import conference_app_2024.feature.profilecard.generated.resources.qrcode
import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme
import io.github.droidkaigi.confsched.model.ProfileCard
import io.github.droidkaigi.confsched.model.ProfileCardType.Flamingo
Expand All @@ -34,6 +35,7 @@ import io.github.droidkaigi.confsched.profilecard.ProfileCardRes
import io.github.droidkaigi.confsched.profilecard.ProfileCardUiState.Card
import io.github.droidkaigi.confsched.profilecard.toCardUiState
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import qrcode.QRCode

Expand Down Expand Up @@ -70,7 +72,7 @@ internal fun FlipCardBack(
)
Image(
painter = painter,
contentDescription = null,
contentDescription = stringResource(ProfileCardRes.string.qrcode),
modifier = Modifier.size(160.dp),
)
}
Expand Down

0 comments on commit 79eda44

Please sign in to comment.