From 2212b0955c2a8cadff96ea6d23a604dd7bc73521 Mon Sep 17 00:00:00 2001 From: m1ga Date: Fri, 19 Nov 2021 12:35:54 +0100 Subject: [PATCH 1/3] feat(android): update library --- android/build.gradle | 2 +- android/manifest | 2 +- android/src/ti/webdialog/TitaniumWebDialogModule.java | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) 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..ae1234e 100644 --- a/android/src/ti/webdialog/TitaniumWebDialogModule.java +++ b/android/src/ti/webdialog/TitaniumWebDialogModule.java @@ -17,6 +17,8 @@ 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 +67,10 @@ 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 +81,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); From 2852b3879b4a048e3f3600af40571a33910371df Mon Sep 17 00:00:00 2001 From: m1ga Date: Fri, 19 Nov 2021 14:30:16 +0100 Subject: [PATCH 2/3] lint --- android/src/ti/webdialog/TitaniumWebDialogModule.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/android/src/ti/webdialog/TitaniumWebDialogModule.java b/android/src/ti/webdialog/TitaniumWebDialogModule.java index ae1234e..f52dcd6 100644 --- a/android/src/ti/webdialog/TitaniumWebDialogModule.java +++ b/android/src/ti/webdialog/TitaniumWebDialogModule.java @@ -17,7 +17,6 @@ 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; @@ -67,9 +66,8 @@ private void openCustomTab(Context context, List customTabBrowsers, Krol int barColor = Utils.getColor(options, Params.BAR_COLOR); if (barColor != -1) { - CustomTabColorSchemeParams params = new CustomTabColorSchemeParams.Builder() - .setToolbarColor(barColor) - .build(); + CustomTabColorSchemeParams params = + new CustomTabColorSchemeParams.Builder().setToolbarColor(barColor).build(); builder.setDefaultColorSchemeParams(params); } From 09885ebcab0b36c09d1e5150abd8f934745f76e3 Mon Sep 17 00:00:00 2001 From: m1ga Date: Tue, 23 Nov 2021 11:48:37 +0100 Subject: [PATCH 3/3] android 12 queries --- android/src/ti/webdialog/Utils.java | 2 +- android/timodule.xml | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) 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 @@ - - - + + + + + + + + + +