Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#46 초대코드 입력화면 구현 #48

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
19acb8e
feat: 닉네임 입력화면, 생년월일 입력화면, 가족 그룹명 입력화면, 가족연결 화면, 초대하기 화면, 약관동의 화면 UI구…
posite Sep 24, 2023
ac5dbc6
feat: 사용자의 닉네임 입력을 위한 화면 구성 #14
posite Oct 7, 2023
329337a
fix: 잘못된 UI 수정 및 색상 추가, NickNameViewModel과 관련 없는 코드 수정
posite Oct 22, 2023
8de06d5
feat: 사용자의 생년월일 입력을 위한 화면 구성 #16
posite Oct 23, 2023
92616d4
fix: edittext hint 크기 및 색상 수정
posite Oct 23, 2023
87787b5
chore: review 반영 및 conflic resolve
posite Nov 9, 2023
7c59dcd
feat: 성선월일 입력 화면 구현 및 develop pull
posite Nov 9, 2023
a41fe9e
feat: 가족연결 화면 구현 #20
posite Nov 10, 2023
3d0899b
chore: pull develop branch #9
posite Dec 17, 2023
55ef70e
Merge branch 'feat/#9-개인정보입력화면개발' into feat/#14-닉네임-입력-화면-개발
posite Dec 17, 2023
895ea7d
Merge pull request #41 from TeamOwori/feat/#14-닉네임-입력-화면-개발
posite Dec 17, 2023
3f73f28
Merge pull request #42 from TeamOwori/feat/#16-생년월일-입력-화면
posite Dec 17, 2023
61625e0
Merge pull request #43 from TeamOwori/feat/#20-가족연결-기능-개발
posite Dec 17, 2023
f4b7daa
feat: 가족 그룹명 입력 화면 구성 및 view 오류 수정
posite Dec 17, 2023
730c5a4
feat: 초대하기 기능 구현 #21
posite Dec 17, 2023
8858c93
chore: timer 시작 시간 수정 및 변수 이름 변경 #21
posite Dec 17, 2023
fa66b64
fix: 매직 넘버 제거 및 필요 없는 databinding 코드 제거 #21
posite Dec 22, 2023
5f5190f
feat: 초대코드 입력 화면 구현 #46
posite Dec 23, 2023
4535baa
feat: 입력한 초대 코드에 따른 결과 text 색상 추가 #46
posite Dec 23, 2023
e286851
feat: 초대코드 입력 후 다른 화면 클릭 시 키보드 제거, 초대코드 입력 오류에 대한 화면 구현
posite Dec 23, 2023
cc270fb
fix: 키보드 입력 시 설명 text가 화면을 가리는 오류 수정
posite Dec 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package com.owori.android.presenter.auth

import android.content.Context
import android.util.Log
import android.view.MotionEvent
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
import androidx.activity.viewModels
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.fragment.findNavController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(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)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.owori.android.auth.ui.view

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.owori.android.R
import com.owori.android.databinding.FragmentAgreeAutoLoginBinding


