mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 15:37:01 +05:30
common: add UrlLauncher
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
a5473af699
commit
b166755afa
5 changed files with 40 additions and 1 deletions
|
@ -0,0 +1,17 @@
|
|||
package dev.msfjarvis.claw.common.urllauncher
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
|
||||
actual class UrlLauncher(private val context: Context) {
|
||||
actual fun launch(url: String) {
|
||||
val customTabsIntent =
|
||||
CustomTabsIntent.Builder()
|
||||
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
|
||||
.setShowTitle(true)
|
||||
.setColorScheme(CustomTabsIntent.COLOR_SCHEME_DARK)
|
||||
.build()
|
||||
customTabsIntent.launchUrl(context, Uri.parse(url))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue