Skip to content

Commit

Permalink
Merge pull request #106 from Team-HMH/feat/privacy_termofuse
Browse files Browse the repository at this point in the history
[feat/privacy_termofuse]: 이용약관, 개인정보보호 버튼 기능 추가
  • Loading branch information
kez-lab authored Jan 13, 2024
2 parents f7cf55e + cc364df commit 4fcc225
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.hmh.hamyeonham.plugin

import com.android.build.gradle.BaseExtension
import java.util.Properties
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import java.util.Properties

internal fun Project.configureAndroidCommonPlugin() {

val properties = Properties().apply {
load(rootProject.file("local.properties").inputStream())
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.hmh.hamyeonham.core.network.auth.interceptor

import com.hmh.hamyeonham.core.network.auth.datastore.HMHNetworkPreference
import okhttp3.Headers
import javax.inject.Inject
import okhttp3.Interceptor
import okhttp3.Response
import javax.inject.Inject

class AuthInterceptor @Inject constructor(
private val dataStore: HMHNetworkPreference
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.hmh.hamyeonham.mypage

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.text.SpannableStringBuilder
import android.text.Spanned
Expand Down Expand Up @@ -31,32 +33,32 @@ class MyPageFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
savedInstanceState: Bundle?,
): View {
return FragmentMyPageBinding.inflate(inflater, container, false).root
}

override fun onViewCreated(
view: View,
savedInstanceState: Bundle?
savedInstanceState: Bundle?,
) {
super.onViewCreated(view, savedInstanceState)
initViews()
collectMainState()
initPrivacyButton()
initTermOfUseButton()
}

private fun initViews() {
binding.tvLogout.setOnClickListener {
TwoButtonCommonDialog.newInstance(
title = getString(R.string.logout_description),
confirmButtonText = getString(com.hmh.hamyeonham.core.designsystem.R.string.all_okay),
dismissButtonText = getString(com.hmh.hamyeonham.core.designsystem.R.string.all_cancel)
dismissButtonText = getString(com.hmh.hamyeonham.core.designsystem.R.string.all_cancel),
).apply {
setConfirmButtonClickListener {

}
setDismissButtonClickListener {

}
}.showAllowingStateLoss(childFragmentManager)
}
Expand All @@ -78,12 +80,28 @@ class MyPageFragment : Fragment() {
SpannableStringBuilder(point.toString() + " " + getString(R.string.mypage_point_unit))
builder.setSpan(
ForegroundColorSpan(
getColor(requireContext(), com.hmh.hamyeonham.core.designsystem.R.color.gray2)
getColor(requireContext(), com.hmh.hamyeonham.core.designsystem.R.color.gray2),
),
builder.length - 1,
builder.length,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
Spanned.SPAN_INCLUSIVE_EXCLUSIVE,
)
return builder
}

private fun initPrivacyButton() {
binding.vPrivacy.setOnClickListener {
val privacyRuleUrl = getString(R.string.privacy_url)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(privacyRuleUrl))
startActivity(intent)
}
}

private fun initTermOfUseButton() {
binding.vTermofuse.setOnClickListener {
val termOfUseUrl =getString(R.string.term_of_use_url)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(termOfUseUrl))
startActivity(intent)
}
}
}
2 changes: 2 additions & 0 deletions feature/mypage/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
<string name="mypage_termofuse">이용약관</string>
<string name="mypage_privacy">개인정보처리방침</string>
<string name="logout_description">하면함을 로그아웃 하시겠어요?</string>
<string name="privacy_url">"https://www.notion.so/hmhteam/4219063a635e4eec8d8b9719c6c2a6fa"</string>
<string name="term_of_use_url">"https://www.notion.so/hmhteam/33acb29be57245f394eb93ddb2e3b8cc"</string>
</resources>

0 comments on commit 4fcc225

Please sign in to comment.