Skip to content

Commit

Permalink
[FEAT] 이용약관
Browse files Browse the repository at this point in the history
  • Loading branch information
kim0hoon committed Sep 6, 2023
1 parent fc84e3c commit e913139
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import com.polzzak_android.presentation.feature.root.MainViewModel
import com.polzzak_android.presentation.common.base.BaseFragment
import com.polzzak_android.presentation.common.model.ModelState
import com.polzzak_android.presentation.common.util.hideKeyboard
import com.polzzak_android.presentation.feature.term.TermDetailFragment
import com.polzzak_android.presentation.feature.term.model.TermType
import dagger.hilt.android.AndroidEntryPoint
import timber.log.Timber
import javax.inject.Inject
Expand Down Expand Up @@ -233,35 +235,19 @@ class SignUpFragment : BaseFragment<FragmentSignupBinding>() {
}
ivBtnServiceDetail.setOnClickListener {
val detailDataBundle = Bundle().apply {
putString(
SignUpTermDetailFragment.ARGUMENT_TITLE_KEY,
getString(R.string.signup_terms_of_service_detail_service_title)
)
//TODO 약관 url 추가
putString(
SignUpTermDetailFragment.ARGUMENT_URL_KEY,
"http://google.co.kr"
)
putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.SERVICE)
}
findNavController().navigate(
R.id.action_signUpFragment_to_signUpTermDetailFragment,
R.id.action_signUpFragment_to_termDetailFragment,
detailDataBundle
)
}
ivBtnPrivacyDetail.setOnClickListener {
val detailDataBundle = Bundle().apply {
putString(
SignUpTermDetailFragment.ARGUMENT_TITLE_KEY,
getString(R.string.signup_terms_of_service_detail_privacy_title)
)
//TODO 약관 url 추가
putString(
SignUpTermDetailFragment.ARGUMENT_URL_KEY,
"http://naver.com"
)
putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.PRIVACY)
}
findNavController().navigate(
R.id.action_signUpFragment_to_signUpTermDetailFragment,
R.id.action_signUpFragment_to_termDetailFragment,
detailDataBundle
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import com.polzzak_android.presentation.component.toolbar.ToolbarData
import com.polzzak_android.presentation.component.toolbar.ToolbarHelper
import com.polzzak_android.presentation.component.toolbar.ToolbarIconInteraction
import com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountManagementFragment.Companion.ARGUMENT_NICKNAME_KEY
import com.polzzak_android.presentation.feature.term.TermDetailFragment
import com.polzzak_android.presentation.feature.term.model.TermType

class KidMyPageFragment : BaseFragment<FragmentKidMyPageBinding>(), ToolbarIconInteraction {
override val layoutResId: Int = R.layout.fragment_kid_my_page
Expand Down Expand Up @@ -91,11 +93,17 @@ class KidMyPageFragment : BaseFragment<FragmentKidMyPageBinding>(), ToolbarIconI
}

fun onClickUsingTerms() {
// todo: 이용약관 클릭
val bundle = Bundle().apply {
putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.SERVICE)
}
findNavController().navigate(R.id.action_kidMyPageFragment_to_termDetailFragment, bundle)
}

fun onClickPrivacyPolicy() {
// todo: 개인정보처리방침 클릭
val bundle = Bundle().apply {
putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.PRIVACY)
}
findNavController().navigate(R.id.action_kidMyPageFragment_to_termDetailFragment, bundle)
}

override fun onToolbarIconClicked() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import com.polzzak_android.presentation.component.toolbar.ToolbarData
import com.polzzak_android.presentation.component.toolbar.ToolbarHelper
import com.polzzak_android.presentation.component.toolbar.ToolbarIconInteraction
import com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountManagementFragment
import com.polzzak_android.presentation.feature.term.TermDetailFragment
import com.polzzak_android.presentation.feature.term.model.TermType

class ProtectorMyPageFragment : BaseFragment<FragmentProtectorMyPageBinding>(),
ToolbarIconInteraction {
Expand Down Expand Up @@ -93,11 +95,23 @@ class ProtectorMyPageFragment : BaseFragment<FragmentProtectorMyPageBinding>(),
}

fun onClickUsingTerms() {
// todo: 이용약관 클릭
val bundle = Bundle().apply {
putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.SERVICE)
}
findNavController().navigate(
R.id.action_protectorMyPageFragment_to_termDetailFragment,
bundle
)
}

fun onClickPrivacyPolicy() {
// todo: 개인정보처리방침 클릭
val bundle = Bundle().apply {
putParcelable(TermDetailFragment.ARGUMENT_TYPE_KEY, TermType.PRIVACY)
}
findNavController().navigate(
R.id.action_protectorMyPageFragment_to_termDetailFragment,
bundle
)
}

override fun onToolbarIconClicked() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
package com.polzzak_android.presentation.feature.auth.signup
package com.polzzak_android.presentation.feature.term

import android.webkit.WebViewClient
import androidx.navigation.fragment.findNavController
import com.polzzak_android.R
import com.polzzak_android.databinding.FragmentSignupTermDetailBinding
import com.polzzak_android.databinding.FragmentTermDetailBinding
import com.polzzak_android.presentation.common.base.BaseFragment
import com.polzzak_android.presentation.common.util.getParcelableOrNull
import com.polzzak_android.presentation.component.toolbar.ToolbarData
import com.polzzak_android.presentation.component.toolbar.ToolbarHelper
import com.polzzak_android.presentation.feature.term.model.TermType

