Skip to content

Commit

Permalink
Merge pull request #189 from boostcampwm2023/feat/and/accessibility-i…
Browse files Browse the repository at this point in the history
…mprovements

접근성 개선
  • Loading branch information
ootr47 authored Dec 7, 2023
2 parents 49a464e + b747cf3 commit b9b9b83
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,16 @@ class SetTargetPriceFragment : Fragment() {

setTargetPriceViewModel.updateTargetPrice((price * 0.8).toInt())

binding.tvSetPriceCurrentPrice.text =
tvSetPriceCurrentPrice.text =
String.format(
resources.getString(R.string.won),
NumberFormat.getNumberInstance().format(price)
)
tvSetPriceCurrentPrice.contentDescription =
getString(R.string.current_price_info, tvSetPriceCurrentPrice.text)

setTargetPriceViewModel.setProductInfo(productCode, title, price)
binding.etTargetPrice.setText((price * 0.8).toInt().toString())
etTargetPrice.setText((price * 0.8).toInt().toString())
}

private fun FragmentSetTargetPriceBinding.initListener() {
Expand Down Expand Up @@ -133,6 +135,12 @@ class SetTargetPriceFragment : Fragment() {
binding.tvTargetPricePercent.text =
String.format(getString(R.string.current_price_percent), percent)

binding.tvTargetPricePercent.contentDescription = getString(
R.string.target_price_percent_and_price,
binding.tvTargetPricePercent.text,
binding.tvSetPriceCurrentPrice.text
)

binding.updateSlideValueWithPrice(targetPrice, percent.roundAtFirstDigit())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class ProductSummaryAdapter(private val productSummaryClickListener: ProductSumm
msProduct.visibility = View.VISIBLE
tvProductDiscountPercent.visibility = View.VISIBLE
setDisCount(item.discountPercent)
setSwitchListener()
setSwitchListener(item)
}
}
}

private fun ItemProductSummaryBinding.setSwitchListener() {
private fun ItemProductSummaryBinding.setSwitchListener(item: ProductSummary) {
if (msProduct.isChecked.not()) {
msProduct.setThumbIconResource(R.drawable.ic_notifications_off)
}
Expand All @@ -74,6 +74,7 @@ class ProductSummaryAdapter(private val productSummaryClickListener: ProductSumm
msProduct.setThumbIconResource(R.drawable.ic_notifications_off)
}
}
msProduct.contentDescription = msProduct.context.getString(R.string.single_product_notification_toggle, item.title)
}

private fun ItemProductSummaryBinding.setDisCount(discount: Float) {
Expand All @@ -96,12 +97,14 @@ class ProductSummaryAdapter(private val productSummaryClickListener: ProductSumm
true
)
tvProductDiscountPercent.setTextColor(value.data)
tvProductDiscountPercent.contentDescription = tvProductDiscountPercent.context.getString(R.string.target_price_delta, tvProductDiscountPercent.text)
}

private fun ItemProductSummaryBinding.setRecommendRank(item: ProductSummary.RecommendedProductSummary) {
tvProductRecommendRank.text = tvProductRecommendRank.context.getString(
R.string.recommand_rank, item.recommendRank
)
tvProductRecommendRank.contentDescription = tvProductRecommendRank.context.getString(R.string.current_rank_info, item.recommendRank)
}

