File tree Expand file tree Collapse file tree 7 files changed +56
-2
lines changed
sentry-samples/sentry-samples-android
java/io/sentry/samples/android Expand file tree Collapse file tree 7 files changed +56
-2
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ androidx-navigation-runtime = { module = "androidx.navigation:navigation-runtime
9191androidx-navigation-compose = { module = " androidx.navigation:navigation-compose" , version.ref = " androidxNavigation" }
9292androidx-sqlite = { module = " androidx.sqlite:sqlite" , version = " 2.5.2" }
9393androidx-recyclerview = { module = " androidx.recyclerview:recyclerview" , version = " 1.2.1" }
94+ androidx-browser = { module = " androidx.browser:browser" , version = " 1.8.0" }
9495coil-compose = { module = " io.coil-kt:coil-compose" , version = " 2.6.0" }
9596commons-compress = {module = " org.apache.commons:commons-compress" , version = " 1.25.0" }
9697context-propagation = { module = " io.micrometer:context-propagation" , version = " 1.1.0" }
Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ dependencies {
144144 implementation(libs.androidx.compose.material3)
145145 implementation(libs.androidx.navigation.compose)
146146 implementation(libs.androidx.recyclerview)
147+ implementation(libs.androidx.browser)
147148 implementation(libs.coil.compose)
148149 implementation(libs.kotlinx.coroutines.android)
149150 implementation(libs.retrofit)
Original file line number Diff line number Diff line change 6969 android : exported =" false" />
7070
7171 <activity
72- android : name =" .compose.ComposeActivity"
73- android : exported =" false" />
72+ android : name =" .CustomTabsActivity"
73+ android : exported =" false" />
74+
75+ <activity
76+ android : name =" .compose.ComposeActivity"
77+ android : exported =" false" />
7478
7579 <activity android : name =" .FrameDataForSpansActivity"
7680 android : exported =" false" />
Original file line number Diff line number Diff line change 1+ package io .sentry .samples .android ;
2+
3+ import android .net .Uri ;
4+ import android .os .Bundle ;
5+ import androidx .appcompat .app .AppCompatActivity ;
6+ import androidx .browser .customtabs .CustomTabColorSchemeParams ;
7+ import androidx .browser .customtabs .CustomTabsIntent ;
8+ import androidx .core .content .ContextCompat ;
9+
10+ public class CustomTabsActivity extends AppCompatActivity {
11+
12+ private static final String DEMO_URL = "https://www.sentry.io/" ;
13+
14+ @ Override
15+ protected void onCreate (Bundle savedInstanceState ) {
16+ super .onCreate (savedInstanceState );
17+
18+ CustomTabsIntent .Builder builder = new CustomTabsIntent .Builder ();
19+
20+ CustomTabColorSchemeParams params =
21+ new CustomTabColorSchemeParams .Builder ()
22+ .setToolbarColor (ContextCompat .getColor (this , R .color .colorPrimary ))
23+ .build ();
24+ builder .setDefaultColorSchemeParams (params );
25+
26+ builder .setShowTitle (true );
27+ builder .setShareState (CustomTabsIntent .SHARE_STATE_ON );
28+ builder .setInstantAppsEnabled (true );
29+
30+ CustomTabsIntent customTabsIntent = builder .build ();
31+ customTabsIntent .launchUrl (this , Uri .parse (DEMO_URL ));
32+
33+ finish ();
34+ }
35+ }
Original file line number Diff line number Diff line change @@ -272,6 +272,11 @@ public void run() {
272272 startActivity (new Intent (this , ProfilingActivity .class ));
273273 });
274274
275+ binding .openCustomTabsActivity .setOnClickListener (
276+ view -> {
277+ startActivity (new Intent (this , CustomTabsActivity .class ));
278+ });
279+
275280 binding .openFrameDataForSpans .setOnClickListener (
276281 view -> startActivity (new Intent (this , FrameDataForSpansActivity .class )));
277282
Original file line number Diff line number Diff line change 146146 android : layout_height =" wrap_content"
147147 android : text =" @string/open_profiling_activity" />
148148
149+ <Button
150+ android : id =" @+id/open_custom_tabs_activity"
151+ android : layout_width =" wrap_content"
152+ android : layout_height =" wrap_content"
153+ android : text =" @string/open_custom_tabs_activity"
154+ />
155+
149156 <Button
150157 android : id =" @+id/open_frame_data_for_spans"
151158 android : layout_width =" wrap_content"
Original file line number Diff line number Diff line change 2323 <string name =" open_permissions_activity" >Open Permissions Activity</string >
2424 <string name =" open_compose_activity" >Open Compose Activity</string >
2525 <string name =" open_profiling_activity" >Open Profiling Activity</string >
26+ <string name =" open_custom_tabs_activity" >Open Custom Tabs Activity</string >
2627 <string name =" open_frame_data_for_spans" >Open Frame Data for Spans Activity</string >
2728 <string name =" open_metrics" >Delightful Developer Metrics</string >
2829 <string name =" test_timber_integration" >Test Timber</string >
You can’t perform that action at this time.
0 commit comments