diff --git a/android/build.gradle b/android/build.gradle index 84ead16..056fcbb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,4 @@ dependencies { - implementation 'androidx.browser:browser:1.2.0' + implementation 'androidx.browser:browser:1.4.0' } diff --git a/android/manifest b/android/manifest index bb00efa..5d7cbb3 100644 --- a/android/manifest +++ b/android/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 2.0.0 +version: 2.1.0 apiversion: 4 architectures: arm64-v8a armeabi-v7a x86 x86_64 description: titanium-web-dialog diff --git a/android/src/ti/webdialog/TitaniumWebDialogModule.java b/android/src/ti/webdialog/TitaniumWebDialogModule.java index 74ff7ce..f52dcd6 100644 --- a/android/src/ti/webdialog/TitaniumWebDialogModule.java +++ b/android/src/ti/webdialog/TitaniumWebDialogModule.java @@ -17,6 +17,7 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.util.DisplayMetrics; +import androidx.browser.customtabs.CustomTabColorSchemeParams; import androidx.browser.customtabs.CustomTabsIntent; import androidx.browser.customtabs.CustomTabsService; import java.util.ArrayList; @@ -65,7 +66,9 @@ private void openCustomTab(Context context, List customTabBrowsers, Krol int barColor = Utils.getColor(options, Params.BAR_COLOR); if (barColor != -1) { - builder.setToolbarColor(barColor); + CustomTabColorSchemeParams params = + new CustomTabColorSchemeParams.Builder().setToolbarColor(barColor).build(); + builder.setDefaultColorSchemeParams(params); } // set start and exit animations @@ -76,12 +79,12 @@ private void openCustomTab(Context context, List customTabBrowsers, Krol // hide navigation bar on scroll if (Utils.getBool(options, Params.BAR_COLLAPSING_ENABLED)) { - builder.enableUrlBarHiding(); + builder.setUrlBarHidingEnabled(true); } //enable Share link option if (Utils.getBool(options, Params.ENABLE_SHARING)) { - builder.addDefaultShareMenuItem(); + builder.setShareState(CustomTabsIntent.SHARE_STATE_ON); } String closeIcon = Utils.getString(options, Params.CLOSE_ICON); diff --git a/android/src/ti/webdialog/Utils.java b/android/src/ti/webdialog/Utils.java index bbce173..d51494f 100644 --- a/android/src/ti/webdialog/Utils.java +++ b/android/src/ti/webdialog/Utils.java @@ -47,7 +47,7 @@ public static int[] getStyleableIntArray(String packageName, String name) // return the list of all available & enabled browsers in device public static List allBrowsers(Context context) { - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.testingurl.com")); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://localhost")); return context.getPackageManager().queryIntentActivities(intent, 0); } diff --git a/android/timodule.xml b/android/timodule.xml index 924a3c1..115443b 100755 --- a/android/timodule.xml +++ b/android/timodule.xml @@ -1,11 +1,15 @@ - - - + + + + + + + + + +