Skip to content

Commit

Permalink
feat(android): add constant Ti.UI.Android.FLAG_LAYOUT_NO_LIMITS (#12809)
Browse files Browse the repository at this point in the history
Fixes TIMOB-28445
  • Loading branch information
jquick-axway authored Aug 18, 2021
1 parent 9363c42 commit 386c5cf
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public class AndroidModule extends KrollModule
{
private static final String TAG = "UIAndroidModule";

@Kroll.constant
public static final int FLAG_LAYOUT_NO_LIMITS = WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;

@Kroll.constant
public static final int FLAG_TRANSLUCENT_NAVIGATION = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
@Kroll.constant
Expand Down
17 changes: 17 additions & 0 deletions apidoc/Titanium/UI/Android/Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,23 @@ methods:
since: "9.1.0"

properties:
- name: FLAG_LAYOUT_NO_LIMITS
summary: Flag allowing window to extend into the status bar and navigation bar.
description: |
When assigned to [Window.windowFlags](Titanium.UI.Window.windowFlags), this flag will make the
window ignore the system's insets such as the top status bar and bottom navigation bar so that
they overlap the window. The system may make the status bar and navigation bar completely transparent,
but this behavior is not guaranteed to happen.
When using this flag, it's also recommended to set the
[Window.extendSafeArea](Titanium.UI.Window.extendSafeArea) property to `true`.
Warning: Using this flag causes [Window.safeAreaPadding](Titanium.UI.Window.safeAreaPadding)
to return all zeros. This flag also breaks keyboard `adjustPan` support.
type: Number
permission: read-only
since: "10.1.0"

- name: FLAG_TRANSLUCENT_NAVIGATION
summary: Window flag which makes the Android system's navigation bar semi-transparent.
description: |
Expand Down
262 changes: 262 additions & 0 deletions tests/Resources/ti.ui.android.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,266 @@ describe.android('Titanium.UI.Android', () => {
should.not.exist(result);
});
});

