Skip to content

Commit 9072e52

Browse files
Merge pull request #14 from ewanharris/MOD-2562
feat(android): support passing intent flags
2 parents 979ca7a + 953523e commit 9072e52

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

android/src/ti/webdialog/Params.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ public class Params
1010
public static final String ENABLE_SHARING = "enableSharing";
1111
public static final String CLOSE_ICON = "closeIcon";
1212
public static final String BAR_COLLAPSING_ENABLED = "barCollapsingEnabled";
13+
public static final String INTENT_FLAGS = "intentFlags";
1314
}

android/src/ti/webdialog/TitaniumWebDialogModule.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ private void openCustomTab(Context context, List<String> customTabBrowsers, Krol
9393

9494
CustomTabsIntent tabIntent = builder.build();
9595

96+
if (options.containsKeyAndNotNull(Params.INTENT_FLAGS)) {
97+
tabIntent.intent.addFlags(options.getInt(Params.INTENT_FLAGS));
98+
}
99+
96100
for (String s : customTabBrowsers) {
97101
tabIntent.intent.setPackage(s);
98102
}

apidoc/WebDialog.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ events:
149149

150150
---
151151
name: WebDialogOpenParams
152-
summary: Parmaters used in the <Modules.WebDialog.open> method
152+
summary: Parameters used in the <Modules.WebDialog.open> method
153153
properties:
154154
- name: url
155155
summary: The URL to be opened.
@@ -197,3 +197,10 @@ properties:
197197
default: true
198198
type: Boolean
199199
platforms: [iphone, ipad, android]
200+
201+
- name: intentFlags
202+
summary: Intent flags to be used for the Chrome Custom Tab, specified as a Bitwise-OR
203+
optional: true
204+
type: Number
205+
constants: Titanium.Android.FLAG_*
206+
platform: [android]

0 commit comments

Comments
 (0)