From d752e47cf7e6d9b9d7d019747e619ce62d401b22 Mon Sep 17 00:00:00 2001 From: hsgo2430 Date: Mon, 1 Jul 2024 01:41:22 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EA=B0=80=EA=B2=8C=20=EC=B5=9C=EA=B7=BC=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20=EC=9D=BC=EC=9E=90=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/res/drawable/fi_info.xml | 31 +++++++++++++++++++ .../koreatech/koin/data/mapper/StoreMapper.kt | 2 ++ .../store/StoreItemWithMenusResponse.kt | 2 ++ .../koin/domain/model/store/Store.kt | 2 +- .../koin/domain/model/store/StoreWithMenu.kt | 2 ++ gradle/libs.versions.toml | 2 -- .../ui/store/activity/StoreDetailActivity.kt | 2 ++ .../main/res/layout/store_activity_detail.xml | 28 +++++++++++++++-- koin/src/main/res/values/strings.xml | 1 + 9 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 core/src/main/res/drawable/fi_info.xml diff --git a/core/src/main/res/drawable/fi_info.xml b/core/src/main/res/drawable/fi_info.xml new file mode 100644 index 000000000..f158b1930 --- /dev/null +++ b/core/src/main/res/drawable/fi_info.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt b/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt index 9fd96c7a0..682c672fc 100644 --- a/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt +++ b/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt @@ -69,6 +69,8 @@ fun StoreItemWithMenusResponse.toStoreWithMenu(): StoreWithMenu = StoreWithMenu( deliveryPrice = deliveryPrice ?: 0, isCardOk = isCardOk ?: false, isBankOk = isBankOk ?: false, + updateAt = updateAt, + isEvent = isEvent ?: false, open = open?.filter { it.dayOfWeek == localDayOfWeekName }?.map { Store.OpenData( dayOfWeek = it.dayOfWeek, diff --git a/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt b/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt index 7e5d3b38d..44d832010 100644 --- a/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt +++ b/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt @@ -14,6 +14,8 @@ data class StoreItemWithMenusResponse( @SerializedName("pay_bank") val isBankOk: Boolean?, @SerializedName("open") val open: List?, @SerializedName("image_urls") val imageUrls: ArrayList?, + @SerializedName("updated_at") val updateAt: String, + @SerializedName("is_event") val isEvent: Boolean?, @SerializedName("shop_categories") val shopCategories: List?, @SerializedName("menu_categories") val menuCategories: List?, ) { diff --git a/domain/src/main/java/in/koreatech/koin/domain/model/store/Store.kt b/domain/src/main/java/in/koreatech/koin/domain/model/store/Store.kt index a08531ce0..d059f44f6 100644 --- a/domain/src/main/java/in/koreatech/koin/domain/model/store/Store.kt +++ b/domain/src/main/java/in/koreatech/koin/domain/model/store/Store.kt @@ -16,7 +16,7 @@ data class Store( val isEvent: Boolean, val isOpen: Boolean, val open: OpenData, - val categoryIds: List, + val categoryIds: List ) { data class OpenData( val dayOfWeek: String, diff --git a/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt b/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt index 566333cd7..d69802c26 100644 --- a/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt +++ b/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt @@ -12,6 +12,8 @@ data class StoreWithMenu( val isBankOk: Boolean, val open: Store.OpenData, val imageUrls: List?, + val updateAt: String, + val isEvent: Boolean?, val shopCategories: List?, val menuCategories: List?, ) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1e009124d..1e39e9223 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -54,7 +54,6 @@ napier = "2.6.1" composeNumberPickerVersion = "1.0.3" powerSpinner = "1.2.7" firebaseCrashlyticsBuildtoolsVersion = "2.9.9" -composeNumberPickerVersion = "1.0.3" [libraries] androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activityKtxVersion" } @@ -147,7 +146,6 @@ coil-svg = {module = "io.coil-kt:coil-svg", version.ref ="coilVersion"} compose-numberPicker = {module = "com.chargemap.compose:numberpicker", version.ref = "composeNumberPickerVersion"} powerSpinner = {module = "com.github.skydoves:powerspinner", version.ref = "powerSpinner"} -compose-numberPicker = {module = "com.chargemap.compose:numberpicker", version.ref = "composeNumberPickerVersion"} [plugins] android-application = { id = "com.android.application", version.ref = "androidGradleVersion" } diff --git a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt index c910b5878..db0966a79 100644 --- a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt +++ b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt @@ -204,6 +204,8 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() { //계좌이체 setEtcInfo(storeDetailIsBankTextview, it.isBankOk) + updateInfoTv.text = getString(R.string.updateAt, it.updateAt.replace("-", ".")) + binding.storeDetailImageview.apply { adapter = StoreDetailImageViewpagerAdapter(it.imageUrls) diff --git a/koin/src/main/res/layout/store_activity_detail.xml b/koin/src/main/res/layout/store_activity_detail.xml index 51c66f2eb..6964b8304 100644 --- a/koin/src/main/res/layout/store_activity_detail.xml +++ b/koin/src/main/res/layout/store_activity_detail.xml @@ -336,14 +336,38 @@ app:layout_constraintStart_toEndOf="@+id/store_detail_is_card_textview" app:layout_constraintTop_toBottomOf="@+id/barrier_etc" /> + + + + %1$s에서 %1$s는 준비 중 입니다. %1$s은 준비 중 입니다. + %1$s 업데이트 필수 업데이트가 있습니다.\n업데이트 하시겠습니까? From 76764e9c8352e53e2bb34f15fb38f025d1207e8b Mon Sep 17 00:00:00 2001 From: hsgo2430 Date: Thu, 4 Jul 2024 01:43:44 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EA=B3=84=EC=A2=8C=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC=20=EA=B8=B0=EB=8A=A5=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/drawable/ic_copy.xml | 9 ++++ .../koreatech/koin/data/mapper/StoreMapper.kt | 4 +- .../store/StoreItemWithMenusResponse.kt | 2 + .../koin/domain/model/store/StoreWithMenu.kt | 2 + .../ui/store/activity/StoreDetailActivity.kt | 28 ++++++++++- .../main/res/layout/store_activity_detail.xml | 49 ++++++++++++++++++- koin/src/main/res/values/strings.xml | 5 +- 7 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 core/src/main/res/drawable/ic_copy.xml diff --git a/core/src/main/res/drawable/ic_copy.xml b/core/src/main/res/drawable/ic_copy.xml new file mode 100644 index 000000000..cf355af16 --- /dev/null +++ b/core/src/main/res/drawable/ic_copy.xml @@ -0,0 +1,9 @@ + + + diff --git a/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt b/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt index 682c672fc..8afaca9e6 100644 --- a/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt +++ b/data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt @@ -81,7 +81,9 @@ fun StoreItemWithMenusResponse.toStoreWithMenu(): StoreWithMenu = StoreWithMenu( }.orEmpty().getOrElse(0) {Store.OpenData(localDayOfWeekName, false, "00:00", "00,00")}, imageUrls = imageUrls ?: emptyList(), shopCategories = shopCategories?.map { it.toCategory() }.orEmpty(), - menuCategories = menuCategories?.map { it.toCategory() }.orEmpty() + menuCategories = menuCategories?.map { it.toCategory() }.orEmpty(), + bank = bank ?: null, + accountNumber = accountNumber ?: null ) fun StoreItemWithMenusResponse.CategoriesResponseDTO.toCategory() = StoreWithMenu.Category( diff --git a/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt b/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt index 44d832010..e33d416c4 100644 --- a/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt +++ b/data/src/main/java/in/koreatech/koin/data/response/store/StoreItemWithMenusResponse.kt @@ -18,6 +18,8 @@ data class StoreItemWithMenusResponse( @SerializedName("is_event") val isEvent: Boolean?, @SerializedName("shop_categories") val shopCategories: List?, @SerializedName("menu_categories") val menuCategories: List?, + @SerializedName("bank") val bank: String, + @SerializedName("account_number") val accountNumber: String ) { data class CategoriesResponseDTO( @SerializedName("id") diff --git a/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt b/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt index d69802c26..39737d563 100644 --- a/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt +++ b/domain/src/main/java/in/koreatech/koin/domain/model/store/StoreWithMenu.kt @@ -16,6 +16,8 @@ data class StoreWithMenu( val isEvent: Boolean?, val shopCategories: List?, val menuCategories: List?, + val bank: String?, + val accountNumber: String? ) { data class Category( val id: Int, diff --git a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt index db0966a79..32189874c 100644 --- a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt +++ b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt @@ -1,7 +1,10 @@ package `in`.koreatech.koin.ui.store.activity import android.Manifest +import android.content.ClipData +import android.content.ClipboardManager import android.os.Bundle +import android.util.Log import android.widget.TextView import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.viewModels @@ -123,6 +126,18 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() { override fun onTabReselected(p0: TabLayout.Tab?) {} }) + binding.storeDetailAccountCopyButton.setOnClickListener { + + val clipboardManager = getSystemService(CLIPBOARD_SERVICE) as ClipboardManager + val clipData = ClipData.newPlainText( + getString(R.string.account_number), + binding.storeDetailAccountTextview.text + ) + clipboardManager.setPrimaryClip(clipData) + + ToastUtil.getInstance().makeShort(getString(R.string.store_account_copy)) + } + initViewModel() val storeId = intent.extras?.getInt(StoreDetailActivityContract.STORE_ID) if (storeId == null) { @@ -198,13 +213,24 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() { storeDetailEtcTextview.text = it.description } + if(it.bank == null){ + storeDetailAccountTextview.isVisible = false + storeDetailConstAccountTextview.isVisible = false + storeDetailAccountCopyButton.isVisible = false + } + else{ + storeDetailAccountTextview.text = it.description + } + + //storeDetailAccountTextview.text = "국민은행 00000-11-2222222" + setEtcInfo(storeDetailIsCardTextview, it.isCardOk) //카드결제 setEtcInfo(storeDetailIsCardTextview, it.isCardOk) //계좌이체 setEtcInfo(storeDetailIsBankTextview, it.isBankOk) - updateInfoTv.text = getString(R.string.updateAt, it.updateAt.replace("-", ".")) + updateInfoTv.text = getString(R.string.store_update_at, it.updateAt.replace("-", ".")) binding.storeDetailImageview.apply { adapter = StoreDetailImageViewpagerAdapter(it.imageUrls) diff --git a/koin/src/main/res/layout/store_activity_detail.xml b/koin/src/main/res/layout/store_activity_detail.xml index 6964b8304..c2119b289 100644 --- a/koin/src/main/res/layout/store_activity_detail.xml +++ b/koin/src/main/res/layout/store_activity_detail.xml @@ -248,6 +248,53 @@ app:barrierDirection="bottom" app:constraint_referenced_ids="store_detail_const_deliver_textview, store_detail_deliver_textview" /> + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/barrier_account" /> %1$s에서 %1$s는 준비 중 입니다. %1$s은 준비 중 입니다. - %1$s 업데이트 + %1$s 업데이트 + 계좌번호 복사 완료! + 필수 업데이트가 있습니다.\n업데이트 하시겠습니까? @@ -435,6 +437,7 @@ 운영시간 주소정보 배달금액 + 계좌번호 기타정보 #배달가능 #카드가능 From 02381d35eab0c2b689a191f23ea7f5659ff7709f Mon Sep 17 00:00:00 2001 From: hsgo2430 Date: Thu, 4 Jul 2024 01:44:58 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EC=A3=BC=EC=84=9D=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt index 32189874c..54e0f8045 100644 --- a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt +++ b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt @@ -222,8 +222,6 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() { storeDetailAccountTextview.text = it.description } - //storeDetailAccountTextview.text = "국민은행 00000-11-2222222" - setEtcInfo(storeDetailIsCardTextview, it.isCardOk) //카드결제 setEtcInfo(storeDetailIsCardTextview, it.isCardOk) From d0e745be223697106b73b1d732d6514ccf874878 Mon Sep 17 00:00:00 2001 From: hsgo2430 Date: Thu, 4 Jul 2024 01:56:31 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt index 54e0f8045..4db82f318 100644 --- a/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt +++ b/koin/src/main/java/in/koreatech/koin/ui/store/activity/StoreDetailActivity.kt @@ -219,7 +219,7 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() { storeDetailAccountCopyButton.isVisible = false } else{ - storeDetailAccountTextview.text = it.description + storeDetailAccountTextview.text = it.bank + " " + it.accountNumber } setEtcInfo(storeDetailIsCardTextview, it.isCardOk)