17
17
import android .graphics .drawable .Drawable ;
18
18
import android .net .Uri ;
19
19
import android .util .DisplayMetrics ;
20
+ import androidx .browser .customtabs .CustomTabColorSchemeParams ;
20
21
import androidx .browser .customtabs .CustomTabsIntent ;
21
22
import androidx .browser .customtabs .CustomTabsService ;
22
23
import java .util .ArrayList ;
@@ -65,7 +66,9 @@ private void openCustomTab(Context context, List<String> customTabBrowsers, Krol
65
66
66
67
int barColor = Utils .getColor (options , Params .BAR_COLOR );
67
68
if (barColor != -1 ) {
68
- builder .setToolbarColor (barColor );
69
+ CustomTabColorSchemeParams params =
70
+ new CustomTabColorSchemeParams .Builder ().setToolbarColor (barColor ).build ();
71
+ builder .setDefaultColorSchemeParams (params );
69
72
}
70
73
71
74
// set start and exit animations
@@ -76,12 +79,12 @@ private void openCustomTab(Context context, List<String> customTabBrowsers, Krol
76
79
77
80
// hide navigation bar on scroll
78
81
if (Utils .getBool (options , Params .BAR_COLLAPSING_ENABLED )) {
79
- builder .enableUrlBarHiding ( );
82
+ builder .setUrlBarHidingEnabled ( true );
80
83
}
81
84
82
85
//enable Share link option
83
86
if (Utils .getBool (options , Params .ENABLE_SHARING )) {
84
- builder .addDefaultShareMenuItem ( );
87
+ builder .setShareState ( CustomTabsIntent . SHARE_STATE_ON );
85
88
}
86
89
87
90
String closeIcon = Utils .getString (options , Params .CLOSE_ICON );
0 commit comments