private fun ItemProductSummaryBinding.setClickListener(code: String) {
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/res/layout/activity_add_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
android:fillViewport="true">
android:fillViewport="true"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/fcv_add_item"
Expand Down
9 changes: 9 additions & 0 deletions android/app/src/main/res/layout/activity_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:navigationContentDescription="@string/go_back"
app:navigationIcon="@drawable/ic_back" />

</com.google.android.material.appbar.AppBarLayout>
Expand Down Expand Up @@ -94,6 +95,7 @@
android:layout_height="48dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:contentDescription="@string/share_product"
app:icon="@drawable/ic_share"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_detail_product" />
Expand All @@ -118,6 +120,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@{@string/current_price_info(@string/price(viewModel.state.formattedPrice))}"
android:text="@{@string/price(viewModel.state.formattedPrice)}"
android:textAppearance="?attr/textAppearanceTitleMedium"
app:layout_constraintStart_toEndOf="@id/gl_vertical_start_nested"
Expand Down Expand Up @@ -210,6 +213,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:importantForAccessibility="no"
android:text="@string/lowest_price"
android:textAppearance="?attr/textAppearanceTitleSmall"
app:layout_constraintStart_toEndOf="@id/gl_vertical_start_nested"
Expand All @@ -220,6 +224,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@{@string/lowest_price_info(@string/price(viewModel.state.formattedLowestPrice))}"
android:text="@{@string/price(viewModel.state.formattedLowestPrice)}"
android:textAppearance="?attr/textAppearanceTitleSmall"
android:textStyle="bold"
Expand All @@ -232,6 +237,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:importantForAccessibility="no"
android:text="@string/target_price"
android:textAppearance="?attr/textAppearanceTitleSmall"
android:visibility="@{viewModel.state.isTracking ? View.VISIBLE : View.GONE}"
Expand All @@ -243,6 +249,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@{@string/target_price_info(@string/price(viewModel.state.formattedTargetPrice))}"
android:text="@{@string/price(viewModel.state.formattedTargetPrice)}"
android:textAppearance="?attr/textAppearanceTitleSmall"
android:textStyle="bold"
Expand All @@ -267,6 +274,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@string/edit_period"
app:checkedButton="@+id/btn_period_day"
app:layout_constraintEnd_toStartOf="@id/gl_vertical_end_nested"
app:layout_constraintStart_toEndOf="@id/gl_vertical_start_nested"
Expand Down Expand Up @@ -314,6 +322,7 @@
android:layout_width="0dp"
android:layout_height="300dp"
android:layout_marginTop="8dp"
android:contentDescription="@string/price_track_graph"
app:layout_constraintEnd_toStartOf="@id/gl_vertical_end_nested"
app:layout_constraintStart_toEndOf="@id/gl_vertical_start_nested"
app:layout_constraintTop_toBottomOf="@id/mbtg_graph_period" />
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/layout/activity_signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:navigationContentDescription="@string/go_back"
app:navigationIcon="@drawable/ic_back"
app:title="@string/sign_up" />

Expand Down
8 changes: 4 additions & 4 deletions android/app/src/main/res/layout/activity_splash_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
android:id="@+id/iv_splash_logo"
android:layout_width="160dp"
android:layout_height="160dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/ic_priceguard_original"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/ic_priceguard_original" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
android:id="@+id/iv_confirm_item"
android:layout_width="0dp"
android:layout_height="248dp"
android:contentDescription="@string/selected_product_image"
android:scaleType="fitXY"
app:imageFromUrl="@{viewModel.state.imageUrl}"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -72,6 +73,7 @@
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:contentDescription="@{@string/product_name_info(viewModel.state.name)}"
android:maxLines="3"
android:text="@{viewModel.state.name}"
android:textAppearance="?attr/textAppearanceBodyLarge"
Expand All @@ -84,6 +86,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:contentDescription="@{@string/shopping_mall_name_info(viewModel.state.brand)}"
android:text="@{viewModel.state.brand}"
android:textAppearance="?attr/textAppearanceBodyMedium"
app:layout_constraintStart_toStartOf="@id/tv_confirm_item_item_title"
Expand All @@ -94,6 +97,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:contentDescription="@string/product_11st"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@id/tv_confirm_item_brand"
app:layout_constraintTop_toBottomOf="@id/tv_confirm_item_brand" />

Expand All @@ -102,6 +107,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:contentDescription="@{@string/current_price_info(@string/won(@string/comma_number(viewModel.state.price)))}"
android:text="@{@string/won(@string/comma_number(viewModel.state.price))}"
android:textAppearance="?attr/textAppearanceTitleMedium"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
6 changes: 5 additions & 1 deletion android/app/src/main/res/layout/fragment_my_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
android:layout_margin="16dp"
android:background="@drawable/bg_circle"
android:gravity="center"
android:importantForAccessibility="no"
android:text="@{viewModel.state.firstName}"
android:textAppearance="?attr/textAppearanceTitleMedium"
android:textColor="?attr/colorSurface"
Expand All @@ -86,6 +87,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:contentDescription="@{@string/my_name_info(viewModel.state.name)}"
android:text="@{viewModel.state.name}"
android:textAppearance="?attr/textAppearanceBodyLarge"
app:layout_constraintBottom_toTopOf="@id/tv_my_page_email"
Expand All @@ -96,6 +98,7 @@
android:id="@+id/tv_my_page_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@{@string/my_email_info(viewModel.state.email)}"
android:text="@{viewModel.state.email}"
android:textAppearance="?attr/textAppearanceBodyMedium"
app:layout_constraintBottom_toBottomOf="parent"
Expand All @@ -114,7 +117,8 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_my_page_background" />
app:layout_constraintTop_toBottomOf="@id/view_my_page_background"
tools:listitem="@layout/item_my_page_list" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/layout/fragment_product_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
android:id="@+id/rv_product_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:listitem="@layout/item_product_summary" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
android:layout_marginHorizontal="24dp"
android:background="#00000000"
android:hint="@string/register_link"
android:importantForAutofill="no"
android:inputType="textUri"
android:onTextChanged="@{(content, s, b, c) -> viewModel.updateLink(content.toString())}"
app:layout_constraintBottom_toBottomOf="@id/view_edit_text_background"
Expand All @@ -71,6 +72,7 @@
android:layout_marginEnd="8dp"
android:enabled="@{viewModel.state.nextReady}"
android:onClick="@{()->viewModel.verifyLink()}"
android:contentDescription="@string/link_confirm_button"
app:icon="@drawable/ic_next"
app:layout_constraintBottom_toBottomOf="@id/et_register_item_link"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_end"
Expand Down
7 changes: 5 additions & 2 deletions android/app/src/main/res/layout/fragment_set_target_price.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="96dp"
android:labelFor="@+id/et_target_price"
android:text="@string/set_price_title"
android:textAppearance="?attr/textAppearanceHeadlineMedium"
app:layout_constraintStart_toEndOf="@id/gl_vertical_start"
Expand Down Expand Up @@ -72,8 +73,10 @@
android:layout_height="56dp"
android:layout_marginTop="80dp"
android:background="@drawable/bg_round_corner"
android:contentDescription="@string/target_price_input"
android:gravity="end|center_vertical"
android:imeOptions="actionDone"
android:importantForAutofill="no"
android:inputType="number"
android:paddingHorizontal="24dp"
android:textSize="22sp"
Expand Down Expand Up @@ -101,7 +104,7 @@
android:layout_height="wrap_content"
android:gravity="center_vertical|end"
android:paddingHorizontal="16dp"
android:text="현재 가격의 80%"
android:text="@string/target_price_80"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/gl_vertical_end"
Expand All @@ -113,8 +116,8 @@
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="32dp"
android:layout_marginBottom="16dp"
android:text="@string/back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/gl_vertical_start"
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/res/layout/item_my_page_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
android:id="@+id/layout_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="8dp"
android:background="?android:attr/selectableItemBackground"
android:onClick="@{() -> listener.onClick(settingItemInfo.id)}">
android:onClick="@{() -> listener.onClick(settingItemInfo.id)}"
android:paddingHorizontal="8dp">

<ImageView
android:id="@+id/iv_my_page_item_icon"
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/res/layout/item_product_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:contentDescription="@string/product_11st"
android:src="@drawable/ic_11st_logo"
app:layout_constraintBottom_toBottomOf="@id/tv_my_page_item_title"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -63,6 +64,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:contentDescription="@{@string/current_price_info(@string/won(@string/comma_number(summary.price)))}"
android:text="@{@string/won(@string/comma_number(summary.price))}"
android:textAppearance="?attr/textAppearanceBodyMedium"
app:layout_constraintStart_toStartOf="@+id/iv_item_icon"
Expand Down
Loading

0 comments on commit b9b9b83

Please sign in to comment.