Skip to content

Commit 4d9ec93

Browse files
authored
Merge pull request #175 from m1ga/master
feat(android): update library
2 parents 8a1cc9d + 09885eb commit 4d9ec93

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
dependencies {
3-
implementation 'androidx.browser:browser:1.2.0'
3+
implementation 'androidx.browser:browser:1.4.0'
44
}

android/manifest

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# this is your module manifest and used by Titanium
33
# during compilation, packaging, distribution, etc.
44
#
5-
version: 2.0.0
5+
version: 2.1.0
66
apiversion: 4
77
architectures: arm64-v8a armeabi-v7a x86 x86_64
88
description: titanium-web-dialog

android/src/ti/webdialog/TitaniumWebDialogModule.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import android.graphics.drawable.Drawable;
1818
import android.net.Uri;
1919
import android.util.DisplayMetrics;
20+
import androidx.browser.customtabs.CustomTabColorSchemeParams;
2021
import androidx.browser.customtabs.CustomTabsIntent;
2122
import androidx.browser.customtabs.CustomTabsService;
2223
import java.util.ArrayList;
@@ -65,7 +66,9 @@ private void openCustomTab(Context context, List<String> customTabBrowsers, Krol
6566

6667
int barColor = Utils.getColor(options, Params.BAR_COLOR);
6768
if (barColor != -1) {
68-
builder.setToolbarColor(barColor);
69+
CustomTabColorSchemeParams params =
70+
new CustomTabColorSchemeParams.Builder().setToolbarColor(barColor).build();
71+
builder.setDefaultColorSchemeParams(params);
6972
}
7073

7174
// set start and exit animations
@@ -76,12 +79,12 @@ private void openCustomTab(Context context, List<String> customTabBrowsers, Krol
7679

7780
// hide navigation bar on scroll
7881
if (Utils.getBool(options, Params.BAR_COLLAPSING_ENABLED)) {
79-
builder.enableUrlBarHiding();
82+
builder.setUrlBarHidingEnabled(true);
8083
}
8184

8285
//enable Share link option
8386
if (Utils.getBool(options, Params.ENABLE_SHARING)) {
84-
builder.addDefaultShareMenuItem();
87+
builder.setShareState(CustomTabsIntent.SHARE_STATE_ON);
8588
}
8689

8790
String closeIcon = Utils.getString(options, Params.CLOSE_ICON);

android/src/ti/webdialog/Utils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static int[] getStyleableIntArray(String packageName, String name)
4747
// return the list of all available & enabled browsers in device
4848
public static List<ResolveInfo> allBrowsers(Context context)
4949
{
50-
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.testingurl.com"));
50+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://localhost"));
5151
return context.getPackageManager().queryIntentActivities(intent, 0);
5252
}
5353

android/timodule.xml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ti:module xmlns:ti="http://ti.appcelerator.org" xmlns:android="http://schemas.android.com/apk/res/android">
3-
<!--
4-
Similar to tiapp.xml, but contains module/platform specific
5-
configuration in <iphone>, <android>, and <mobileweb> sections
6-
-->
7-
<iphone>
8-
</iphone>
3+
<!-- Similar to tiapp.xml, but contains module/platform specific configuration in <iphone>, <android>, and <mobileweb> sections -->
4+
<iphone></iphone>
95
<android xmlns:android="http://schemas.android.com/apk/res/android">
6+
<manifest>
7+
<queries>
8+
<intent>
9+
<action android:name="android.intent.action.VIEW"/>
10+
<data android:scheme="http"/>
11+
</intent>
12+
</queries>
13+
</manifest>
1014
</android>
1115
</ti:module>

0 commit comments

Comments
 (0)