Skip to content

Commit

Permalink
Merge pull request #14 from ewanharris/MOD-2562
Browse files Browse the repository at this point in the history
feat(android): support passing intent flags
  • Loading branch information
prashantsaini1 authored Jan 8, 2020
2 parents 979ca7a + 953523e commit 9072e52
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions android/src/ti/webdialog/Params.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ public class Params
public static final String ENABLE_SHARING = "enableSharing";
public static final String CLOSE_ICON = "closeIcon";
public static final String BAR_COLLAPSING_ENABLED = "barCollapsingEnabled";
public static final String INTENT_FLAGS = "intentFlags";
}
4 changes: 4 additions & 0 deletions android/src/ti/webdialog/TitaniumWebDialogModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ private void openCustomTab(Context context, List<String> customTabBrowsers, Krol

CustomTabsIntent tabIntent = builder.build();

if (options.containsKeyAndNotNull(Params.INTENT_FLAGS)) {
tabIntent.intent.addFlags(options.getInt(Params.INTENT_FLAGS));
}

for (String s : customTabBrowsers) {
tabIntent.intent.setPackage(s);
}
Expand Down
9 changes: 8 additions & 1 deletion apidoc/WebDialog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ events:

---
name: WebDialogOpenParams
summary: Parmaters used in the <Modules.WebDialog.open> method
summary: Parameters used in the <Modules.WebDialog.open> method
properties:
- name: url
summary: The URL to be opened.
Expand Down Expand Up @@ -197,3 +197,10 @@ properties:
default: true
type: Boolean
platforms: [iphone, ipad, android]

- name: intentFlags
summary: Intent flags to be used for the Chrome Custom Tab, specified as a Bitwise-OR
optional: true
type: Number
constants: Titanium.Android.FLAG_*
platform: [android]

0 comments on commit 9072e52

Please sign in to comment.