From bf925dc3218ff444240ab56a713e46fc158931c0 Mon Sep 17 00:00:00 2001 From: guraooo Date: Sun, 8 Sep 2024 18:23:42 +0900 Subject: [PATCH 1/4] Improve accessibility on CardTypeImage - made the theme and its selection state clear --- .../droidkaigi/confsched/profilecard/ProfileCardScreen.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt index 9d9d76159..ca532160f 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt @@ -3,7 +3,6 @@ package io.github.droidkaigi.confsched.profilecard import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Arrangement @@ -21,6 +20,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.selection.selectable import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardActions @@ -700,12 +700,12 @@ private fun CardTypeImage( Image( painter = painterResource(ProfileCardRes.drawable.card_type), - contentDescription = null, + contentDescription = cardType.toString(), modifier = modifier .selectedBorder(isSelected, selectedBorderColor, painter) .clip(RoundedCornerShape(2.dp)) .background(colorMap[cardType]!!) - .clickable { onClickImage(cardType) } + .selectable(isSelected) { onClickImage(cardType) } .padding(top = 36.dp, start = 30.dp, end = 30.dp, bottom = 36.dp), ) } From 3b937b094ed7e355bb815fb3af9f082362a422ac Mon Sep 17 00:00:00 2001 From: guraooo Date: Sun, 8 Sep 2024 18:30:07 +0900 Subject: [PATCH 2/4] Added contentDescription to the delete button for the image --- .../src/commonMain/composeResources/values-ja/strings.xml | 1 + .../src/commonMain/composeResources/values/strings.xml | 1 + .../droidkaigi/confsched/profilecard/ProfileCardScreen.kt | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml b/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml index 191c2fa36..1bcd10183 100644 --- a/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml +++ b/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml @@ -10,6 +10,7 @@ リンク 画像 画像を追加 + 削除する %1$sを入力してください %1$sを追加してください URLの形式が正しくありません diff --git a/feature/profilecard/src/commonMain/composeResources/values/strings.xml b/feature/profilecard/src/commonMain/composeResources/values/strings.xml index c2bc9a274..c38382d5f 100644 --- a/feature/profilecard/src/commonMain/composeResources/values/strings.xml +++ b/feature/profilecard/src/commonMain/composeResources/values/strings.xml @@ -10,6 +10,7 @@ Link Image Add Image + Delete Please enter a %1$s Please add %1$s The URL format is incorrect diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt index ca532160f..301988b9a 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt @@ -97,6 +97,7 @@ import com.preat.peekaboo.image.picker.toImageBitmap import conference_app_2024.feature.profilecard.generated.resources.add_image import conference_app_2024.feature.profilecard.generated.resources.card_type import conference_app_2024.feature.profilecard.generated.resources.create_card +import conference_app_2024.feature.profilecard.generated.resources.delete import conference_app_2024.feature.profilecard.generated.resources.edit import conference_app_2024.feature.profilecard.generated.resources.icon_share import conference_app_2024.feature.profilecard.generated.resources.image @@ -627,7 +628,7 @@ private fun ImagePickerWithError( Icon( modifier = Modifier.padding(4.dp), imageVector = Icons.Default.Close, - contentDescription = null, + contentDescription = stringResource(ProfileCardRes.string.delete), ) } } From 79eda446547504380a45ced4f2340088ccf0e0a9 Mon Sep 17 00:00:00 2001 From: guraooo Date: Sun, 8 Sep 2024 18:50:52 +0900 Subject: [PATCH 3/4] Added a contentDescription to the FlipCard --- .../src/commonMain/composeResources/values-ja/strings.xml | 2 ++ .../src/commonMain/composeResources/values/strings.xml | 2 ++ .../droidkaigi/confsched/profilecard/component/FlipCard.kt | 7 ++++++- .../confsched/profilecard/component/FlipCardBack.kt | 4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml b/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml index 1bcd10183..294105497 100644 --- a/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml +++ b/feature/profilecard/src/commonMain/composeResources/values-ja/strings.xml @@ -14,6 +14,8 @@ %1$sを入力してください %1$sを追加してください URLの形式が正しくありません + 裏返す + QRコード 共有する 編集する DroidKaigiのプロフィールカードを作成しました!イベントでつながりましょう。#DroidKaigi diff --git a/feature/profilecard/src/commonMain/composeResources/values/strings.xml b/feature/profilecard/src/commonMain/composeResources/values/strings.xml index c38382d5f..151659c4b 100644 --- a/feature/profilecard/src/commonMain/composeResources/values/strings.xml +++ b/feature/profilecard/src/commonMain/composeResources/values/strings.xml @@ -14,6 +14,8 @@ Please enter a %1$s Please add %1$s The URL format is incorrect + Flip + QR code Share Edit Check out my DroidKaigi Profile Card! Let's connect at the event. #DroidKaigi diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCard.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCard.kt index 53a0c9969..4453aa23b 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCard.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCard.kt @@ -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" @@ -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 -> diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCardBack.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCardBack.kt index 94a82e773..8c579350d 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCardBack.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/component/FlipCardBack.kt @@ -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 @@ -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 @@ -70,7 +72,7 @@ internal fun FlipCardBack( ) Image( painter = painter, - contentDescription = null, + contentDescription = stringResource(ProfileCardRes.string.qrcode), modifier = Modifier.size(160.dp), ) } From 6047fd85e6931e88509877f26d7f289e3c95b091 Mon Sep 17 00:00:00 2001 From: guraooo Date: Sun, 8 Sep 2024 18:53:52 +0900 Subject: [PATCH 4/4] Removed duplicate spoken content --- .../droidkaigi/confsched/profilecard/ProfileCardScreen.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt index 301988b9a..560598de1 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt @@ -830,17 +830,15 @@ internal fun CardScreen( .testTag(ProfileCardShareButtonTestTag) .padding(horizontal = 16.dp, vertical = 8.dp), ) { - val shareLabel = stringResource(ProfileCardRes.string.share) - Icon( painter = painterResource(ProfileCardRes.drawable.icon_share), - contentDescription = shareLabel, + contentDescription = null, tint = Color.Black, modifier = Modifier.size(18.dp), ) Spacer(Modifier.width(8.dp)) Text( - text = shareLabel, + text = stringResource(ProfileCardRes.string.share), modifier = Modifier.padding(8.dp), style = MaterialTheme.typography.labelLarge, color = Color.Black,