describe('constants', () => {
it('FLAG_LAYOUT_NO_LIMITS', () => {
should(Ti.UI.Android).have.constant('FLAG_LAYOUT_NO_LIMITS').which.is.a.Number();
});

it('FLAG_TRANSLUCENT_NAVIGATION', () => {
should(Ti.UI.Android).have.constant('FLAG_TRANSLUCENT_NAVIGATION').which.is.a.Number();
});
it('FLAG_TRANSLUCENT_STATUS', () => {
should(Ti.UI.Android).have.constant('FLAG_TRANSLUCENT_STATUS').which.is.a.Number();
});

it('GRAVITY_AXIS_CLIP', () => {
should(Ti.UI.Android).have.constant('GRAVITY_AXIS_CLIP').which.is.a.Number();
});
it('GRAVITY_AXIS_PULL_AFTER', () => {
should(Ti.UI.Android).have.constant('GRAVITY_AXIS_PULL_AFTER').which.is.a.Number();
});
it('GRAVITY_AXIS_PULL_BEFORE', () => {
should(Ti.UI.Android).have.constant('GRAVITY_AXIS_PULL_BEFORE').which.is.a.Number();
});
it('GRAVITY_AXIS_SPECIFIED', () => {
should(Ti.UI.Android).have.constant('GRAVITY_AXIS_SPECIFIED').which.is.a.Number();
});
it('GRAVITY_AXIS_X_SHIFT', () => {
should(Ti.UI.Android).have.constant('GRAVITY_AXIS_X_SHIFT').which.is.a.Number();
});
it('GRAVITY_AXIS_Y_SHIFT', () => {
should(Ti.UI.Android).have.constant('GRAVITY_AXIS_Y_SHIFT').which.is.a.Number();
});
it('GRAVITY_BOTTOM', () => {
should(Ti.UI.Android).have.constant('GRAVITY_BOTTOM').which.is.a.Number();
});
it('GRAVITY_CENTER', () => {
should(Ti.UI.Android).have.constant('GRAVITY_CENTER').which.is.a.Number();
});
it('GRAVITY_CENTER_HORIZONTAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_CENTER_HORIZONTAL').which.is.a.Number();
});
it('GRAVITY_CENTER_VERTICAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_CENTER_VERTICAL').which.is.a.Number();
});
it('GRAVITY_CLIP_HORIZONTAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_CLIP_HORIZONTAL').which.is.a.Number();
});
it('GRAVITY_CLIP_VERTICAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_CLIP_VERTICAL').which.is.a.Number();
});
it('GRAVITY_DISPLAY_CLIP_HORIZONTAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_DISPLAY_CLIP_HORIZONTAL').which.is.a.Number();
});
it('GRAVITY_DISPLAY_CLIP_VERTICAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_DISPLAY_CLIP_VERTICAL').which.is.a.Number();
});
it('GRAVITY_END', () => {
should(Ti.UI.Android).have.constant('GRAVITY_END').which.is.a.Number();
});
it('GRAVITY_FILL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_FILL').which.is.a.Number();
});
it('GRAVITY_FILL_HORIZONTAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_FILL_HORIZONTAL').which.is.a.Number();
});
it('GRAVITY_FILL_VERTICAL', () => {
should(Ti.UI.Android).have.constant('GRAVITY_FILL_VERTICAL').which.is.a.Number();
});
it('GRAVITY_HORIZONTAL_GRAVITY_MASK', () => {
should(Ti.UI.Android).have.constant('GRAVITY_HORIZONTAL_GRAVITY_MASK').which.is.a.Number();
});
it('GRAVITY_LEFT', () => {
should(Ti.UI.Android).have.constant('GRAVITY_LEFT').which.is.a.Number();
});
it('GRAVITY_NO_GRAVITY', () => {
should(Ti.UI.Android).have.constant('GRAVITY_NO_GRAVITY').which.is.a.Number();
});
it('GRAVITY_RELATIVE_HORIZONTAL_GRAVITY_MASK', () => {
should(Ti.UI.Android).have.constant('GRAVITY_RELATIVE_HORIZONTAL_GRAVITY_MASK').which.is.a.Number();
});
it('GRAVITY_RELATIVE_LAYOUT_DIRECTION', () => {
should(Ti.UI.Android).have.constant('GRAVITY_RELATIVE_LAYOUT_DIRECTION').which.is.a.Number();
});
it('GRAVITY_RIGHT', () => {
should(Ti.UI.Android).have.constant('GRAVITY_RIGHT').which.is.a.Number();
});
it('GRAVITY_START', () => {
should(Ti.UI.Android).have.constant('GRAVITY_START').which.is.a.Number();
});
it('GRAVITY_TOP', () => {
should(Ti.UI.Android).have.constant('GRAVITY_TOP').which.is.a.Number();
});
it('GRAVITY_VERTICAL_GRAVITY_MASK', () => {
should(Ti.UI.Android).have.constant('GRAVITY_VERTICAL_GRAVITY_MASK').which.is.a.Number();
});

it('OVER_SCROLL_ALWAYS', () => {
should(Ti.UI.Android).have.constant('OVER_SCROLL_ALWAYS').which.is.a.Number();
});
it('OVER_SCROLL_IF_CONTENT_SCROLLS', () => {
should(Ti.UI.Android).have.constant('OVER_SCROLL_IF_CONTENT_SCROLLS').which.is.a.Number();
});
it('OVER_SCROLL_NEVER', () => {
should(Ti.UI.Android).have.constant('OVER_SCROLL_NEVER').which.is.a.Number();
});

