From ac5dbc60fe1484198d376757c39f4cf66d4218f7 Mon Sep 17 00:00:00 2001 From: posite Date: Sat, 7 Oct 2023 20:20:59 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=EC=82=AC=EC=9A=A9=EC=9E=90?= =?UTF-8?q?=EC=9D=98=20=EB=8B=89=EB=84=A4=EC=9E=84=20=EC=9E=85=EB=A0=A5?= =?UTF-8?q?=EC=9D=84=20=EC=9C=84=ED=95=9C=20=ED=99=94=EB=A9=B4=20=EA=B5=AC?= =?UTF-8?q?=EC=84=B1=20#14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 3 +- .../ui/view/AgreeServiceConditionFragment.kt | 24 ++ .../android/auth/ui/view/BirthDateFragment.kt | 32 +++ .../auth/ui/view/FamilyConnectFragment.kt | 34 +++ .../android/auth/ui/view/GroupFragment.kt | 31 +++ .../auth/ui/view/InputFamilyCodeFragment.kt | 31 +++ .../android/auth/ui/view/LoginFragment.kt | 4 +- .../android/auth/ui/view/NickNameFragment.kt | 46 ++++ .../android/auth/ui/view/ShareCodeFragment.kt | 31 +++ .../auth/ui/viewmodel/NickNameViewModel.kt | 28 ++ app/src/main/res/drawable/arrow_back.xml | 5 + .../main/res/drawable/check_btn_ripple.xml | 5 + .../main/res/drawable/check_btn_selector.xml | 9 + .../main/res/drawable/check_text_selector.xml | 9 + app/src/main/res/drawable/focused_agree.xml | 12 + .../main/res/drawable/focused_birthdate.xml | 12 + app/src/main/res/drawable/focused_connect.xml | 12 + app/src/main/res/drawable/focused_group.xml | 12 + .../main/res/drawable/focused_nickname.xml | 12 + .../res/drawable/make_code_background.xml | 11 + app/src/main/res/drawable/navigation_line.xml | 7 + .../res/drawable/received_code_background.xml | 14 + app/src/main/res/drawable/unfocused_agree.xml | 14 + .../main/res/drawable/unfocused_birthdate.xml | 14 + .../main/res/drawable/unfocused_connect.xml | 14 + app/src/main/res/drawable/unfocused_group.xml | 14 + .../main/res/drawable/unfocused_nickname.xml | 14 + .../fragment_agree_service_condition.xml | 39 +++ .../main/res/layout/fragment_birth_date.xml | 38 +++ .../res/layout/fragment_family_connect.xml | 52 ++++ app/src/main/res/layout/fragment_group.xml | 38 +++ .../res/layout/fragment_input_family_code.xml | 39 +++ .../main/res/layout/fragment_nick_name.xml | 252 ++++++++++++++++++ app/src/main/res/layout/fragment_policy.xml | 20 +- .../main/res/layout/fragment_share_code.xml | 40 +++ .../main/res/navigation/auth_navigation.xml | 63 ++++- .../main/res/navigation/policy_navigation.xml | 9 + app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/strings.xml | 39 +++ app/src/main/res/values/styles.xml | 4 + 40 files changed, 1070 insertions(+), 18 deletions(-) create mode 100644 app/src/main/java/com/owori/android/auth/ui/view/AgreeServiceConditionFragment.kt create mode 100644 app/src/main/java/com/owori/android/auth/ui/view/BirthDateFragment.kt create mode 100644 app/src/main/java/com/owori/android/auth/ui/view/FamilyConnectFragment.kt create mode 100644 app/src/main/java/com/owori/android/auth/ui/view/GroupFragment.kt create mode 100644 app/src/main/java/com/owori/android/auth/ui/view/InputFamilyCodeFragment.kt create mode 100644 app/src/main/java/com/owori/android/auth/ui/view/NickNameFragment.kt create mode 100644 app/src/main/java/com/owori/android/auth/ui/view/ShareCodeFragment.kt create mode 100644 app/src/main/java/com/owori/android/auth/ui/viewmodel/NickNameViewModel.kt create mode 100644 app/src/main/res/drawable/arrow_back.xml create mode 100644 app/src/main/res/drawable/check_btn_ripple.xml create mode 100644 app/src/main/res/drawable/check_btn_selector.xml create mode 100644 app/src/main/res/drawable/check_text_selector.xml create mode 100644 app/src/main/res/drawable/focused_agree.xml create mode 100644 app/src/main/res/drawable/focused_birthdate.xml create mode 100644 app/src/main/res/drawable/focused_connect.xml create mode 100644 app/src/main/res/drawable/focused_group.xml create mode 100644 app/src/main/res/drawable/focused_nickname.xml create mode 100644 app/src/main/res/drawable/make_code_background.xml create mode 100644 app/src/main/res/drawable/navigation_line.xml create mode 100644 app/src/main/res/drawable/received_code_background.xml create mode 100644 app/src/main/res/drawable/unfocused_agree.xml create mode 100644 app/src/main/res/drawable/unfocused_birthdate.xml create mode 100644 app/src/main/res/drawable/unfocused_connect.xml create mode 100644 app/src/main/res/drawable/unfocused_group.xml create mode 100644 app/src/main/res/drawable/unfocused_nickname.xml create mode 100644 app/src/main/res/layout/fragment_agree_service_condition.xml create mode 100644 app/src/main/res/layout/fragment_birth_date.xml create mode 100644 app/src/main/res/layout/fragment_family_connect.xml create mode 100644 app/src/main/res/layout/fragment_group.xml create mode 100644 app/src/main/res/layout/fragment_input_family_code.xml create mode 100644 app/src/main/res/layout/fragment_nick_name.xml create mode 100644 app/src/main/res/layout/fragment_share_code.xml create mode 100644 app/src/main/res/navigation/policy_navigation.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 23b4098..b38d2bb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,7 +18,8 @@ android:exported="true" android:screenOrientation="portrait" android:label="@string/app_name" - android:theme="@style/Theme.Owori"> + android:theme="@style/Theme.Owori" + android:windowSoftInputMode="adjustResize"> diff --git a/app/src/main/java/com/owori/android/auth/ui/view/AgreeServiceConditionFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/AgreeServiceConditionFragment.kt new file mode 100644 index 0000000..95d047b --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/view/AgreeServiceConditionFragment.kt @@ -0,0 +1,24 @@ +package com.owori.android.auth.ui.view + +import androidx.fragment.app.viewModels +import com.owori.android.R +import com.owori.android.auth.ui.viewmodel.NickNameViewModel +import com.owori.android.common.ui.view.BaseFragment +import com.owori.android.databinding.FragmentAgreeServiceConditionBinding + +class AgreeServiceConditionFragment : BaseFragment(R.layout.fragment_agree_service_condition) { + override val viewModel: NickNameViewModel by viewModels() + override fun setBindingVariables() { + with(binding) { + vm = viewModel + } + } + + override fun initView() { + + } + + override fun initObserver() { + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owori/android/auth/ui/view/BirthDateFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/BirthDateFragment.kt new file mode 100644 index 0000000..e93d2bd --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/view/BirthDateFragment.kt @@ -0,0 +1,32 @@ +package com.owori.android.auth.ui.view + + +import androidx.core.content.ContextCompat +import androidx.fragment.app.viewModels +import com.owori.android.R +import com.owori.android.auth.ui.viewmodel.NickNameViewModel +import com.owori.android.common.navigateTo +import com.owori.android.common.ui.view.BaseFragment +import com.owori.android.databinding.FragmentBirthDateBinding + + +class BirthDateFragment : BaseFragment(R.layout.fragment_birth_date) { + override val viewModel: NickNameViewModel by viewModels() + override fun setBindingVariables() { + with(binding) { + vm = viewModel + } + } + + override fun initView() { + + } + + override fun initObserver() { + with(viewModel) { + btnNext.observe(viewLifecycleOwner) { + navigateTo(R.id.action_birthDateFragment_to_familyConnectFragment) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owori/android/auth/ui/view/FamilyConnectFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/FamilyConnectFragment.kt new file mode 100644 index 0000000..98826dc --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/view/FamilyConnectFragment.kt @@ -0,0 +1,34 @@ +package com.owori.android.auth.ui.view + + +import androidx.fragment.app.viewModels +import com.owori.android.R +import com.owori.android.auth.ui.viewmodel.NickNameViewModel +import com.owori.android.common.navigateTo +import com.owori.android.common.ui.view.BaseFragment +import com.owori.android.databinding.FragmentFamilyConnectBinding + + +class FamilyConnectFragment : BaseFragment(R.layout.fragment_family_connect) { + override val viewModel: NickNameViewModel by viewModels() + override fun setBindingVariables() { + with(binding) { + vm = viewModel + } + } + + override fun initView() { + + } + + override fun initObserver() { + with(viewModel) { + returnLogin.observe(viewLifecycleOwner) { + navigateTo(R.id.action_familyConnectFragment_to_inputFamilyCodeFragment) + } + btnNext.observe(viewLifecycleOwner) { + navigateTo(R.id.action_familyConnectFragment_to_groupFragment) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owori/android/auth/ui/view/GroupFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/GroupFragment.kt new file mode 100644 index 0000000..79f3b33 --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/view/GroupFragment.kt @@ -0,0 +1,31 @@ +package com.owori.android.auth.ui.view + + +import androidx.fragment.app.viewModels +import com.owori.android.R +import com.owori.android.auth.ui.viewmodel.NickNameViewModel +import com.owori.android.common.navigateTo +import com.owori.android.common.ui.view.BaseFragment +import com.owori.android.databinding.FragmentGroupBinding + + +class GroupFragment : BaseFragment(R.layout.fragment_group) { + override val viewModel: NickNameViewModel by viewModels() + override fun setBindingVariables() { + with(binding) { + vm = viewModel + } + } + + override fun initView() { + + } + + override fun initObserver() { + with(viewModel) { + btnNext.observe(viewLifecycleOwner) { + navigateTo(R.id.action_groupFragment_to_shareCodeFragment) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owori/android/auth/ui/view/InputFamilyCodeFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/InputFamilyCodeFragment.kt new file mode 100644 index 0000000..e2e9b15 --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/view/InputFamilyCodeFragment.kt @@ -0,0 +1,31 @@ +package com.owori.android.auth.ui.view + + +import androidx.fragment.app.viewModels +import com.owori.android.R +import com.owori.android.auth.ui.viewmodel.NickNameViewModel +import com.owori.android.common.navigateTo +import com.owori.android.common.ui.view.BaseFragment +import com.owori.android.databinding.FragmentInputFamilyCodeBinding + + +class InputFamilyCodeFragment : BaseFragment(R.layout.fragment_input_family_code) { + override val viewModel: NickNameViewModel by viewModels() + override fun setBindingVariables() { + with(binding) { + vm = viewModel + } + } + + override fun initView() { + + } + + override fun initObserver() { + with(viewModel) { + btnNext.observe(viewLifecycleOwner) { + navigateTo(R.id.action_inputFamilyCodeFragment_to_agreeServiceConditionFragment) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owori/android/auth/ui/view/LoginFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/LoginFragment.kt index f2db25f..3cebcc5 100644 --- a/app/src/main/java/com/owori/android/auth/ui/view/LoginFragment.kt +++ b/app/src/main/java/com/owori/android/auth/ui/view/LoginFragment.kt @@ -27,11 +27,11 @@ class LoginFragment : BaseFragment(R.layou with(viewModel) { // TODO : PolicyFragment를 위해 작성한 부분이라 수정 필요. callKakaoLogin.observe(viewLifecycleOwner) { - navigateTo(R.id.action_loginFragment_to_PolicyFragment) + navigateTo(R.id.action_LoginFragment_to_nickNameFragment) } callGoogleLogin.observe(viewLifecycleOwner) { - navigateTo(R.id.action_loginFragment_to_PolicyFragment) + navigateTo(R.id.action_LoginFragment_to_nickNameFragment) } } } diff --git a/app/src/main/java/com/owori/android/auth/ui/view/NickNameFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/NickNameFragment.kt new file mode 100644 index 0000000..0d11111 --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/view/NickNameFragment.kt @@ -0,0 +1,46 @@ +package com.owori.android.auth.ui.view + + +import androidx.core.content.ContextCompat +import androidx.fragment.app.viewModels +import com.owori.android.R +import com.owori.android.auth.ui.viewmodel.NickNameViewModel +import com.owori.android.common.navigateTo +import com.owori.android.common.ui.view.BaseFragment +import com.owori.android.databinding.FragmentNickNameBinding +import dagger.hilt.android.AndroidEntryPoint + +@AndroidEntryPoint +class NickNameFragment: BaseFragment(R.layout.fragment_nick_name) { + override val viewModel: NickNameViewModel by viewModels() + override fun setBindingVariables() { + with(binding) { + vm = viewModel + } + } + + override fun initView() { + + } + + override fun initObserver() { + with(viewModel) { + nickname.observe(viewLifecycleOwner) { + binding.viewpagerButton.isEnabled = it.isNotEmpty() + binding.nicknameLength.text = it.length.toString() + if(it.isNotEmpty()) { + binding.viewpagerButton.setTextColor(ContextCompat.getColor(requireContext(), R.color.white)) + } else { + binding.viewpagerButton.setTextColor(ContextCompat.getColor(requireContext(), R.color.grey_909090)) + } + } + + returnLogin.observe(viewLifecycleOwner) { + requireActivity().onBackPressedDispatcher.onBackPressed() + } + btnNext.observe(viewLifecycleOwner) { + navigateTo(R.id.action_nickNameFragment_to_birthDateFragment) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owori/android/auth/ui/view/ShareCodeFragment.kt b/app/src/main/java/com/owori/android/auth/ui/view/ShareCodeFragment.kt new file mode 100644 index 0000000..f501597 --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/view/ShareCodeFragment.kt @@ -0,0 +1,31 @@ +package com.owori.android.auth.ui.view + + +import androidx.fragment.app.viewModels +import com.owori.android.R +import com.owori.android.auth.ui.viewmodel.NickNameViewModel +import com.owori.android.common.navigateTo +import com.owori.android.common.ui.view.BaseFragment +import com.owori.android.databinding.FragmentShareCodeBinding + + +class ShareCodeFragment : BaseFragment(R.layout.fragment_share_code) { + override val viewModel: NickNameViewModel by viewModels() + override fun setBindingVariables() { + with(binding) { + vm = viewModel + } + } + + override fun initView() { + + } + + override fun initObserver() { + with(viewModel) { + btnNext.observe(viewLifecycleOwner) { + navigateTo(R.id.action_shareCodeFragment_to_agreeServiceConditionFragment) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owori/android/auth/ui/viewmodel/NickNameViewModel.kt b/app/src/main/java/com/owori/android/auth/ui/viewmodel/NickNameViewModel.kt new file mode 100644 index 0000000..83fa033 --- /dev/null +++ b/app/src/main/java/com/owori/android/auth/ui/viewmodel/NickNameViewModel.kt @@ -0,0 +1,28 @@ +package com.owori.android.auth.ui.viewmodel + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import com.owori.android.common.SingleLiveEvent +import com.owori.android.common.ui.viewmodel.BaseViewModel +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject + +@HiltViewModel +class NickNameViewModel @Inject constructor() : BaseViewModel() { + + val _nickname: MutableLiveData = MutableLiveData("") + val nickname: LiveData = _nickname + + private val _returnLogin: SingleLiveEvent = SingleLiveEvent() + val returnLogin: LiveData = _returnLogin + private val _btnNext: SingleLiveEvent = SingleLiveEvent() + val btnNext: LiveData = _btnNext + + fun onClickCheckButton() { + _btnNext.call() + } + + fun onClickBackButton() { + _returnLogin.call() + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/arrow_back.xml b/app/src/main/res/drawable/arrow_back.xml new file mode 100644 index 0000000..87a773f --- /dev/null +++ b/app/src/main/res/drawable/arrow_back.xml @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/check_btn_ripple.xml b/app/src/main/res/drawable/check_btn_ripple.xml new file mode 100644 index 0000000..ba659b0 --- /dev/null +++ b/app/src/main/res/drawable/check_btn_ripple.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/check_btn_selector.xml b/app/src/main/res/drawable/check_btn_selector.xml new file mode 100644 index 0000000..846f880 --- /dev/null +++ b/app/src/main/res/drawable/check_btn_selector.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/check_text_selector.xml b/app/src/main/res/drawable/check_text_selector.xml new file mode 100644 index 0000000..de50880 --- /dev/null +++ b/app/src/main/res/drawable/check_text_selector.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/focused_agree.xml b/app/src/main/res/drawable/focused_agree.xml new file mode 100644 index 0000000..3ed01c7 --- /dev/null +++ b/app/src/main/res/drawable/focused_agree.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/focused_birthdate.xml b/app/src/main/res/drawable/focused_birthdate.xml new file mode 100644 index 0000000..5eb23c5 --- /dev/null +++ b/app/src/main/res/drawable/focused_birthdate.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/focused_connect.xml b/app/src/main/res/drawable/focused_connect.xml new file mode 100644 index 0000000..f6b94e6 --- /dev/null +++ b/app/src/main/res/drawable/focused_connect.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/focused_group.xml b/app/src/main/res/drawable/focused_group.xml new file mode 100644 index 0000000..03aecc6 --- /dev/null +++ b/app/src/main/res/drawable/focused_group.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/focused_nickname.xml b/app/src/main/res/drawable/focused_nickname.xml new file mode 100644 index 0000000..fc7ea31 --- /dev/null +++ b/app/src/main/res/drawable/focused_nickname.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/make_code_background.xml b/app/src/main/res/drawable/make_code_background.xml new file mode 100644 index 0000000..8a8f9fd --- /dev/null +++ b/app/src/main/res/drawable/make_code_background.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/navigation_line.xml b/app/src/main/res/drawable/navigation_line.xml new file mode 100644 index 0000000..317fe1e --- /dev/null +++ b/app/src/main/res/drawable/navigation_line.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/received_code_background.xml b/app/src/main/res/drawable/received_code_background.xml new file mode 100644 index 0000000..ed52708 --- /dev/null +++ b/app/src/main/res/drawable/received_code_background.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/unfocused_agree.xml b/app/src/main/res/drawable/unfocused_agree.xml new file mode 100644 index 0000000..caaa112 --- /dev/null +++ b/app/src/main/res/drawable/unfocused_agree.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/drawable/unfocused_birthdate.xml b/app/src/main/res/drawable/unfocused_birthdate.xml new file mode 100644 index 0000000..eb48e1e --- /dev/null +++ b/app/src/main/res/drawable/unfocused_birthdate.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/drawable/unfocused_connect.xml b/app/src/main/res/drawable/unfocused_connect.xml new file mode 100644 index 0000000..a0816c4 --- /dev/null +++ b/app/src/main/res/drawable/unfocused_connect.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/drawable/unfocused_group.xml b/app/src/main/res/drawable/unfocused_group.xml new file mode 100644 index 0000000..cb69f24 --- /dev/null +++ b/app/src/main/res/drawable/unfocused_group.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/drawable/unfocused_nickname.xml b/app/src/main/res/drawable/unfocused_nickname.xml new file mode 100644 index 0000000..cf450fd --- /dev/null +++ b/app/src/main/res/drawable/unfocused_nickname.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/layout/fragment_agree_service_condition.xml b/app/src/main/res/layout/fragment_agree_service_condition.xml new file mode 100644 index 0000000..a877392 --- /dev/null +++ b/app/src/main/res/layout/fragment_agree_service_condition.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + +