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/#22-web-notion-mypage]: 마이페이지 외부 웹 뷰 링크 이동 구현 -intent 구현 #24

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
package com.zucchini.projects

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.zucchini.feature.projects.R
import com.zucchini.feature.projects.databinding.FragmentMypageBinding

class MypageFragment : Fragment() {

private var _binding: FragmentMypageBinding? = null
private val binding: FragmentMypageBinding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
return inflater.inflate(R.layout.fragment_mypage, container, false)
): View {
_binding = FragmentMypageBinding.inflate(inflater, container, false)

navigateToWebDocs()
navigateToKakaoOpenChat()
return binding.root
}

private fun navigateToWebDocs() {
binding.tvTermsOfUse.setOnClickListener {
val privacyRuleUrl = getString(R.string.service_docs_uri)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(privacyRuleUrl))
startActivity(intent)
}
binding.tvPrivacyPolicy.setOnClickListener {
val privacyRuleUrl = getString(R.string.service_docs_uri)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(privacyRuleUrl))
startActivity(intent)
}
}

private fun navigateToKakaoOpenChat() {
binding.tvComplaint.setOnClickListener {
val kakaoOpenChatUrl = getString(R.string.tv_complaint_link)
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(kakaoOpenChatUrl))
startActivity(intent)
}
}
}
27 changes: 15 additions & 12 deletions feature/projects/src/main/res/layout/fragment_mypage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,23 @@
android:layout_marginStart="20dp"
android:layout_marginBottom="20dp"
android:fontFamily="@font/pretendardbold"
android:padding="10dp"
android:text="@string/tv_terms_of_use"
android:textColor="@color/olive_gray"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@+id/divider1" />
app:layout_constraintBottom_toTopOf="@+id/divider1"
app:layout_constraintStart_toStartOf="parent" />

<View
android:id="@+id/divider1"
android:layout_width="match_parent"
android:layout_height="1dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp"
android:background="@color/olive_gray"
app:layout_constraintBottom_toTopOf="@+id/tv_privacy_policy" />
app:layout_constraintBottom_toTopOf="@+id/tv_privacy_policy"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/tv_privacy_policy"
Expand All @@ -120,22 +121,23 @@
android:layout_marginStart="20dp"
android:layout_marginBottom="20dp"
android:fontFamily="@font/pretendardbold"
android:padding="10dp"
android:text="@string/tv_privacy_policy"
android:textColor="@color/olive_gray"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@+id/divider2" />
app:layout_constraintBottom_toTopOf="@+id/divider2"
app:layout_constraintStart_toStartOf="parent" />

<View
android:id="@+id/divider2"
android:layout_width="match_parent"
android:layout_height="1dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp"
android:background="@color/olive_gray"
app:layout_constraintBottom_toTopOf="@+id/tv_complaint" />
app:layout_constraintBottom_toTopOf="@+id/tv_complaint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/tv_complaint"
Expand All @@ -144,10 +146,11 @@
android:layout_marginStart="20dp"
android:layout_marginBottom="30dp"
android:fontFamily="@font/pretendardbold"
android:padding="10dp"
android:text="@string/tv_complaint"
android:textColor="@color/olive_gray"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 2 additions & 0 deletions feature/projects/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
<string name="tv_terms_of_use">이용약관</string>
<string name="tv_privacy_policy">개인정보 처리방침</string>
<string name="tv_complaint">신고하기</string>
<string name="service_docs_uri">https://coordinated-muskmelon-1dd.notion.site/c2d326eb516f48a48633bffa5df05936?pvs=4</string>
<string name="tv_complaint_link">https://open.kakao.com/o/sDP9VYRb</string>
</resources>
Loading