it('PIXEL_FORMAT_A_8', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_A_8').which.is.a.Number();
});
it('PIXEL_FORMAT_L_8', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_L_8').which.is.a.Number();
});
it('PIXEL_FORMAT_LA_88', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_LA_88').which.is.a.Number();
});
it('PIXEL_FORMAT_OPAQUE', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_OPAQUE').which.is.a.Number();
});
it('PIXEL_FORMAT_RGB_332', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_RGB_332').which.is.a.Number();
});
it('PIXEL_FORMAT_RGB_565', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_RGB_565').which.is.a.Number();
});
it('PIXEL_FORMAT_RGB_888', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_RGB_888').which.is.a.Number();
});
it('PIXEL_FORMAT_RGBA_4444', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_RGBA_4444').which.is.a.Number();
});
it('PIXEL_FORMAT_RGBA_5551', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_RGBA_5551').which.is.a.Number();
});
it('PIXEL_FORMAT_RGBA_8888', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_RGBA_8888').which.is.a.Number();
});
it('PIXEL_FORMAT_RGBX_8888', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_RGBX_8888').which.is.a.Number();
});
it('PIXEL_FORMAT_TRANSLUCENT', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_TRANSLUCENT').which.is.a.Number();
});
it('PIXEL_FORMAT_TRANSPARENT', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_TRANSPARENT').which.is.a.Number();
});
it('PIXEL_FORMAT_UNKNOWN', () => {
should(Ti.UI.Android).have.constant('PIXEL_FORMAT_UNKNOWN').which.is.a.Number();
});

it('PROGRESS_INDICATOR_DETERMINANT', () => {
should(Ti.UI.Android).have.constant('PROGRESS_INDICATOR_DETERMINANT').which.is.a.Number();
});
it('PROGRESS_INDICATOR_DIALOG', () => {
should(Ti.UI.Android).have.constant('PROGRESS_INDICATOR_DIALOG').which.is.a.Number();
});
it('PROGRESS_INDICATOR_INDETERMINANT', () => {
should(Ti.UI.Android).have.constant('PROGRESS_INDICATOR_INDETERMINANT').which.is.a.Number();
});
it('PROGRESS_INDICATOR_STATUS_BAR', () => {
should(Ti.UI.Android).have.constant('PROGRESS_INDICATOR_STATUS_BAR').which.is.a.Number();
});

it('SOFT_INPUT_ADJUST_PAN', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_ADJUST_PAN').which.is.a.Number();
});
it('SOFT_INPUT_ADJUST_RESIZE', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_ADJUST_RESIZE').which.is.a.Number();
});
it('SOFT_INPUT_ADJUST_UNSPECIFIED', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_ADJUST_UNSPECIFIED').which.is.a.Number();
});
it('SOFT_INPUT_STATE_ALWAYS_HIDDEN', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_STATE_ALWAYS_HIDDEN').which.is.a.Number();
});
it('SOFT_INPUT_STATE_ALWAYS_VISIBLE', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_STATE_ALWAYS_VISIBLE').which.is.a.Number();
});
it('SOFT_INPUT_STATE_HIDDEN', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_STATE_HIDDEN').which.is.a.Number();
});
it('SOFT_INPUT_STATE_UNSPECIFIED', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_STATE_UNSPECIFIED').which.is.a.Number();
});
it('SOFT_INPUT_STATE_VISIBLE', () => {
should(Ti.UI.Android).have.constant('SOFT_INPUT_STATE_VISIBLE').which.is.a.Number();
});

it('SOFT_KEYBOARD_DEFAULT_ON_FOCUS', () => {
should(Ti.UI.Android).have.constant('SOFT_KEYBOARD_DEFAULT_ON_FOCUS').which.is.a.Number();
});
it('SOFT_KEYBOARD_HIDE_ON_FOCUS', () => {
should(Ti.UI.Android).have.constant('SOFT_KEYBOARD_HIDE_ON_FOCUS').which.is.a.Number();
});
it('SOFT_KEYBOARD_SHOW_ON_FOCUS', () => {
should(Ti.UI.Android).have.constant('SOFT_KEYBOARD_SHOW_ON_FOCUS').which.is.a.Number();
});