class AgreeAutoLoginFragment: BottomSheetDialogFragment() {

private lateinit var binding: FragmentAgreeAutoLoginBinding
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
binding = FragmentAgreeAutoLoginBinding.inflate(inflater, container, false)
return binding.root
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.owori.android.presenter.policy

import androidx.fragment.app.viewModels
import com.owori.android.R
import com.owori.android.core.BaseFragment
import com.owori.android.databinding.FragmentAgreeServiceConditionBinding

class AgreeServiceConditionFragment : BaseFragment<FragmentAgreeServiceConditionBinding, AgreeServiceConditionViewModel>(R.layout.fragment_agree_service_condition) {
override val viewModel: AgreeServiceConditionViewModel by viewModels()
override fun setBindingVariables() {
with(binding) {
vm = viewModel
}
}

override fun initView() {

}

override fun initObserver() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.owori.android.presenter.policy

import androidx.lifecycle.LiveData
import com.owori.android.core.BaseViewModel
import com.owori.android.presenter.util.SingleLiveEvent
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class AgreeServiceConditionViewModel @Inject constructor(): BaseViewModel() {
private val _btnNext: SingleLiveEvent<Unit> = SingleLiveEvent()
val btnNext: LiveData<Unit> = _btnNext

fun onClickCheckButton() {
_btnNext.call()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package com.owori.android.presenter.policy


import android.text.Editable
import android.text.TextWatcher
import androidx.core.content.ContextCompat
import androidx.fragment.app.viewModels
import com.owori.android.R
import com.owori.android.core.BaseFragment
import com.owori.android.core.navigateTo
import com.owori.android.databinding.FragmentBirthDateBinding


class BirthDateFragment : BaseFragment<FragmentBirthDateBinding, BirthDateViewModel>(R.layout.fragment_birth_date) {
override val viewModel: BirthDateViewModel by viewModels()
override fun setBindingVariables() {
with(binding) {
vm = viewModel
}
}

override fun initView() {
initTextWatcher()
}

override fun initObserver() {
with(viewModel) {
btnNext.observe(viewLifecycleOwner) {
navigateTo(R.id.action_birthDateFragment_to_familyConnectFragment)
}

birthDate.observe(viewLifecycleOwner) {
val verify = it.split("-")
if(verify.size == 3) {
if(verify[0].length == 4 && verify[1].length == 2 && verify[2].length == 2) {
setButtonEnableTrue()
} else {
setButtonEnableFalse()
}
} else {
setButtonEnableFalse()
}
}

btnBack.observe(viewLifecycleOwner) {
requireActivity().onBackPressedDispatcher.onBackPressed()
}
}
}

private fun initTextWatcher() {
binding.birthdateEt.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
var textlength = 0
if(binding.birthdateEt.isFocusable && s.toString() != "") {
try{
textlength = binding.birthdateEt.text.toString().length
}catch (e: NumberFormatException){
e.printStackTrace()
return
}
if (textlength == 4 && before != 1) {
val date = binding.birthdateEt.text.toString()+"-"
binding.birthdateEt.setText(date)
binding.birthdateEt.setSelection(binding.birthdateEt.text.length)

}else if (textlength == 7&& before != 1){
val date = binding.birthdateEt.text.toString()+"-"
binding.birthdateEt.setText(date)
binding.birthdateEt.setSelection(binding.birthdateEt.text.length)

}else if(textlength == 5 && !binding.birthdateEt.text.toString().contains("-") &&
!binding.birthdateEt.text.toString().substring(0,4).contains('-')){
val date = binding.birthdateEt.text.toString().substring(0,4)+"-"+binding.birthdateEt.text.toString().substring(4)
binding.birthdateEt.setText(date)
binding.birthdateEt.setSelection(binding.birthdateEt.text.length)

}else if(textlength == 8 && binding.birthdateEt.text.toString().substring(7,8) != "-" &&
!binding.birthdateEt.text.toString().substring(0,4).contains('-') &&
!binding.birthdateEt.text.toString().substring(5,8).contains('-') &&
!binding.birthdateEt.text.toString().substring(5).contains('-')){
val date = binding.birthdateEt.text.toString().substring(0,7)+"-"+binding.birthdateEt.text.toString().substring(7)
binding.birthdateEt.setText(date)
binding.birthdateEt.setSelection(binding.birthdateEt.text.length)
}
}
}

override fun afterTextChanged(s: Editable?) {
}

})
}

private fun setButtonEnableTrue() {
with(binding.viewpagerButton) {
isEnabled = true
setTextColor(ContextCompat.getColor(requireContext(), R.color.white))
}
}

private fun setButtonEnableFalse() {
with(binding.viewpagerButton) {
isEnabled = false
setTextColor(ContextCompat.getColor(requireContext(), R.color.grey_909090))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.owori.android.presenter.policy

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.owori.android.core.BaseViewModel
import com.owori.android.presenter.util.SingleLiveEvent
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class BirthDateViewModel @Inject constructor(): BaseViewModel() {
private val _btnNext: SingleLiveEvent<Unit> = SingleLiveEvent()
val btnNext: LiveData<Unit> = _btnNext
private val _btnBack: SingleLiveEvent<Unit> = SingleLiveEvent()
val btnBack: LiveData<Unit> = _btnBack

val _birthDate: MutableLiveData<String> = MutableLiveData("")
val birthDate: LiveData<String> = _birthDate

fun onClickCheckButton() {
_btnNext.call()
}

fun onClickBackButton() {
_btnBack.call()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.owori.android.presenter.policy


import androidx.fragment.app.viewModels
import com.owori.android.R
import com.owori.android.core.BaseFragment
import com.owori.android.core.navigateTo
import com.owori.android.databinding.FragmentFamilyConnectBinding


class FamilyConnectFragment : BaseFragment<FragmentFamilyConnectBinding, FamilyConnectViewModel>(R.layout.fragment_family_connect) {
override val viewModel: FamilyConnectViewModel 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)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.owori.android.presenter.policy

import androidx.lifecycle.LiveData
import com.owori.android.core.BaseViewModel
import com.owori.android.presenter.util.SingleLiveEvent
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class FamilyConnectViewModel @Inject constructor(): BaseViewModel() {

private val _btnNext: SingleLiveEvent<Unit> = SingleLiveEvent()
val btnNext: LiveData<Unit> = _btnNext
private val _returnLogin: SingleLiveEvent<Unit> = SingleLiveEvent()
val returnLogin: LiveData<Unit> = _returnLogin

fun onClickCheckButton() {
_btnNext.call()
}

fun onClickBackButton() {
_returnLogin.call()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.owori.android.presenter.policy


import androidx.core.content.ContextCompat
import androidx.fragment.app.viewModels
import com.owori.android.R
import com.owori.android.core.BaseFragment
import com.owori.android.core.navigateTo
import com.owori.android.databinding.FragmentGroupBinding


class GroupFragment : BaseFragment<FragmentGroupBinding, GroupViewModel>(R.layout.fragment_group) {
override val viewModel: GroupViewModel by viewModels()
override fun setBindingVariables() {
with(binding) {
vm = viewModel
}
}

override fun initView() {

}

override fun initObserver() {
with(viewModel) {
groupname.observe(viewLifecycleOwner) {
setViewPagerButton(it)
}
btnNext.observe(viewLifecycleOwner) {
navigateTo(R.id.action_groupFragment_to_shareCodeFragment)
}
btnBack.observe(viewLifecycleOwner) {
requireActivity().onBackPressedDispatcher.onBackPressed()
}
}
}

private fun setViewPagerButton(groupname: String) {
val isInputted = groupname.isNotEmpty()
with(binding.viewpagerButton) {
isEnabled = isInputted
if(isInputted) {
setTextColor(ContextCompat.getColor(requireContext(), R.color.white))
} else {
setTextColor(ContextCompat.getColor(requireContext(), R.color.grey_909090))
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.owori.android.presenter.policy

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.owori.android.core.BaseViewModel
import com.owori.android.presenter.util.SingleLiveEvent
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class GroupViewModel @Inject constructor(): BaseViewModel() {
val _groupname: MutableLiveData<String> = MutableLiveData("")
val groupname: LiveData<String> = _groupname

private val _btnNext: SingleLiveEvent<Unit> = SingleLiveEvent()
val btnNext: LiveData<Unit> = _btnNext
private val _btnBack: SingleLiveEvent<Unit> = SingleLiveEvent()
val btnBack: LiveData<Unit> = _btnBack

fun onClickCheckButton() {
_btnNext.call()
}

fun onClickBackButton() {
_btnBack.call()
}
}
Loading