From eda5e253b2b871cd9bfe815c82bfc42f7640c8fa Mon Sep 17 00:00:00 2001
From: Hailey <91793891+stellar-halo@users.noreply.github.com>
Date: Fri, 19 Jan 2024 09:29:35 +0900
Subject: [PATCH 1/2] =?UTF-8?q?#111=20[hotfix]=20=EC=95=84=EB=AC=B4?=
=?UTF-8?q?=EA=B2=83=EB=8F=84=20=ED=81=B4=EB=A6=AD=ED=95=98=EC=A7=80=20?=
=?UTF-8?q?=EC=95=8A=EC=95=98=EC=9D=84=20=EB=95=8C,=20lateinit=20=EA=B0=92?=
=?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=B4=20=EC=95=B1=20=ED=84=B0?=
=?UTF-8?q?=EC=A7=90=20=EC=88=98=EC=A0=95=20->=20list=EC=9D=98=201?=
=?UTF-8?q?=EB=B2=88=EC=A7=B8=20=EC=95=84=EC=9D=B4=ED=85=9C=20=EA=B0=92?=
=?UTF-8?q?=EC=9D=84=20=EC=B4=88=EA=B8=B0=EA=B0=92=EC=9C=BC=EB=A1=9C=20?=
=?UTF-8?q?=EC=84=A4=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dailyroutineadd/DailyRoutineAddCardPagerAdapter.kt | 3 ++-
.../dailyroutineadd/DailyRoutineAddThemeAdapter.kt | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddCardPagerAdapter.kt b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddCardPagerAdapter.kt
index db3c3f6e..75a3c04b 100644
--- a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddCardPagerAdapter.kt
+++ b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddCardPagerAdapter.kt
@@ -18,7 +18,7 @@ class DailyRoutineAddCardPagerAdapter :
)
) {
lateinit var background: String
- lateinit var content: String
+ var content: String? = null
fun updateBackground(backgroundImg: String) {
background = backgroundImg
}
@@ -33,6 +33,7 @@ class DailyRoutineAddCardPagerAdapter :
}
override fun onBindViewHolder(holder: DailyPagerViewHolder, position: Int) {
+ if (content == null) content = currentList[0].content
holder.onBind(currentList[position])
}
diff --git a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddThemeAdapter.kt b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddThemeAdapter.kt
index 766ee258..ba0f1b62 100644
--- a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddThemeAdapter.kt
+++ b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddThemeAdapter.kt
@@ -21,7 +21,7 @@ class DailyRoutineAddThemeAdapter :
private var onItemClickListener: OnItemClickListener? = null
private var selectedPosition = 0
var clickedThemeId: Int = 1
- lateinit var clickedThemeIcon: String
+ var clickedThemeIcon: String? = null
interface OnItemClickListener {
fun onItemClick(item: Theme, position: Int)
@@ -112,6 +112,7 @@ class DailyRoutineAddThemeAdapter :
}
override fun onBindViewHolder(holder: DailyThemeViewHolder, position: Int) {
+ if (clickedThemeIcon == null) clickedThemeIcon = currentList[0].iconImageUrl
holder.onBind(currentList[position])
}
}
From 020356059321bbc30ec0b5b9a6ca67b41bb4c4ee Mon Sep 17 00:00:00 2001
From: Hailey <91793891+stellar-halo@users.noreply.github.com>
Date: Fri, 19 Jan 2024 09:31:15 +0900
Subject: [PATCH 2/2] =?UTF-8?q?#111=20[hotfix]=20null=EC=9D=BC=20=EB=95=8C?=
=?UTF-8?q?=20=EB=9D=84=EC=9A=B8=20=EB=94=94=ED=8F=B4=ED=8A=B8=20=EC=8A=A4?=
=?UTF-8?q?=ED=8A=B8=EB=A7=81=20=EC=83=9D=EC=84=B1=20=EB=B0=8F=20=EC=B6=94?=
=?UTF-8?q?=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dailyroutineadd/DailyRoutineAddActivity.kt | 10 ++++++----
app/src/main/res/values/strings.xml | 1 +
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt
index 21b438e8..c4466f76 100644
--- a/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt
+++ b/app/src/main/java/com/sopetit/softie/ui/dailyroutine/dailyroutineadd/DailyRoutineAddActivity.kt
@@ -172,11 +172,12 @@ class DailyRoutineAddActivity :
})
}
- private fun getCurrentSelectedRoutine(): Routine {
+ private fun getCurrentSelectedRoutine(): Routine? {
val currentItem = binding.vpDailyRoutineAddCard.currentItem
val itemId = dailyRoutineAddCardPagerAdapter.getItemId(currentItem)
val itemContent = dailyRoutineAddCardPagerAdapter.content
- return Routine(itemId.toInt(), itemContent)
+ ?: dailyRoutineAddViewModel.dailyRoutineCardThemeList.value?.routine?.get(0)?.content
+ return itemContent?.let { content -> Routine(itemId.toInt(), content) }
}
private fun getCurrentSelectedRoutineId(): Int {
@@ -190,9 +191,10 @@ class DailyRoutineAddActivity :
BindingBottomSheet.Builder().build(
isDrawable = false,
imageDrawable = 0,
- imageUri = dailyRoutineAddThemeAdapter.clickedThemeIcon,
+ imageUri = dailyRoutineAddThemeAdapter.clickedThemeIcon ?: "",
title = getString(R.string.daily_routine_add_question),
- content = getCurrentSelectedRoutine().content,
+ content = getCurrentSelectedRoutine()?.content
+ ?: getString(R.string.daily_routine_basic_bottom_sheet_content),
isContentVisible = true,
contentColor = R.color.gray400,
backBtnContent = getString(R.string.daily_routine_add_no),
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 712db108..df899d5a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -155,5 +155,6 @@
아니, 더 고민할게
추가할래
데일리 루틴을 1개 추가했어요
+ 언제든지 변경할 수 있어요!