Skip to content

Commit 3e1fcd6

Browse files
committed
Adapt hide functionality for Android from PR EddyVerbruggen#176
EddyVerbruggen#176
1 parent fb1f70d commit 3e1fcd6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/android/ChromeCustomTabPlugin.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
8888
callbackContext.sendPluginResult(pluginResult);
8989
return true;
9090
}
91+
case "hide": {
92+
this.hide();
93+
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, true));
94+
return true;
95+
}
9196
case "getViewHandlerPackages": {
9297
PluginResult pluginResult;
9398
final JSONObject result = new JSONObject();
@@ -166,6 +171,10 @@ private void show(String url, @ColorInt int toolbarColor, boolean showDefaultSha
166171
startCustomTabActivity(url, customTabsIntent.intent);
167172
}
168173

174+
private void hide() {
175+
cordova.getActivity().startActivity(new Intent(cordova.getActivity(), cordova.getActivity().getClass()));
176+
}
177+
169178
private void addTransition(CustomTabsIntent.Builder builder, String transition) {
170179
final String animType = "anim";
171180
switch (transition){

0 commit comments

Comments
 (0)