Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.
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
1 change: 1 addition & 0 deletions homeUi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies {
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.navigation)
implementation(libs.androidx.constraintLayout.compose)
implementation(libs.androidx.browser)
implementation(libs.coil.compose)
implementation(project.dependencies.platform(libs.koin.bom))
implementation(libs.koin.core)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.gravatar.app.homeUi.presentation.home.components.topbar.components

import android.content.Context
import android.content.Intent
import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -125,15 +126,18 @@ private fun Context.sendSupportEmail() {

private fun Context.openSupportPage() = openUrl("https://$SUPPORT_URL")

private fun Context.openTermsOfService() = openUrl(TERMS_OF_SERVICE_URL)
private fun Context.openTermsOfService() = openUrlInApp(TERMS_OF_SERVICE_URL)

private fun Context.openPrivacyPolicy() = openUrl(PRIVACY_POLICY_URL)
private fun Context.openPrivacyPolicy() = openUrlInApp(PRIVACY_POLICY_URL)

private fun Context.openUrl(url: String) {
val intent = Intent(Intent.ACTION_VIEW, url.toUri())
startActivity(intent)
}

private fun Context.openUrlInApp(url: String) =
CustomTabsIntent.Builder().build().launchUrl(this, url.toUri())

private const val SUPPORT_URL = "support.gravatar.com"
private const val SUPPORT_EMAIL = "support@gravatar.com"
private const val TERMS_OF_SERVICE_URL = "https://wordpress.com/tos/"
Expand Down