browser-ktx

Kotlin extensions for the AndroidX Browser artifact.

Usage

Browser KTX on Maven Central

Browser KTX is available on Maven Central as the Maven coordinate io.github.edricchan03.androidx.browser:browser-ktx:

settings.gradle.kts:

dependencyResolutionManagement {
// ...
repositories {
mavenCentral()
}
}

Kotlin/Groovy

implementation("io.github.edricchan03.androidx.browser:browser-ktx:0.2.0")

TOML

gradle/libs.versions.toml:

[libaries]
androidxtra-browser-ktx = "io.github.edricchan03.androidx.browser:browser-ktx:0.2.0"

build.gradle.kts:

implementation(libs.androidxtra.browser.ktx)

Snapshots

Browser KTX on Maven Central (snapshot)

Alternatively, you can grab the latest built snapshot from Maven Central's snapshots repository:

settings.gradle.kts

dependencyResolutionManagement {
// ...
repositories {
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
// Optionally, you can specify that only snapshots are to be used
mavenContent {
snapshotsOnly()
}
}
}
}

Kotlin

build.gradle.kts:

implementation("io.github.edricchan03.androidx.browser:browser-ktx:0.2.1-SNAPSHOT")

TOML

gradle/libs.versions.toml:

[libaries]
androidxtra-browser-ktx = "io.github.edricchan03.androidx.browser:browser-ktx:0.2.1-SNAPSHOT"

build.gradle.kts:

implementation(libs.androidxtra.browser.ktx)

Available extensions

Currently, the following extension functions are available for the CustomTabsIntent.Builder:

Enum variants

The following extension functions have been added in place of their integer enum-like equivalent setters:

Extension functionEnumJava equivalent
setShareStateShareStateLink
setColorSchemeColorSchemeLink
setInitialActivityHeightPxActivityHeightResizeBehaviorLink
setCloseButtonPositionCloseButtonPositionLink

Packages

Top-level Kotlin extensions for AndroidX Browser.

Enums for CustomTabsIntent.Builder extension functions which accept their enum variants: