Skip to content
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 Common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies {
api(core.splitties.coroutines)
api(core.androidx.lifecycle.service)
api(core.splitties.intents)
implementation(core.androidx.browser)
implementation(core.androidx.collection)
implementation(core.splitties.bitflags)
implementation(core.splitties.toast)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package com.infomaniak.core.common.extensions

import android.R.attr.duration
import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Context
Expand All @@ -28,6 +27,7 @@ import android.content.res.Configuration
import android.provider.Settings
import android.widget.Toast
import androidx.annotation.StringRes
import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.content.ContextCompat
import androidx.core.net.toUri
import com.infomaniak.core.common.R
Expand All @@ -50,6 +50,10 @@ fun Context.openUrl(url: String) {
safeStartActivity(Intent(Intent.ACTION_VIEW, url.toUri()), R.string.browserNotFound)
}

fun Context.openUrlInCustomTab(url: String) {
CustomTabsIntent.Builder().build().launchUrl(this, url.toUri())
Comment thread
baillyjamy marked this conversation as resolved.
}

fun Context.safeStartActivity(
intent: Intent,
@StringRes title: Int = R.string.startActivityCantHandleAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.core.common.extensions.openUrl
import com.infomaniak.core.common.extensions.openUrlInCustomTab
import com.infomaniak.core.privacymanagement.theme.LocalPrivacyManagementTheme
import com.infomaniak.core.privacymanagement.tracker.Tracker
import com.infomaniak.core.ui.compose.margin.Margin
Expand Down Expand Up @@ -96,7 +96,9 @@ private fun SourceButton(sourceUrl: String) {
modifier = Modifier
.fillMaxWidth()
.heightIn(min = 48.dp),
onClick = { context.openUrl(sourceUrl) },
onClick = {
context.openUrlInCustomTab(sourceUrl)
},
contentPadding = PaddingValues(horizontal = Margin.Medium),
shape = RectangleShape,
) {
Expand Down
2 changes: 2 additions & 0 deletions gradle/core.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ androidxCore = "1.16.0" # TODO: Update to 1.17.0 or later after we bump compileS
appUpdateVersion = "2.1.0"
appcompat = "1.7.1"
biometricKtx = "1.2.0-alpha05"
browser = "1.10.0"
coil = "3.3.0"
coil2 = "2.7.0" # Coil2 is used in old Legacy modules only
composeBom = "2025.12.00"
Expand Down Expand Up @@ -66,6 +67,7 @@ android-login = { module = "com.github.infomaniak:android-login", version.ref =
androidx-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version.ref = "adaptive" }
androidx-adaptive-layout = { module = "androidx.compose.material3.adaptive:adaptive-layout", version.ref = "adaptive" }
androidx-adaptive-navigation = { module = "androidx.compose.material3.adaptive:adaptive-navigation", version.ref = "adaptive" }
androidx-browser = { module = "androidx.browser:browser", version.ref = "browser" }
androidx-collection = { module = "androidx.collection:collection", version.ref = "androidxCollection" }
androidx-concurrent-futures-ktx = { module = "androidx.concurrent:concurrent-futures-ktx", version.ref = "concurrentFuturesKtx" }
androidx-core = { module = "androidx.core:core", version.ref = "androidxCore" }
Expand Down
Loading