From fa77425f849358b1840f5a52c9564aca9c37beef Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 1 Oct 2024 04:20:35 +0900 Subject: [PATCH 1/9] =?UTF-8?q?[UI/#143]=20=EC=83=81=ED=92=88=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B7=B0=20UI=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/drawable/shape_gray1_fill_5_rect.xml | 6 + .../res/drawable/shape_gray2_line_rect.xml | 5 + core/src/main/res/values/colors.xml | 1 + core/src/main/res/values/strings.xml | 2 +- .../src/main/res/layout/activity_detail.xml | 115 +++++++++--------- 5 files changed, 71 insertions(+), 58 deletions(-) create mode 100644 core/src/main/res/drawable/shape_gray1_fill_5_rect.xml create mode 100644 core/src/main/res/drawable/shape_gray2_line_rect.xml diff --git a/core/src/main/res/drawable/shape_gray1_fill_5_rect.xml b/core/src/main/res/drawable/shape_gray1_fill_5_rect.xml new file mode 100644 index 00000000..981060b7 --- /dev/null +++ b/core/src/main/res/drawable/shape_gray1_fill_5_rect.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/core/src/main/res/drawable/shape_gray2_line_rect.xml b/core/src/main/res/drawable/shape_gray2_line_rect.xml new file mode 100644 index 00000000..552db9a2 --- /dev/null +++ b/core/src/main/res/drawable/shape_gray2_line_rect.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index df78025b..6c6bcef9 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -23,6 +23,7 @@ #3527D7 #315EFB #FF002E + #E65454 #FFFDF0 diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index c0b537fb..668fd581 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -33,7 +33,7 @@ 판매하기 - 퓨어 오일 퍼퓸 10 ml 긴제목테스트트트트트 + 푸드장 프리미엄 구이 선물세트1.15kg(부채살+살치살+토시살+소목등심(척아이롤)) 54,000원 48,900원 999+ diff --git a/feature/main/src/main/res/layout/activity_detail.xml b/feature/main/src/main/res/layout/activity_detail.xml index 1ea07b81..2b865d85 100644 --- a/feature/main/src/main/res/layout/activity_detail.xml +++ b/feature/main/src/main/res/layout/activity_detail.xml @@ -15,8 +15,8 @@ android:id="@+id/btn_back" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="4dp" android:layout_marginStart="8dp" + android:layout_marginTop="4dp" android:padding="12dp" android:src="@drawable/ic_back" app:layout_constraintStart_toStartOf="parent" @@ -72,35 +72,38 @@ + android:text="@string/detail_chips_option" + android:textColor="@color/gray_3" /> + android:text="@string/detail_chips_imminent" + android:textColor="@color/gray_3" /> @@ -110,62 +113,57 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginHorizontal="20dp" - android:layout_marginTop="10dp" - android:ellipsize="end" + android:layout_marginTop="14dp" android:lineSpacingMultiplier="1.0" - android:maxLines="2" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/layout_detail_chips" tools:text="@string/ex_item_title" /> + tools:text="@string/ex_item_real_price" /> + android:layout_marginStart="18dp" + android:layout_marginTop="7dp" + android:textColor="@color/discount_red" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_detail_real_price" + tools:text="30" /> + android:layout_marginTop="7dp" + android:text="@string/detail_tv_percent" + android:textColor="@color/discount_red" + app:layout_constraintStart_toEndOf="@id/tv_detail_discount_rate" + app:layout_constraintTop_toBottomOf="@id/tv_detail_real_price" /> + app:layout_constraintBottom_toBottomOf="@id/tv_detail_now_price" + app:layout_constraintEnd_toStartOf="@id/tv_detail_stock_count" + app:layout_constraintTop_toTopOf="@id/tv_detail_now_price" /> + app:layout_constraintBottom_toBottomOf="@id/tv_detail_now_price" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="@id/tv_detail_now_price" /> + app:layout_constraintTop_toBottomOf="@id/tv_detail_discount_percent"> + app:layout_constraintTop_toBottomOf="@id/btn_back" + tools:visibility="gone" /> Date: Tue, 1 Oct 2024 04:29:55 +0900 Subject: [PATCH 2/9] =?UTF-8?q?[UI/#143]=20=ED=8C=90=EB=A7=A4=ED=99=95?= =?UTF-8?q?=EC=A0=95=EB=B7=B0=20UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/res/values/appearances.xml | 6 + core/src/main/res/values/strings.xml | 1 + .../main/res/layout/activity_sell_confirm.xml | 456 ++++++++++-------- 3 files changed, 260 insertions(+), 203 deletions(-) diff --git a/core/src/main/res/values/appearances.xml b/core/src/main/res/values/appearances.xml index 1888d3c0..8ea1dcfe 100644 --- a/core/src/main/res/values/appearances.xml +++ b/core/src/main/res/values/appearances.xml @@ -69,4 +69,10 @@ 1sp + + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 668fd581..5c8a287c 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -205,6 +205,7 @@ 판매 확정 카카오톡으로 이동해서\n배송지를 입력해주세요! + 해당 과정에서의 입력 실수 및 누락은 책임지지 않습니다.\n입력 완료 버튼 클릭 시 판매 확정이 완료됩니다. 가이드 보러가기 구매자 정보 선택 옵션 diff --git a/feature/sell/src/main/res/layout/activity_sell_confirm.xml b/feature/sell/src/main/res/layout/activity_sell_confirm.xml index 8f222cbd..863c9e21 100644 --- a/feature/sell/src/main/res/layout/activity_sell_confirm.xml +++ b/feature/sell/src/main/res/layout/activity_sell_confirm.xml @@ -44,228 +44,278 @@ - + app:layout_constraintTop_toBottomOf="@id/layout_sell_confirm_top"> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + Date: Tue, 1 Oct 2024 04:33:42 +0900 Subject: [PATCH 3/9] =?UTF-8?q?[UI/#143]=20=ED=8C=90=EB=A7=A4=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B7=B0=20UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/res/values/strings.xml | 1 + .../co/orange/sell/info/SellInfoActivity.kt | 24 ++++++++++++------- .../co/orange/sell/info/SellInfoViewModel.kt | 5 +++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 5c8a287c..d801bed7 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -198,6 +198,7 @@ 판매가 판매 확정하기 최종 판매 금액 + 판매 취소하기 판매 중 입금 완료 판매 확정하기 diff --git a/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt b/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt index 32b086cb..99515b76 100644 --- a/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt +++ b/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt @@ -28,8 +28,7 @@ import kotlinx.coroutines.flow.onEach import co.orange.sell.R as featureR @AndroidEntryPoint -class SellInfoActivity : - BaseActivity(featureR.layout.activity_sell_info) { +class SellInfoActivity : BaseActivity(featureR.layout.activity_sell_info) { private val viewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { @@ -47,8 +46,15 @@ class SellInfoActivity : private fun initSellConfirmBtnListener() { binding.btnSellConfirm.setOnSingleClickListener { - SellConfirmActivity.createIntent(this, viewModel.orderId, viewModel.totalPrice).apply { - startActivity(this) + if (viewModel.isOnSale) { + } else { + startActivity( + SellConfirmActivity.createIntent( + this, + viewModel.orderId, + viewModel.totalPrice, + ), + ) } } } @@ -61,7 +67,9 @@ class SellInfoActivity : } private fun observeGetSellInfoState() { - viewModel.getSellInfoState.flowWithLifecycle(lifecycle).distinctUntilChanged() + viewModel.getSellInfoState + .flowWithLifecycle(lifecycle) + .distinctUntilChanged() .onEach { state -> when (state) { is UiState.Success -> setIntentUi(state.data) @@ -96,10 +104,11 @@ class SellInfoActivity : } private fun setItemStatus(status: String) { + viewModel.isOnSale = status == ItemStatus.ON_SALE.name val (infoMsgResId, btnTextResId, isButtonEnabled) = when (status) { ItemStatus.ON_SALE.name -> { - Triple(R.string.sell_info_msg_on_sale, R.string.sell_info_msg_on_sale, false) + Triple(R.string.sell_info_msg_on_sale, R.string.sell_info_msg_cancel, true) } ItemStatus.ORDERED.name -> { @@ -141,9 +150,6 @@ class SellInfoActivity : } companion object { - const val OLD_DATE_PATTERN = "yyyy-MM-dd'T'HH:mm:ss" - const val NEW_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss" - private const val EXTRA_ITEM_ID = "EXTRA_ITEM_ID" @JvmStatic diff --git a/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt b/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt index 7cbb7caf..14345193 100644 --- a/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt +++ b/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt @@ -21,13 +21,16 @@ class SellInfoViewModel var orderId = "" var totalPrice = 0 + var isOnSale = true + private val _getSellInfoState = MutableStateFlow>(UiState.Empty) val getSellInfoState: StateFlow> = _getSellInfoState fun getItemDetailInfoFromServer() { _getSellInfoState.value = UiState.Loading viewModelScope.launch { - sellRepository.getItemDetailInfo(itemId) + sellRepository + .getItemDetailInfo(itemId) .onSuccess { orderId = it.orderId.orEmpty() totalPrice = it.salePrice From 5f0ea8e3345f76e27826eff634213d79aab52071 Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 1 Oct 2024 04:35:28 +0900 Subject: [PATCH 4/9] =?UTF-8?q?[ADD/#143]=20=ED=8C=90=EB=A7=A4=EB=AC=BC?= =?UTF-8?q?=ED=92=88=20=EC=82=AD=EC=A0=9C=20API=20domain=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/kotlin/co/orange/domain/repository/SellRepository.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/domain/src/main/kotlin/co/orange/domain/repository/SellRepository.kt b/domain/src/main/kotlin/co/orange/domain/repository/SellRepository.kt index 05c3b346..906930b4 100644 --- a/domain/src/main/kotlin/co/orange/domain/repository/SellRepository.kt +++ b/domain/src/main/kotlin/co/orange/domain/repository/SellRepository.kt @@ -24,4 +24,6 @@ interface SellRepository { suspend fun getBuyerInfo(orderId: String): Result suspend fun patchOrderConfirm(orderId: String): Result + + suspend fun deleteSellingItem(itemId: String): Result } From ab5a75ecdd15fb07159ec3a7e65410c97f9bc53e Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 1 Oct 2024 04:37:29 +0900 Subject: [PATCH 5/9] =?UTF-8?q?[ADD/#143]=20=ED=8C=90=EB=A7=A4=EB=AC=BC?= =?UTF-8?q?=ED=92=88=20=EC=82=AD=EC=A0=9C=20API=20data=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/co/orange/data/dataSource/SellDataSource.kt | 2 ++ .../co/orange/data/dataSourceImpl/SellDateSourceImpl.kt | 2 ++ .../co/orange/data/repositoryImpl/SellRepositoryImpl.kt | 5 +++++ data/src/main/java/co/orange/data/service/SellService.kt | 6 ++++++ 4 files changed, 15 insertions(+) diff --git a/data/src/main/java/co/orange/data/dataSource/SellDataSource.kt b/data/src/main/java/co/orange/data/dataSource/SellDataSource.kt index 31c37c3d..b091f74c 100644 --- a/data/src/main/java/co/orange/data/dataSource/SellDataSource.kt +++ b/data/src/main/java/co/orange/data/dataSource/SellDataSource.kt @@ -25,4 +25,6 @@ interface SellDataSource { suspend fun getBuyerInfo(orderId: String): BaseResponse suspend fun patchOrderConfirm(orderId: String): BaseResponse + + suspend fun deleteSellingItem(itemId: String): BaseResponse } diff --git a/data/src/main/java/co/orange/data/dataSourceImpl/SellDateSourceImpl.kt b/data/src/main/java/co/orange/data/dataSourceImpl/SellDateSourceImpl.kt index dbf76921..aa364ddb 100644 --- a/data/src/main/java/co/orange/data/dataSourceImpl/SellDateSourceImpl.kt +++ b/data/src/main/java/co/orange/data/dataSourceImpl/SellDateSourceImpl.kt @@ -34,4 +34,6 @@ data class SellDateSourceImpl override suspend fun getBuyerInfo(orderId: String): BaseResponse = sellService.getBuyerInfo(orderId) override suspend fun patchOrderConfirm(orderId: String): BaseResponse = sellService.patchOrderConfirm(orderId) + + override suspend fun deleteSellingItem(itemId: String): BaseResponse = sellService.deleteSellingItem(itemId) } diff --git a/data/src/main/java/co/orange/data/repositoryImpl/SellRepositoryImpl.kt b/data/src/main/java/co/orange/data/repositoryImpl/SellRepositoryImpl.kt index c9c3239b..996d4718 100644 --- a/data/src/main/java/co/orange/data/repositoryImpl/SellRepositoryImpl.kt +++ b/data/src/main/java/co/orange/data/repositoryImpl/SellRepositoryImpl.kt @@ -54,4 +54,9 @@ class SellRepositoryImpl runCatching { sellDataSource.patchOrderConfirm(orderId).data.toModel() } + + override suspend fun deleteSellingItem(itemId: String): Result = + runCatching { + sellDataSource.deleteSellingItem(itemId).data + } } diff --git a/data/src/main/java/co/orange/data/service/SellService.kt b/data/src/main/java/co/orange/data/service/SellService.kt index 926853b5..8077c4f2 100644 --- a/data/src/main/java/co/orange/data/service/SellService.kt +++ b/data/src/main/java/co/orange/data/service/SellService.kt @@ -11,6 +11,7 @@ import co.orange.data.dto.response.SellProductDto import co.orange.data.dto.response.SellRegisteredDto import co.orange.data.dto.response.SignedUrlDto import retrofit2.http.Body +import retrofit2.http.DELETE import retrofit2.http.GET import retrofit2.http.PATCH import retrofit2.http.POST @@ -52,4 +53,9 @@ interface SellService { suspend fun patchOrderConfirm( @Path("id") orderId: String, ): BaseResponse + + @DELETE("/api/v1/item/{id}") + suspend fun deleteSellingItem( + @Path("id") itemId: String, + ): BaseResponse } From 79d9dd8bc7acecae654b99c93578d41f80b8ac34 Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 1 Oct 2024 04:40:48 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[FEAT/#143]=20=ED=8C=90=EB=A7=A4=EB=AC=BC?= =?UTF-8?q?=ED=92=88=20=EC=82=AD=EC=A0=9C=20API=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/res/values/strings.xml | 1 + .../co/orange/sell/info/SellInfoActivity.kt | 19 +++++++++++++++++++ .../co/orange/sell/info/SellInfoViewModel.kt | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index d801bed7..24686142 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -203,6 +203,7 @@ 입금 완료 판매 확정하기 배송 중인 상품입니다. + 상품 판매가 취소되었습니다. 판매 확정 카카오톡으로 이동해서\n배송지를 입력해주세요! diff --git a/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt b/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt index 99515b76..dad63ea3 100644 --- a/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt +++ b/feature/sell/src/main/java/co/orange/sell/info/SellInfoActivity.kt @@ -38,6 +38,7 @@ class SellInfoActivity : BaseActivity(featureR.layout.a initSellConfirmBtnListener() getIntentInfo() observeGetSellInfoState() + observeDeleteItemState() } private fun initExitBtnListener() { @@ -47,6 +48,7 @@ class SellInfoActivity : BaseActivity(featureR.layout.a private fun initSellConfirmBtnListener() { binding.btnSellConfirm.setOnSingleClickListener { if (viewModel.isOnSale) { + viewModel.deleteSellingItemFromServer() } else { startActivity( SellConfirmActivity.createIntent( @@ -149,6 +151,23 @@ class SellInfoActivity : BaseActivity(featureR.layout.a } } + private fun observeDeleteItemState() { + viewModel.deleteItemState + .flowWithLifecycle(lifecycle) + .distinctUntilChanged() + .onEach { state -> + when (state) { + is UiState.Success -> { + toast(stringOf(R.string.sell_delete_success_toast)) + finish() + } + + is UiState.Failure -> toast(stringOf(R.string.error_msg)) + else -> return@onEach + } + }.launchIn(lifecycleScope) + } + companion object { private const val EXTRA_ITEM_ID = "EXTRA_ITEM_ID" diff --git a/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt b/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt index 14345193..1e29f270 100644 --- a/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt +++ b/feature/sell/src/main/java/co/orange/sell/info/SellInfoViewModel.kt @@ -26,6 +26,9 @@ class SellInfoViewModel private val _getSellInfoState = MutableStateFlow>(UiState.Empty) val getSellInfoState: StateFlow> = _getSellInfoState + private val _deleteItemState = MutableStateFlow>(UiState.Empty) + val deleteItemState: StateFlow> = _deleteItemState + fun getItemDetailInfoFromServer() { _getSellInfoState.value = UiState.Loading viewModelScope.launch { @@ -40,4 +43,17 @@ class SellInfoViewModel } } } + + fun deleteSellingItemFromServer() { + _deleteItemState.value = UiState.Loading + viewModelScope.launch { + sellRepository + .deleteSellingItem(itemId) + .onSuccess { + _deleteItemState.value = UiState.Success(it) + }.onFailure { + _deleteItemState.value = UiState.Failure(it.message.orEmpty()) + } + } + } } From 630873019b98e3184ad5339c254c5af709df89e4 Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 1 Oct 2024 04:41:57 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[CHORE/#143]=20version=20v1.1.4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildSrc/src/main/kotlin/Constants.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index e6cf4d14..f0c17f76 100644 --- a/buildSrc/src/main/kotlin/Constants.kt +++ b/buildSrc/src/main/kotlin/Constants.kt @@ -3,6 +3,6 @@ object Constants { const val compileSdk = 34 const val minSdk = 28 const val targetSdk = 34 - const val versionCode = 10 - const val versionName = "1.1.3" + const val versionCode = 11 + const val versionName = "1.1.4" } From b21a6eef29d8851b31d742bae555f4cfcc46b7b2 Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 1 Oct 2024 20:46:10 +0900 Subject: [PATCH 8/9] =?UTF-8?q?[FIX/#143]=20=ED=8C=90=EB=A7=A4=EC=83=81?= =?UTF-8?q?=EC=84=B8=EB=B7=B0=20UI=20=ED=8C=A8=EB=94=A9=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/activity_detail.xml | 22 +++++++++---------- .../main/res/layout/bottom_sheet_option.xml | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/feature/main/src/main/res/layout/activity_detail.xml b/feature/main/src/main/res/layout/activity_detail.xml index 2b865d85..39578ae8 100644 --- a/feature/main/src/main/res/layout/activity_detail.xml +++ b/feature/main/src/main/res/layout/activity_detail.xml @@ -113,7 +113,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginHorizontal="20dp" - android:layout_marginTop="14dp" + android:layout_marginTop="10dp" android:lineSpacingMultiplier="1.0" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -126,7 +126,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginHorizontal="20dp" - android:layout_marginTop="10dp" + android:layout_marginTop="7dp" android:textColor="@color/gray_2" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_detail_title" @@ -138,7 +138,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="18dp" - android:layout_marginTop="7dp" android:textColor="@color/discount_red" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tv_detail_real_price" @@ -149,7 +148,6 @@ style="@style/TextAppearance.DDanzi.Title4" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="7dp" android:text="@string/detail_tv_percent" android:textColor="@color/discount_red" app:layout_constraintStart_toEndOf="@id/tv_detail_discount_rate" @@ -161,7 +159,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="4dp" - android:layout_marginTop="7dp" app:layout_constraintStart_toEndOf="@id/tv_detail_discount_percent" app:layout_constraintTop_toBottomOf="@id/tv_detail_real_price" tools:text="@string/ex_item_now_price" /> @@ -202,21 +199,22 @@ @@ -224,7 +222,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:layout_marginStart="5dp" + android:layout_marginStart="8dp" android:layout_marginTop="1dp" android:src="@drawable/ic_next_gray2" /> diff --git a/feature/main/src/main/res/layout/bottom_sheet_option.xml b/feature/main/src/main/res/layout/bottom_sheet_option.xml index 4184e7f8..7c98fa0f 100644 --- a/feature/main/src/main/res/layout/bottom_sheet_option.xml +++ b/feature/main/src/main/res/layout/bottom_sheet_option.xml @@ -64,7 +64,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:layout_marginStart="5dp" + android:paddingStart="9dp" android:layout_marginTop="1dp" android:src="@drawable/ic_next_gray2" /> From 482d0a8ed2e39a208afb6fbe7a6ad0603047915f Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Tue, 1 Oct 2024 21:43:33 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[FEAT/#143]=20MultiLineTextView=20=EC=BB=A4?= =?UTF-8?q?=EC=8A=A4=ED=85=80=EB=B7=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../orange/core/custom/MultiLineTextView.kt | 25 +++++++++++++++++++ .../main/res/layout/activity_buy_finished.xml | 2 +- .../src/main/res/layout/activity_buy_info.xml | 2 +- .../main/res/layout/activity_buy_progress.xml | 2 +- .../src/main/res/layout/item_home_product.xml | 3 ++- .../main/src/main/res/layout/item_option.xml | 2 +- .../main/res/layout/item_option_detail.xml | 2 +- .../main/res/layout/item_search_product.xml | 3 ++- .../main/res/layout/activity_sell_confirm.xml | 4 +-- .../main/res/layout/activity_sell_info.xml | 2 +- .../main/res/layout/dialog_sell_product.xml | 4 +-- .../src/main/res/layout/activity_delivery.xml | 2 +- .../src/main/res/layout/item_history_buy.xml | 3 ++- .../src/main/res/layout/item_history_item.xml | 3 ++- 14 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 core/src/main/java/co/orange/core/custom/MultiLineTextView.kt diff --git a/core/src/main/java/co/orange/core/custom/MultiLineTextView.kt b/core/src/main/java/co/orange/core/custom/MultiLineTextView.kt new file mode 100644 index 00000000..13cc36eb --- /dev/null +++ b/core/src/main/java/co/orange/core/custom/MultiLineTextView.kt @@ -0,0 +1,25 @@ +package co.orange.core.custom + +import android.content.Context +import android.graphics.Canvas +import android.util.AttributeSet +import androidx.appcompat.widget.AppCompatTextView + +class MultiLineTextView + @JvmOverloads + constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, + ) : AppCompatTextView(context, attrs, defStyleAttr) { + // 텍스트가 그려지기 전에 줄바꿈 공백 제거 + override fun onDraw(canvas: Canvas) { + val text = text?.toString()?.replace(leadingWhitespaceRegex, "$1") + setText(text) + super.onDraw(canvas) + } + + companion object { + private val leadingWhitespaceRegex = Regex("(^|\n)\\s+") + } + } diff --git a/feature/buy/src/main/res/layout/activity_buy_finished.xml b/feature/buy/src/main/res/layout/activity_buy_finished.xml index 3b95d1d5..a08e4710 100644 --- a/feature/buy/src/main/res/layout/activity_buy_finished.xml +++ b/feature/buy/src/main/res/layout/activity_buy_finished.xml @@ -197,7 +197,7 @@ app:layout_constraintTop_toTopOf="parent" tools:text="우리집" /> - - - - - - - + app:layout_constraintTop_toTopOf="parent"/> - - - - - -