class SignUpTermDetailFragment : BaseFragment<FragmentSignupTermDetailBinding>() {
override val layoutResId: Int = R.layout.fragment_signup_term_detail
class TermDetailFragment : BaseFragment<FragmentTermDetailBinding>() {
override val layoutResId: Int = R.layout.fragment_term_detail

private val type by lazy {
arguments?.getParcelableOrNull(ARGUMENT_TYPE_KEY, TermType::class.java)
}

override fun initView() {
super.initView()
Expand All @@ -19,7 +25,7 @@ class SignUpTermDetailFragment : BaseFragment<FragmentSignupTermDetailBinding>()

private fun initToolbar() {
with(binding.inToolbar) {
val title = arguments?.getString(ARGUMENT_TITLE_KEY) ?: ""
val title = type?.let { getString(it.titleStrRes) } ?: ""
val toolbarData =
ToolbarData(popStack = findNavController(), titleText = title)
ToolbarHelper(data = toolbarData, toolbar = this).run {
Expand All @@ -31,7 +37,7 @@ class SignUpTermDetailFragment : BaseFragment<FragmentSignupTermDetailBinding>()

private fun initWebView() {
with(binding.wbContent) {
val url = arguments?.getString(ARGUMENT_URL_KEY) ?: ""
val url = type?.url ?: ""
webViewClient = WebViewClient()
settings.loadWithOverviewMode = true
settings.useWideViewPort = true
Expand All @@ -40,7 +46,6 @@ class SignUpTermDetailFragment : BaseFragment<FragmentSignupTermDetailBinding>()
}

companion object {
const val ARGUMENT_TITLE_KEY = "argument_title_key"
const val ARGUMENT_URL_KEY = "argument_url_key"
const val ARGUMENT_TYPE_KEY = "argument_type_key"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.polzzak_android.presentation.feature.term.model

import android.os.Parcelable
import androidx.annotation.StringRes
import com.polzzak_android.R
import kotlinx.parcelize.Parcelize

//TODO 웹뷰 주소
@Parcelize
enum class TermType(@StringRes val titleStrRes: Int, val url: String) : Parcelable {
SERVICE(R.string.terms_of_service_detail_service_title, "http://google.co.kr"),
PRIVACY(R.string.terms_of_service_detail_privacy_title, "http://naver.com"),
}
9 changes: 9 additions & 0 deletions app/src/main/res/navigation/kid_nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
<action
android:id="@+id/action_kidMyPageFragment_to_myAccountManagementFragment"
app:destination="@id/myAccountManagementFragment" />

<action
android:id="@+id/action_kidMyPageFragment_to_termDetailFragment"
app:destination="@id/termDetailFragment" />
</fragment>

<fragment
Expand Down Expand Up @@ -102,6 +106,11 @@
android:id="@+id/myAccountDeleteFragment"
android:name="com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountDeleteFragment"
android:label="MyAccountDeleteFragment" />

<fragment
android:id="@+id/termDetailFragment"
android:name="com.polzzak_android.presentation.feature.term.TermDetailFragment"
android:label="TermDetailFragment" />
</navigation>


Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/navigation/protector_nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
<action
android:id="@+id/action_protectorMyPageFragment_to_myAccountManagementFragment"
app:destination="@id/myAccountManagementFragment" />

<action
android:id="@+id/action_protectorMyPageFragment_to_termDetailFragment"
app:destination="@id/termDetailFragment" />
</fragment>

<fragment
Expand Down Expand Up @@ -117,4 +121,10 @@
android:name="com.polzzak_android.presentation.feature.myPage.accountmanagement.MyAccountDeleteFragment"
android:label="MyAccountDeleteFragment"
tools:layout="@layout/fragment_my_account_delete" />

<fragment
android:id="@+id/termDetailFragment"
android:name="com.polzzak_android.presentation.feature.term.TermDetailFragment"
android:label="TermDetailFragment"
tools:layout="@layout/fragment_term_detail" />
</navigation>
12 changes: 6 additions & 6 deletions app/src/main/res/navigation/sign_up_nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
android:id="@+id/action_signUpFragment_to_protectorOnBoardingFragment"
app:destination="@id/protectorOnBoardingFragment" />
<action
android:id="@+id/action_signUpFragment_to_signUpTermDetailFragment"
app:destination="@id/signUpTermDetailFragment" />
android:id="@+id/action_signUpFragment_to_termDetailFragment"
app:destination="@id/termDetailFragment" />
</fragment>

<fragment
android:id="@+id/signUpTermDetailFragment"
android:name="com.polzzak_android.presentation.feature.auth.signup.SignUpTermDetailFragment"
android:label="SignUpTermDetailFragment"
tools:layout="@layout/fragment_signup_term_detail" />
android:id="@+id/termDetailFragment"
android:name="com.polzzak_android.presentation.feature.term.TermDetailFragment"
android:label="termDetailFragment"
tools:layout="@layout/fragment_term_detail" />

<fragment
android:id="@+id/kidOnBoardingFragment"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
<string name="signup_terms_of_service_agree_all">모두 동의</string>
<string name="signup_terms_of_service_agree_service">서비스 이용약관에 동의합니다.</string>
<string name="signup_terms_of_service_agree_privacy">개인정보처리방침에 동의합니다.</string>
<string name="signup_terms_of_service_detail_service_title">이용약관</string>
<string name="signup_terms_of_service_detail_privacy_title">개인정보처리방침</string>

<!-- OnBoarding -->
<string name="on_boarding_kid_first_title">폴짝!\n회원이 되신 것을 환영해요</string>
Expand Down Expand Up @@ -181,5 +179,7 @@
<string name="my_account_management_delete_dialog_btn_negative">아니요</string>
<string name="my_account_management_delete_dialog_btn_positive">네,탈퇴할래요</string>


<!-- Term -->
<string name="terms_of_service_detail_service_title">이용약관</string>
<string name="terms_of_service_detail_privacy_title">개인정보처리방침</string>
</resources>

0 comments on commit e913139

Please sign in to comment.