Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB 2906 Stop fullscreen translucent theme for modal activities. #126

Merged
merged 3 commits into from
Jun 20, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions android/modules/ui/src/ti/modules/titanium/ui/TiUIWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,11 @@ protected Intent createIntent(Activity activity)
}
props = resolver.findProperty(TiC.PROPERTY_MODAL);
if (props != null && props.containsKey(TiC.PROPERTY_MODAL)) {
intent.setClass(activity, TiModalActivity.class);
intent.putExtra(TiC.PROPERTY_MODAL, TiConvert.toBoolean(props, TiC.PROPERTY_MODAL));
boolean modal = TiConvert.toBoolean(props, TiC.PROPERTY_MODAL);
intent.putExtra(TiC.PROPERTY_MODAL, modal);
if (modal) {
intent.setClass(activity, TiModalActivity.class);
}
}
props = resolver.findProperty(TiC.PROPERTY_URL);
if (props != null && props.containsKey(TiC.PROPERTY_URL)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,11 @@ protected void windowCreated()
int softInputMode = getIntentInt(TiC.PROPERTY_WINDOW_SOFT_INPUT_MODE, -1);
boolean hasSoftInputMode = softInputMode != -1;

if (!modal) {
setFullscreen(fullscreen);
setNavBarHidden(navBarHidden);
} else {
int flags = WindowManager.LayoutParams.FLAG_BLUR_BEHIND;
getWindow().setFlags(flags, flags);
setFullscreen(fullscreen);
setNavBarHidden(navBarHidden);
if (modal) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}

if (hasSoftInputMode) {
Expand Down
7 changes: 6 additions & 1 deletion apidoc/Titanium/UI/Window.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ properties:
platforms: [iphone, ipad]
type: Object
- name: modal
description: boolean to indicate if the window should be opened modal in front of other windows
description: |
boolean to indicate if the window should be opened modal in front of other windows. Android note: the
combination of `fullscreen:true` and `modal:true` will not work as expected. Android modal windows are translucent,
and, in Android, the contents of a translucent window cannot appear above the status bar. I.e., even though
you say `fullscreen:true`, the status bar will still be visible *if* it was visible in the previous window. `navBarHidden` and
`modal` do work fine together, however.
type: Boolean
default: false
- name: navBarHidden
Expand Down
2 changes: 1 addition & 1 deletion support/android/templates/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/>
<activity android:name="org.appcelerator.titanium.TiModalActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:theme="@android:style/Theme.Translucent"
/>
<activity android:name="ti.modules.titanium.ui.TiTabActivity"
android:configChanges="keyboardHidden|orientation"
Expand Down