From 4700bd17d5b99cd21032273ec144ea871052bf54 Mon Sep 17 00:00:00 2001 From: Dani43 Date: Sat, 6 Jan 2024 18:01:07 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[add]=20#44=20=ED=95=91=EA=B8=80=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=ED=94=84=EB=A1=9C=EC=84=B8=EC=8A=A4=20-?= =?UTF-8?q?=20=EC=A0=9C=EB=AA=A9=20=EC=8A=A4=ED=8A=B8=EB=A7=81=20=EC=B6=94?= =?UTF-8?q?=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a7b931e2..35b56d6b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -30,10 +30,13 @@ 나가기 다음으로 핑글 개최하기 + 핑글 제목 + 이번 핑글을 한마디로 소개한다면? 참여하기 이 핑글에 참여할까요? + 개최할 핑글을\n소개해주세요 \ No newline at end of file From f2422308538b9b04e70e75780dca595a7b74d036 Mon Sep 17 00:00:00 2001 From: Dani43 Date: Sat, 6 Jan 2024 18:01:28 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[add]=20#44=20=ED=95=91=EA=B8=80=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=ED=94=84=EB=A1=9C=EC=84=B8=EC=8A=A4=20-?= =?UTF-8?q?=20=EC=A0=9C=EB=AA=A9=20=EB=B7=B0=20=EB=94=94=EC=9E=90=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/layout/fragment_plan_title.xml | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_plan_title.xml b/app/src/main/res/layout/fragment_plan_title.xml index 67ed5d4c..082a2ce1 100644 --- a/app/src/main/res/layout/fragment_plan_title.xml +++ b/app/src/main/res/layout/fragment_plan_title.xml @@ -1,5 +1,6 @@ - + @@ -9,5 +10,25 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + \ No newline at end of file From 57cf579710f3934b725be21bdc72c6b135b5f08f Mon Sep 17 00:00:00 2001 From: Dani43 Date: Sun, 7 Jan 2024 16:24:44 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[add]=20#44=20=EB=B2=88=EA=B0=9C=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=EB=B7=B0=20-=20=EC=A0=9C=EB=AA=A9,=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=EC=B1=84=ED=8C=85=EC=97=90=20=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EC=8A=A4=ED=8A=B8=EB=A7=81=20=EB=A6=AC?= =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values/strings.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8b968748..6695d9d0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -50,13 +50,15 @@ 시작 시각 00:00 종료 시각 - 핑글 제목 - 이번 핑글을 한마디로 소개한다면? + 한줄 소개 + 개최할 핑글을\n소개해주세요! + ex. 강남역에서 각잡고 공부할 사람? 참여하기 이 핑글에 참여할까요? - 개최할 핑글을\n소개해주세요 + 링크를 입력해주세요 + 채팅방 링크 \ No newline at end of file From dcfee9ade2d399cd3e52b33d4880facbea7cba64 Mon Sep 17 00:00:00 2001 From: Dani43 Date: Sun, 7 Jan 2024 16:28:54 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[feat]=20#44=20=EB=B2=88=EA=B0=9C=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=EB=B7=B0=20-=20=EC=A0=9C=EB=AA=A9,=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=EC=B1=84=ED=8C=85=20=EB=B7=B0=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/fragment_plan_open_chatting.xml | 28 ++++++++++++++++++- .../main/res/layout/fragment_plan_title.xml | 9 ++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/fragment_plan_open_chatting.xml b/app/src/main/res/layout/fragment_plan_open_chatting.xml index 67ed5d4c..f6484e55 100644 --- a/app/src/main/res/layout/fragment_plan_open_chatting.xml +++ b/app/src/main/res/layout/fragment_plan_open_chatting.xml @@ -1,13 +1,39 @@ - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_plan_title.xml b/app/src/main/res/layout/fragment_plan_title.xml index 082a2ce1..6e07c56d 100644 --- a/app/src/main/res/layout/fragment_plan_title.xml +++ b/app/src/main/res/layout/fragment_plan_title.xml @@ -4,6 +4,9 @@ + \ No newline at end of file From 4dfc86a4bd8335c373538e8bacfe636793cc940a Mon Sep 17 00:00:00 2001 From: Dani43 Date: Sun, 7 Jan 2024 16:29:19 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[feat]=20#44=20=EB=B2=88=EA=B0=9C=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=EB=B7=B0=20=EA=B4=80=EB=A0=A8=20enum=20cl?= =?UTF-8?q?ass=20type=20position=20=EA=B0=92=EA=B3=BC=20=ED=95=A8=EA=BC=90?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/sopt/pingle/presentation/type/PlanType.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/src/main/java/org/sopt/pingle/presentation/type/PlanType.kt diff --git a/app/src/main/java/org/sopt/pingle/presentation/type/PlanType.kt b/app/src/main/java/org/sopt/pingle/presentation/type/PlanType.kt new file mode 100644 index 00000000..c7661801 --- /dev/null +++ b/app/src/main/java/org/sopt/pingle/presentation/type/PlanType.kt @@ -0,0 +1,13 @@ +package org.sopt.pingle.presentation.type + +enum class PlanType( + val position: Int +) { + CATEGORY(0), + TITLE(1), + DATETIME(2), + LOCATION(3), + RECRUITMENT(4), + OPENCHATTING(5), + SUMMARY(6) +} From 60bc38d9855e6cf3e65f94d69a7c6785e4ef2913 Mon Sep 17 00:00:00 2001 From: Dani43 Date: Sun, 7 Jan 2024 16:32:03 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[feat]=20#44=20=EB=B2=88=EA=B0=9C=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=EB=B7=B0=20-=20=EC=A0=9C=EB=AA=A9,=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=EC=B1=84=ED=8C=85=EB=B0=A9=20=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EB=A7=81=EC=9D=84=20=EA=B4=80=EB=A6=AC=ED=95=98?= =?UTF-8?q?=EB=8A=94=20flow,=20=EB=B2=84=ED=8A=BC=20=ED=99=9C=EC=84=B1/?= =?UTF-8?q?=EB=B9=84=ED=99=9C=EC=84=B1=EC=9D=84=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=ED=95=98=EB=8A=94=20flow=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/main/plan/PlanActivity.kt | 2 +- .../ui/main/plan/PlanViewModel.kt | 20 +++++++++++++++++++ .../pingle/util/component/PingleEditText.kt | 5 ++--- .../component/PingleEditTextReverseBinding.kt | 2 +- app/src/main/res/layout/activity_plan.xml | 8 ++++++-- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanActivity.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanActivity.kt index d8fe71b3..f5f3419a 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanActivity.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanActivity.kt @@ -18,6 +18,7 @@ class PlanActivity : BindingActivity(R.layout.activity_plan override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + binding.viewModel = planViewModel setPlanFragmentStateAdapter() addListeners() collectData() @@ -78,7 +79,6 @@ class PlanActivity : BindingActivity(R.layout.activity_plan fragmentList.size - 1 -> { binding.btnPlan.text = getString(R.string.plan_pingle) } - // TODO 다른 다음으로 스트링과 합치기 else -> { binding.btnPlan.text = getString(R.string.plan_next) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanViewModel.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanViewModel.kt index 71967d00..3425402d 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanViewModel.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanViewModel.kt @@ -1,16 +1,36 @@ package org.sopt.pingle.presentation.ui.main.plan import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.SharingStarted +import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.stateIn +import org.sopt.pingle.presentation.type.PlanType class PlanViewModel : ViewModel() { private val _currentPage = MutableStateFlow(FIRST_PAGE_POSITION) val currentPage get() = _currentPage.asStateFlow() + val planTitle = MutableStateFlow("") private val _planDate = MutableStateFlow(null) val planDate get() = _planDate.asStateFlow() private val _selectedTimeType = MutableStateFlow(null) val selectedTimeType get() = _selectedTimeType.asStateFlow() + val planOpenChattingLink = MutableStateFlow("") + + // TODO Type에 맞게 수정(현재는 내가 맡은 부분 테스트를 위해 postion 값을 조정 및 임의 지정 해놓음 + val isPlanBtnEnabled: StateFlow = + combine( + currentPage, + planTitle, + planOpenChattingLink + ) { currentPage, planTitle, planOpenChattingLink -> + (currentPage == PlanType.TITLE.position - 1 && planTitle.isNotBlank()) || + currentPage == 1 || + (currentPage == 2 && planOpenChattingLink.isNotBlank()) + }.stateIn(viewModelScope, SharingStarted.WhileSubscribed(), false) fun setCurrentPage(position: Int) { _currentPage.value = position diff --git a/app/src/main/java/org/sopt/pingle/util/component/PingleEditText.kt b/app/src/main/java/org/sopt/pingle/util/component/PingleEditText.kt index 135a50d5..21050c61 100644 --- a/app/src/main/java/org/sopt/pingle/util/component/PingleEditText.kt +++ b/app/src/main/java/org/sopt/pingle/util/component/PingleEditText.kt @@ -6,7 +6,6 @@ import android.content.res.TypedArray import android.util.AttributeSet import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout -import androidx.databinding.DataBindingComponent import androidx.databinding.DataBindingUtil import org.sopt.pingle.R import org.sopt.pingle.databinding.EditTextPingleBinding @@ -25,7 +24,7 @@ class PingleEditText @JvmOverloads constructor( LayoutInflater.from(context), R.layout.edit_text_pingle, this, - true, + true ) binding.view = this val typedArray = context.obtainStyledAttributes(attrs, R.styleable.pingleEditText) @@ -45,4 +44,4 @@ class PingleEditText @JvmOverloads constructor( binding.etEditText.hint = hint } } -} \ No newline at end of file +} diff --git a/app/src/main/java/org/sopt/pingle/util/component/PingleEditTextReverseBinding.kt b/app/src/main/java/org/sopt/pingle/util/component/PingleEditTextReverseBinding.kt index 8e7b194f..5e4563a3 100644 --- a/app/src/main/java/org/sopt/pingle/util/component/PingleEditTextReverseBinding.kt +++ b/app/src/main/java/org/sopt/pingle/util/component/PingleEditTextReverseBinding.kt @@ -41,4 +41,4 @@ object PingleEditTextReverseBinding { fun getEtText(view: PingleEditText): String { return view.editText.text.toString() } -} \ No newline at end of file +} diff --git a/app/src/main/res/layout/activity_plan.xml b/app/src/main/res/layout/activity_plan.xml index e25ae8f8..cbd98dcc 100644 --- a/app/src/main/res/layout/activity_plan.xml +++ b/app/src/main/res/layout/activity_plan.xml @@ -5,6 +5,9 @@ + Date: Sun, 7 Jan 2024 16:32:12 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[feat]=20#44=20=EB=B2=88=EA=B0=9C=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=EB=B7=B0=20-=20=EC=A0=9C=EB=AA=A9,=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=EC=B1=84=ED=8C=85=EB=B0=A9=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/main/plan/PlanOpenChattingFragment.kt | 16 +++++++++++++++- .../ui/main/plan/PlanTitleFragment.kt | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanOpenChattingFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanOpenChattingFragment.kt index 53585426..c6d0c589 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanOpenChattingFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanOpenChattingFragment.kt @@ -2,12 +2,26 @@ package org.sopt.pingle.presentation.ui.main.plan import android.os.Bundle import android.view.View +import androidx.fragment.app.activityViewModels import org.sopt.pingle.R import org.sopt.pingle.databinding.FragmentPlanOpenChattingBinding import org.sopt.pingle.util.base.BindingFragment +import org.sopt.pingle.util.context.hideKeyboard -class PlanOpenChattingFragment : BindingFragment(R.layout.fragment_plan_open_chatting) { +class PlanOpenChattingFragment : + BindingFragment(R.layout.fragment_plan_open_chatting) { + private val planViewModel: PlanViewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + + binding.viewModel = planViewModel + + addListeners() + } + + private fun addListeners() { + binding.root.setOnClickListener { + requireActivity().hideKeyboard(it) + } } } diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanTitleFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanTitleFragment.kt index 69fba4ba..04b1af89 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanTitleFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/plan/PlanTitleFragment.kt @@ -2,12 +2,25 @@ package org.sopt.pingle.presentation.ui.main.plan import android.os.Bundle import android.view.View +import androidx.fragment.app.activityViewModels import org.sopt.pingle.R import org.sopt.pingle.databinding.FragmentPlanTitleBinding import org.sopt.pingle.util.base.BindingFragment +import org.sopt.pingle.util.context.hideKeyboard class PlanTitleFragment : BindingFragment(R.layout.fragment_plan_title) { + private val planViewModel: PlanViewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + + binding.viewModel = planViewModel + + addListeners() + } + + private fun addListeners() { + binding.root.setOnClickListener { + requireActivity().hideKeyboard(it) + } } } From 864e7da5b5db52fcea5d142eb3944e53ce18da0f Mon Sep 17 00:00:00 2001 From: Dani43 Date: Sun, 7 Jan 2024 16:32:35 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[feat]=20#44=20=EB=B2=88=EA=B0=9C=20?= =?UTF-8?q?=EA=B0=9C=EC=B5=9C=20=EB=B7=B0=20-=20=EC=A0=9C=EB=AA=A9,=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=EC=B1=84=ED=8C=85=EB=B0=A9=20windowSoft=20?= =?UTF-8?q?=EC=86=8D=EC=84=B1=20Noting=EC=9C=BC=EB=A1=9C=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 --- app/src/main/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 50482271..7f7d44cb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -62,6 +62,7 @@