Skip to content

Commit

Permalink
Merge pull request #175 from m1ga/master
Browse files Browse the repository at this point in the history
feat(android): update library
  • Loading branch information
hansemannn authored Mar 27, 2022
2 parents 8a1cc9d + 09885eb commit 4d9ec93
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

dependencies {
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.browser:browser:1.4.0'
}
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions android/src/ti/webdialog/TitaniumWebDialogModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -65,7 +66,9 @@ private void openCustomTab(Context context, List<String> 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
Expand All @@ -76,12 +79,12 @@ private void openCustomTab(Context context, List<String> 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);
Expand Down
2 changes: 1 addition & 1 deletion android/src/ti/webdialog/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResolveInfo> 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);
}

Expand Down
16 changes: 10 additions & 6 deletions android/timodule.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<ti:module xmlns:ti="http://ti.appcelerator.org" xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Similar to tiapp.xml, but contains module/platform specific
configuration in <iphone>, <android>, and <mobileweb> sections
-->
<iphone>
</iphone>
<!-- Similar to tiapp.xml, but contains module/platform specific configuration in <iphone>, <android>, and <mobileweb> sections -->
<iphone></iphone>
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="http"/>
</intent>
</queries>
</manifest>
</android>
</ti:module>

0 comments on commit 4d9ec93

Please sign in to comment.