it('TABS_STYLE_BOTTOM_NAVIGATION', () => {
should(Ti.UI.Android).have.constant('TABS_STYLE_BOTTOM_NAVIGATION').which.is.a.Number();
});
it('TABS_STYLE_DEFAULT', () => {
should(Ti.UI.Android).have.constant('TABS_STYLE_DEFAULT').which.is.a.Number();
});

it('TRANSITION_CHANGE_BOUNDS', () => {
should(Ti.UI.Android).have.constant('TRANSITION_CHANGE_BOUNDS').which.is.a.Number();
});
it('TRANSITION_CHANGE_CLIP_BOUNDS', () => {
should(Ti.UI.Android).have.constant('TRANSITION_CHANGE_CLIP_BOUNDS').which.is.a.Number();
});
it('TRANSITION_CHANGE_IMAGE_TRANSFORM', () => {
should(Ti.UI.Android).have.constant('TRANSITION_CHANGE_IMAGE_TRANSFORM').which.is.a.Number();
});
it('TRANSITION_CHANGE_TRANSFORM', () => {
should(Ti.UI.Android).have.constant('TRANSITION_CHANGE_TRANSFORM').which.is.a.Number();
});
it('TRANSITION_EXPLODE', () => {
should(Ti.UI.Android).have.constant('TRANSITION_EXPLODE').which.is.a.Number();
});
it('TRANSITION_FADE_IN', () => {
should(Ti.UI.Android).have.constant('TRANSITION_FADE_IN').which.is.a.Number();
});
it('TRANSITION_FADE_OUT', () => {
should(Ti.UI.Android).have.constant('TRANSITION_FADE_OUT').which.is.a.Number();
});
it('TRANSITION_NONE', () => {
should(Ti.UI.Android).have.constant('TRANSITION_NONE').which.is.a.Number();
});
it('TRANSITION_SLIDE_BOTTOM', () => {
should(Ti.UI.Android).have.constant('TRANSITION_SLIDE_BOTTOM').which.is.a.Number();
});
it('TRANSITION_SLIDE_LEFT', () => {
should(Ti.UI.Android).have.constant('TRANSITION_SLIDE_LEFT').which.is.a.Number();
});
it('TRANSITION_SLIDE_RIGHT', () => {
should(Ti.UI.Android).have.constant('TRANSITION_SLIDE_RIGHT').which.is.a.Number();
});
it('TRANSITION_SLIDE_TOP', () => {
should(Ti.UI.Android).have.constant('TRANSITION_SLIDE_TOP').which.is.a.Number();
});

it('WEBVIEW_LOAD_CACHE_ELSE_NETWORK', () => {
should(Ti.UI.Android).have.constant('WEBVIEW_LOAD_CACHE_ELSE_NETWORK').which.is.a.Number();
});
it('WEBVIEW_LOAD_CACHE_ONLY', () => {
should(Ti.UI.Android).have.constant('WEBVIEW_LOAD_CACHE_ONLY').which.is.a.Number();
});
it('WEBVIEW_LOAD_DEFAULT', () => {
should(Ti.UI.Android).have.constant('WEBVIEW_LOAD_DEFAULT').which.is.a.Number();
});
it('WEBVIEW_LOAD_NO_CACHE', () => {
should(Ti.UI.Android).have.constant('WEBVIEW_LOAD_NO_CACHE').which.is.a.Number();
});
it('WEBVIEW_PLUGINS_OFF', () => {
should(Ti.UI.Android).have.constant('WEBVIEW_PLUGINS_OFF').which.is.a.Number();
});
it('WEBVIEW_PLUGINS_ON', () => {
should(Ti.UI.Android).have.constant('WEBVIEW_PLUGINS_ON').which.is.a.Number();
});
it('WEBVIEW_PLUGINS_ON_DEMAND', () => {
should(Ti.UI.Android).have.constant('WEBVIEW_PLUGINS_ON_DEMAND').which.is.a.Number();
});
});
});

0 comments on commit 386c5cf

Please sign in to comment.