-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from TeamOwori/develop
Develop
- Loading branch information
Showing
60 changed files
with
690 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
name: Owori-Isuue-Template | ||
about: Owori-Android 이슈 공통 템플릿 | ||
title: "[Android] 이슈제목" | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
# 목적 | ||
|
||
# 상세 내용 | ||
|
||
# 참고 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## 🧨이슈 | ||
<!-- 해당이슈와 관련있는 이슈를 적어주세요.--> | ||
|
||
## 🔍 상세 내용 (해결 내용) | ||
<!-- 상세 내용을 적어주세요. --> | ||
|
||
## 💡 참고자료 및 공유할만한 자료 (선택) | ||
<!-- 참고자료를 첨부해주세요. --> | ||
|
||
## ❕후속 진행 이슈 | ||
<!-- 후속 진행 이슈 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# Owori-Android | ||
- 오월이 안드로이드 Repository입니다. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...com/owrori/android/ui/OworiApplication.kt → ...ava/com/owori/android/OworiApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.owori.android | ||
|
||
import com.owori.android.auth.ui.viewmodel.AuthViewModel | ||
import com.owori.android.auth.ui.viewmodel.LoginViewModel | ||
import com.owori.android.auth.ui.viewmodel.OnBoardingViewModel | ||
import com.owori.android.auth.ui.viewmodel.PolicyViewModel | ||
import com.owori.android.auth.ui.viewmodel.SplashViewModel | ||
import org.koin.androidx.viewmodel.dsl.viewModel | ||
import org.koin.dsl.module | ||
|
||
val viewModelModule = module { | ||
viewModel { AuthViewModel() } | ||
viewModel { SplashViewModel() } | ||
viewModel { LoginViewModel() } | ||
viewModel { OnBoardingViewModel() } | ||
viewModel { PolicyViewModel() } | ||
} | ||
|
||
val appModules = listOf(viewModelModule) |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/owori/android/auth/ui/TextViewExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.owori.android.auth.ui | ||
|
||
import android.widget.TextView | ||
import androidx.databinding.BindingAdapter | ||
import com.owori.android.R | ||
|
||
@BindingAdapter("setTitleText") | ||
fun TextView.setTitleText(currentItemIndex: Int) { | ||
setText( | ||
when (currentItemIndex) { | ||
0 -> R.string.onboarding_first_title | ||
1 -> R.string.onboarding_second_title | ||
else -> R.string.onboarding_last_title | ||
} | ||
) | ||
} | ||
|
||
@BindingAdapter("setSubTitleText") | ||
fun TextView.setSubTitleText(currentItemIndex: Int) { | ||
setText( | ||
when (currentItemIndex) { | ||
0 -> R.string.onboarding_first_subtitle | ||
1 -> R.string.onboarding_second_subtitle | ||
else -> R.string.onboarding_last_subtitle | ||
} | ||
) | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/owori/android/auth/ui/adapter/OnBoardingViewPagerAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.owori.android.auth.ui.adapter | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.viewpager2.adapter.FragmentStateAdapter | ||
import com.owori.android.auth.ui.view.OnBoardingItemFragment | ||
|
||
class OnBoardingViewPagerAdapter(fragment: Fragment, fragmentIdList: List<OnBoardingItemFragment>): FragmentStateAdapter(fragment) { | ||
private val fragmentList = fragmentIdList; | ||
override fun getItemCount(): Int { | ||
return fragmentList.size | ||
} | ||
|
||
override fun createFragment(position: Int): Fragment { | ||
return fragmentList[position] | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
...rori/android/ui/auth/view/AuthActivity.kt → ...wori/android/auth/ui/view/AuthActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
app/src/main/java/com/owori/android/auth/ui/view/OnBoardingFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.owori.android.auth.ui.view | ||
|
||
import androidx.activity.addCallback | ||
import androidx.viewpager2.widget.ViewPager2 | ||
import com.owori.android.common.ui.view.BaseFragment | ||
import com.owori.android.R | ||
import com.owori.android.databinding.FragmentOnboardingBinding | ||
import com.owori.android.auth.ui.adapter.OnBoardingViewPagerAdapter | ||
import com.owori.android.auth.ui.viewmodel.OnBoardingViewModel | ||
import com.owori.android.common.navigateTo | ||
import org.koin.android.ext.android.inject | ||
|
||
class OnBoardingFragment : | ||
BaseFragment<FragmentOnboardingBinding, OnBoardingViewModel>(R.layout.fragment_onboarding) { | ||
override val viewModel: OnBoardingViewModel by inject() | ||
override fun setBindingVariables() { | ||
with(binding) { | ||
vm = viewModel | ||
} | ||
} | ||
|
||
override fun initView() { | ||
initViewPager() | ||
initCustomOnBackPressed() | ||
} | ||
|
||
override fun initObserver() { | ||
with(viewModel) { | ||
finishOnBoarding.observe(viewLifecycleOwner) { | ||
navigateTo(R.id.action_onboardingFragment_to_loginFragment) | ||
} | ||
|
||
currentItemIndex.observe(viewLifecycleOwner) { | ||
binding.onboardingViewpager.setCurrentItem(it, true) | ||
} | ||
} | ||
} | ||
|
||
private fun initCustomOnBackPressed() { | ||
requireActivity().onBackPressedDispatcher.addCallback(this) { | ||
requireActivity().finish() | ||
} | ||
} | ||
|
||
private fun initViewPager() { | ||
with(binding) { | ||
val viewpagerFragmentAdapter = | ||
OnBoardingViewPagerAdapter(this@OnBoardingFragment, setOnBoardingList()) | ||
onboardingViewpager.adapter = viewpagerFragmentAdapter | ||
registerOnPageChangeCallback() | ||
} | ||
} | ||
|
||
private fun setOnBoardingList() = listOf( | ||
OnBoardingItemFragment(R.layout.fragment_onboarding_first), | ||
OnBoardingItemFragment(R.layout.fragment_onboarding_second), | ||
OnBoardingItemFragment(R.layout.fragment_onboarding_third), | ||
) | ||
|
||
private fun registerOnPageChangeCallback() { | ||
binding.onboardingViewpager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { | ||
override fun onPageSelected(position: Int) { | ||
viewModel.setCurrentItemIndex(position) | ||
} | ||
}) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/owori/android/auth/ui/view/OnBoardingItemFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.owori.android.auth.ui.view | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
|
||
class OnBoardingItemFragment(private val fragmentId: Int) : Fragment() { | ||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
return inflater.inflate(fragmentId, container, false) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/owori/android/auth/ui/view/PolicyFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.owori.android.auth.ui.view | ||
|
||
import com.owori.android.R | ||
import com.owori.android.databinding.FragmentPolicyBinding | ||
import com.owori.android.auth.ui.viewmodel.PolicyViewModel | ||
import com.owori.android.common.ui.view.BaseFragment | ||
import org.koin.android.ext.android.inject | ||
|
||
class PolicyFragment : | ||
BaseFragment<FragmentPolicyBinding, PolicyViewModel>(R.layout.fragment_policy) { | ||
override val viewModel: PolicyViewModel by inject() | ||
override fun setBindingVariables() {} | ||
|
||
override fun initView() {} | ||
|
||
override fun initObserver() {} | ||
} |
12 changes: 6 additions & 6 deletions
12
...ri/android/ui/auth/view/SplashFragment.kt → ...ri/android/auth/ui/view/SplashFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/owori/android/auth/ui/viewmodel/AuthViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.owori.android.auth.ui.viewmodel | ||
|
||
import com.owori.android.common.ui.viewmodel.BaseViewModel | ||
|
||
class AuthViewModel : BaseViewModel() {} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/owori/android/auth/ui/viewmodel/LoginViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.owori.android.auth.ui.viewmodel | ||
|
||
import androidx.lifecycle.LiveData | ||
import com.owori.android.common.SingleLiveEvent | ||
import com.owori.android.common.ui.viewmodel.BaseViewModel | ||
|
||
class LoginViewModel : BaseViewModel() { | ||
private val _callKakaoLogin: SingleLiveEvent<Unit> = SingleLiveEvent() | ||
val callKakaoLogin: LiveData<Unit> = _callKakaoLogin | ||
private val _callGoogleLogin: SingleLiveEvent<Unit> = SingleLiveEvent() | ||
val callGoogleLogin: LiveData<Unit> = _callGoogleLogin | ||
|
||
fun onClickKakaoLogin() { | ||
_callKakaoLogin.call() | ||
} | ||
|
||
fun onClickGoogleLogin() { | ||
_callGoogleLogin.call() | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/owori/android/auth/ui/viewmodel/OnBoardingViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
class OnBoardingViewModel : BaseViewModel() { | ||
private val _currentItemIndex: MutableLiveData<Int> = MutableLiveData(0) | ||
val currentItemIndex: LiveData<Int> = _currentItemIndex | ||
private val _finishOnBoarding: SingleLiveEvent<Unit> = SingleLiveEvent(); | ||
val finishOnBoarding: LiveData<Unit> = _finishOnBoarding; | ||
|
||
fun setCurrentItemIndex(index: Int) { | ||
_currentItemIndex.value = index | ||
} | ||
|
||
fun onClickNextButton() { | ||
_currentItemIndex.value?.let { _index -> | ||
if (_index == LAST_PAGE) _finishOnBoarding.call() | ||
else _currentItemIndex.value = _currentItemIndex.value?.plus(1) | ||
} | ||
} | ||
|
||
companion object { | ||
private const val LAST_PAGE = 2 | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/owori/android/auth/ui/viewmodel/PolicyViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.owori.android.auth.ui.viewmodel | ||
|
||
import com.owori.android.common.ui.viewmodel.BaseViewModel | ||
|
||
class PolicyViewModel : BaseViewModel() {} |
Oops, something went wrong.