diff --git a/build.gradle b/build.gradle
index e8add7b3..9cd8b661 100644
--- a/build.gradle
+++ b/build.gradle
@@ -20,6 +20,9 @@ buildscript {
repositories {
google()
jcenter()
+ maven {
+ url = "https://androidx.dev/snapshots/builds/12711855/artifacts/repository"
+ }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.3'
@@ -31,6 +34,12 @@ allprojects {
google()
jcenter()
+ // AndroidX snapshots repository
+ maven {
+ url = "https://androidx.dev/snapshots/builds/12815573/artifacts/repository"
+ }
+
+ // Repository for DexMaker
maven {
url = "https://linkedin.jfrog.io/artifactory/open-source/"
content {
diff --git a/demos/custom-tabs-ephemeral/.gitignore b/demos/custom-tabs-ephemeral/.gitignore
new file mode 100644
index 00000000..a7747886
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/.gitignore
@@ -0,0 +1,2 @@
+/build
+
diff --git a/demos/custom-tabs-ephemeral/README.md b/demos/custom-tabs-ephemeral/README.md
new file mode 100644
index 00000000..edc6c902
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/README.md
@@ -0,0 +1,3 @@
+# Custom Tabs Ephemeral Demo
+
+This demo shows how to launch a Custom Tab with ephemeral browsing enabled.
\ No newline at end of file
diff --git a/demos/custom-tabs-ephemeral/build.gradle b/demos/custom-tabs-ephemeral/build.gradle
new file mode 100644
index 00000000..c11649a9
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/build.gradle
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+apply plugin: 'com.android.application'
+
+android {
+ namespace 'com.google.androidbrowserhelper.demos.customtabsephemeral'
+ compileSdkVersion 35
+ defaultConfig {
+ applicationId "com.google.androidbrowserhelper.demos.customtabsephemeral"
+ minSdkVersion 26
+ targetSdkVersion 35
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+}
+
+dependencies {
+ implementation project(path: ':androidbrowserhelper')
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+ implementation 'androidx.appcompat:appcompat:1.7.0'
+ implementation 'androidx.activity:activity:1.9.3'
+ implementation 'androidx.browser:browser:1.9.0-SNAPSHOT'
+ implementation 'com.google.android.material:material:1.12.0'
+ implementation 'androidx.annotation:annotation:1.9.1'
+ implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
+}
diff --git a/demos/custom-tabs-ephemeral/proguard-rules.pro b/demos/custom-tabs-ephemeral/proguard-rules.pro
new file mode 100644
index 00000000..cf504086
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/proguard-rules.pro
@@ -0,0 +1,22 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
+
diff --git a/demos/custom-tabs-ephemeral/src/main/AndroidManifest.xml b/demos/custom-tabs-ephemeral/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..94e67844
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/AndroidManifest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/java/com/google/androidbrowserhelper/demos/customtabsephemeral/MainActivity.java b/demos/custom-tabs-ephemeral/src/main/java/com/google/androidbrowserhelper/demos/customtabsephemeral/MainActivity.java
new file mode 100644
index 00000000..8308bd50
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/java/com/google/androidbrowserhelper/demos/customtabsephemeral/MainActivity.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.androidbrowserhelper.demos.customtabsephemeral;
+
+import androidx.annotation.OptIn;
+import androidx.browser.customtabs.CustomTabsIntent;
+import androidx.browser.customtabs.ExperimentalEphemeralBrowsing;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.widget.Button;
+
+public class MainActivity extends Activity {
+ private static final Uri URL = Uri.parse("https://xchrdw.github.io/browsing-data/siteDataTester.html");
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ Button mLaunchButton = findViewById(R.id.launch);
+ mLaunchButton.setOnClickListener(view -> {
+ launchTab();
+ });
+ }
+
+ @OptIn(markerClass = ExperimentalEphemeralBrowsing.class)
+ private void launchTab() {
+ Intent customTabsIntent = new CustomTabsIntent.Builder()
+ .setEphemeralBrowsingEnabled(true)
+ .build()
+ .intent;
+ customTabsIntent.setData(URL);
+ startActivity(customTabsIntent);
+ }
+}
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/drawable-anydpi/ic_notification_icon.xml b/demos/custom-tabs-ephemeral/src/main/res/drawable-anydpi/ic_notification_icon.xml
new file mode 100644
index 00000000..4c5c8a73
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/drawable-anydpi/ic_notification_icon.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/drawable-v24/ic_launcher_foreground.xml b/demos/custom-tabs-ephemeral/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..5a8f0381
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/drawable/ic_launcher_background.xml b/demos/custom-tabs-ephemeral/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..7806d1dc
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/layout/activity_main.xml b/demos/custom-tabs-ephemeral/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..6876cae7
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/layout/activity_main.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/demos/custom-tabs-ephemeral/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..4a757b27
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/demos/custom-tabs-ephemeral/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..4a757b27
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-hdpi/ic_launcher.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..a571e600
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-hdpi/ic_launcher_round.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..61da551c
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-mdpi/ic_launcher.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..c41dd285
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-mdpi/ic_launcher_round.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..db5080a7
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-xhdpi/ic_launcher.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..6dba46da
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..da31a871
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxhdpi/ic_launcher.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..15ac6817
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..b216f2d3
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..f25a4197
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..e96783cc
Binary files /dev/null and b/demos/custom-tabs-ephemeral/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/demos/custom-tabs-ephemeral/src/main/res/values/colors.xml b/demos/custom-tabs-ephemeral/src/main/res/values/colors.xml
new file mode 100644
index 00000000..ac2bf97a
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/values/colors.xml
@@ -0,0 +1,19 @@
+
+
+
+ #6200EE
+ #3700B3
+ #03DAC5
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/values/strings.xml b/demos/custom-tabs-ephemeral/src/main/res/values/strings.xml
new file mode 100644
index 00000000..aa04e69d
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/values/strings.xml
@@ -0,0 +1,17 @@
+
+
+ Custom Tab Ephemeral Demo
+ Launch
+
+
diff --git a/demos/custom-tabs-ephemeral/src/main/res/values/styles.xml b/demos/custom-tabs-ephemeral/src/main/res/values/styles.xml
new file mode 100644
index 00000000..643c7ae8
--- /dev/null
+++ b/demos/custom-tabs-ephemeral/src/main/res/values/styles.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
diff --git a/settings.gradle b/settings.gradle
index d798a741..895d83e5 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -6,6 +6,7 @@ include ':demos:custom-tabs-example-app'
include ':demos:custom-tabs-headers'
include ':demos:custom-tabs-navigation-callbacks'
include ':demos:custom-tabs-oauth'
+include ':demos:custom-tabs-ephemeral'
include ':demos:custom-tabs-session'
include ':demos:twa-basic'
include ':demos:twa-custom-launcher'