This repository was archived by the owner on Aug 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/kotlin/com/gravatar/app/homeUi/presentation/home/components/topbar/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ dependencies {
2121 implementation(libs.androidx.ui.graphics)
2222 implementation(libs.androidx.navigation)
2323 implementation(libs.androidx.constraintLayout.compose)
24+ implementation(libs.androidx.browser)
2425 implementation(libs.coil.compose)
2526 implementation(project.dependencies.platform(libs.koin.bom))
2627 implementation(libs.koin.core)
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.gravatar.app.homeUi.presentation.home.components.topbar.components
22
33import android.content.Context
44import android.content.Intent
5+ import androidx.browser.customtabs.CustomTabsIntent
56import androidx.compose.foundation.clickable
67import androidx.compose.foundation.layout.Arrangement
78import androidx.compose.foundation.layout.Column
@@ -125,15 +126,18 @@ private fun Context.sendSupportEmail() {
125126
126127private fun Context.openSupportPage () = openUrl(" https://$SUPPORT_URL " )
127128
128- private fun Context.openTermsOfService () = openUrl (TERMS_OF_SERVICE_URL )
129+ private fun Context.openTermsOfService () = openUrlInApp (TERMS_OF_SERVICE_URL )
129130
130- private fun Context.openPrivacyPolicy () = openUrl (PRIVACY_POLICY_URL )
131+ private fun Context.openPrivacyPolicy () = openUrlInApp (PRIVACY_POLICY_URL )
131132
132133private fun Context.openUrl (url : String ) {
133134 val intent = Intent (Intent .ACTION_VIEW , url.toUri())
134135 startActivity(intent)
135136}
136137
138+ private fun Context.openUrlInApp (url : String ) =
139+ CustomTabsIntent .Builder ().build().launchUrl(this , url.toUri())
140+
137141private const val SUPPORT_URL = " support.gravatar.com"
138142private const val SUPPORT_EMAIL = " support@gravatar.com"
139143private const val TERMS_OF_SERVICE_URL = " https://wordpress.com/tos/"
You can’t perform that action at this time.
0 commit comments