| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c3ee667 commit 2d2144f
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,13 +57,22 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 57 | 57 | }; | |
| 58 | 58 | }; | |
| 59 | 59 | ||
| 60 | - private layout_in_full_screen_test(layout: view.View) { | ||
| 60 | + private layout_in_full_screen_test(layout: view.View, pageOptions?: helper.PageOptions) { | ||
| 61 | + let expectedTop = 0; | ||
| 62 | + if (pageOptions && pageOptions.actionBarFlat) { | ||
| 63 | + const actionBarHeight = round(dipToDp(layout.page.actionBar.nativeViewProtected.frame.size.height)); | ||
| 64 | + const app = iosUtils.getter(UIApplication, UIApplication.sharedApplication); | ||
| 65 | + const statusBarHeight = round(dipToDp(app.statusBarFrame.size.height)); | ||
| 66 | + | ||
| 67 | + expectedTop = actionBarHeight + statusBarHeight; | ||
| 68 | + } | ||
| 69 | + | ||
| 61 | 70 | const l = left(layout); | |
| 62 | 71 | const t = top(layout); | |
| 63 | 72 | const r = right(layout); | |
| 64 | 73 | const b = bottom(layout); | |
| 65 | 74 | equal(l, 0, `${layout}.left - actual:${l}; expected: ${0}`); | |
| 66 | - equal(t, 0, `${layout}.top - actual:${t}; expected: ${0}`); | ||
| 75 | + equal(t, expectedTop, `${layout}.top - actual:${t}; expected: ${expectedTop}`); | ||
| 67 | 76 | equal(r, platform.screen.mainScreen.widthPixels, `${layout}.right - actual:${r}; expected: ${platform.screen.mainScreen.widthPixels}`); | |
| 68 | 77 | equal(b, platform.screen.mainScreen.heightPixels, `${layout}.bottom - actual:${b}; expected: ${platform.screen.mainScreen.heightPixels}`); | |
| 69 | 78 | } | |
@@ -78,7 +87,7 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 78 | 87 | this.getViews(snippet), | |
| 79 | 88 | this.noop, | |
| 80 | 89 | ({ root }) => { | |
| 81 | - this.layout_in_full_screen_test(root); | ||
| 90 | + this.layout_in_full_screen_test(root, pageOptions); | ||
| 82 | 91 | }, | |
| 83 | 92 | pageOptions | |
| 84 | 93 | ); | |
@@ -130,10 +139,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 130 | 139 | this.absolute_children_components_in_safe_area({ actionBarHidden: true }); | |
| 131 | 140 | } | |
| 132 | 141 | ||
| 133 | - public test_absolute_children_components_in_safe_area_action_bar_flat() { | ||
| 134 | - this.absolute_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | 142 | public test_absolute_children_components_in_safe_area_tab_bar() { | |
| 138 | 143 | this.absolute_children_components_in_safe_area({ tabBar: true }); | |
| 139 | 144 | } | |
@@ -175,10 +180,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 175 | 180 | this.absolute_nested_layouts_beyond_safe_area({ actionBarHidden: true }); | |
| 176 | 181 | } | |
| 177 | 182 | ||
| 178 | - public test_absolute_nested_layouts_beyond_safe_area_action_bar_flat() { | ||
| 179 | - this.absolute_nested_layouts_beyond_safe_area({ actionBarFlat: true }); | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | 183 | public test_absolute_nested_layouts_beyond_safe_area_tab_bar() { | |
| 183 | 184 | this.absolute_nested_layouts_beyond_safe_area({ tabBar: true }); | |
| 184 | 185 | } | |
@@ -205,7 +206,7 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 205 | 206 | this.getDockViews(snippet), | |
| 206 | 207 | this.noop, | |
| 207 | 208 | ({ root }) => { | |
| 208 | - this.layout_in_full_screen_test(root); | ||
| 209 | + this.layout_in_full_screen_test(root, pageOptions); | ||
| 209 | 210 | }, | |
| 210 | 211 | pageOptions | |
| 211 | 212 | ); | |
@@ -272,10 +273,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 272 | 273 | this.dock_children_components_in_safe_area({ actionBarHidden: true }); | |
| 273 | 274 | } | |
| 274 | 275 | ||
| 275 | - public test_dock_children_components_in_safe_area_action_bar_flat() { | ||
| 276 | - this.dock_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 277 | - } | ||
| 278 | - | ||
| 279 | 276 | public test_dock_children_components_in_safe_area_tab_bar() { | |
| 280 | 277 | this.dock_children_components_in_safe_area({ tabBar: true }); | |
| 281 | 278 | } | |
@@ -334,10 +331,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 334 | 331 | this.dock_nested_layouts_beyond_safe_area({ actionBarHidden: true }); | |
| 335 | 332 | } | |
| 336 | 333 | ||
| 337 | - public test_dock_nested_layouts_beyond_safe_area_action_bar_flat() { | ||
| 338 | - this.dock_nested_layouts_beyond_safe_area({ actionBarFlat: true }); | ||
| 339 | - } | ||
| 340 | - | ||
| 341 | 334 | public test_dock_nested_layouts_beyond_safe_area_tab_bar() { | |
| 342 | 335 | this.dock_nested_layouts_beyond_safe_area({ tabBar: true }); | |
| 343 | 336 | } | |
@@ -352,7 +345,7 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 352 | 345 | this.getViews(snippet), | |
| 353 | 346 | this.noop, | |
| 354 | 347 | ({ root }) => { | |
| 355 | - this.layout_in_full_screen_test(root); | ||
| 348 | + this.layout_in_full_screen_test(root, pageOptions); | ||
| 356 | 349 | }, | |
| 357 | 350 | pageOptions | |
| 358 | 351 | ); | |
@@ -409,10 +402,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 409 | 402 | this.flex_column_children_components_in_safe_area({ actionBarHidden: true }); | |
| 410 | 403 | } | |
| 411 | 404 | ||
| 412 | - public test_flex_column_children_components_in_safe_area_action_bar_flat() { | ||
| 413 | - this.flex_column_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 414 | - } | ||
| 415 | - | ||
| 416 | 405 | public test_flex_column_children_components_in_safe_area_tab_bar() { | |
| 417 | 406 | this.flex_column_children_components_in_safe_area({ tabBar: true }); | |
| 418 | 407 | } | |
@@ -452,10 +441,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 452 | 441 | this.flex_row_children_components_in_safe_area({ actionBarHidden: true }); | |
| 453 | 442 | } | |
| 454 | 443 | ||
| 455 | - public test_flex_row_children_components_in_safe_area_action_bar_flat() { | ||
| 456 | - this.flex_row_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 457 | - } | ||
| 458 | - | ||
| 459 | 444 | public test_flex_row_children_components_in_safe_area_tab_bar() { | |
| 460 | 445 | this.flex_row_children_components_in_safe_area({ tabBar: true }); | |
| 461 | 446 | } | |
@@ -502,10 +487,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 502 | 487 | this.flex_column_nested_layouts_beyond_safe_area({ actionBarHidden: true }); | |
| 503 | 488 | } | |
| 504 | 489 | ||
| 505 | - public test_flex_column_nested_layouts_beyond_safe_area_action_bar_flat() { | ||
| 506 | - this.flex_column_nested_layouts_beyond_safe_area({ actionBarFlat: true }); | ||
| 507 | - } | ||
| 508 | - | ||
| 509 | 490 | public test_flex_column_nested_layouts_beyond_safe_area_tab_bar() { | |
| 510 | 491 | this.flex_column_nested_layouts_beyond_safe_area({ tabBar: true }); | |
| 511 | 492 | } | |
@@ -552,10 +533,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 552 | 533 | this.flex_row_nested_layouts_beyond_safe_area({ actionBarHidden: true }); | |
| 553 | 534 | } | |
| 554 | 535 | ||
| 555 | - public test_flex_row_nested_layouts_beyond_safe_area_action_bar_flat() { | ||
| 556 | - this.flex_row_nested_layouts_beyond_safe_area({ actionBarFlat: true }); | ||
| 557 | - } | ||
| 558 | - | ||
| 559 | 536 | public test_flex_row_nested_layouts_beyond_safe_area_tab_bar() { | |
| 560 | 537 | this.flex_row_nested_layouts_beyond_safe_area({ tabBar: true }); | |
| 561 | 538 | } | |
@@ -583,7 +560,7 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 583 | 560 | this.getGridViews(snippet), | |
| 584 | 561 | this.noop, | |
| 585 | 562 | ({ root }) => { | |
| 586 | - this.layout_in_full_screen_test(root); | ||
| 563 | + this.layout_in_full_screen_test(root, pageOptions); | ||
| 587 | 564 | }, | |
| 588 | 565 | pageOptions | |
| 589 | 566 | ); | |
@@ -664,10 +641,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 664 | 641 | this.grid_component_cells_layout_in_safe_area({ actionBarHidden: true }); | |
| 665 | 642 | } | |
| 666 | 643 | ||
| 667 | - public test_grid_component_cells_layout_in_safe_area_action_bar_flat() { | ||
| 668 | - this.grid_component_cells_layout_in_safe_area({ actionBarFlat: true }); | ||
| 669 | - } | ||
| 670 | - | ||
| 671 | 644 | public test_grid_component_cells_layout_in_safe_area_tab_bar() { | |
| 672 | 645 | this.grid_component_cells_layout_in_safe_area({ tabBar: true }); | |
| 673 | 646 | } | |
@@ -729,10 +702,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 729 | 702 | this.grid_nested_grid_cells_layout_beyond_safe_area({ actionBarHidden: true }); | |
| 730 | 703 | } | |
| 731 | 704 | ||
| 732 | - public test_grid_nested_grid_cells_layout_beyond_safe_area_action_bar_flat() { | ||
| 733 | - this.grid_nested_grid_cells_layout_beyond_safe_area({ actionBarFlat: true }); | ||
| 734 | - } | ||
| 735 | - | ||
| 736 | 705 | public test_grid_nested_grid_cells_layout_beyond_safe_area_tab_bar() { | |
| 737 | 706 | this.grid_nested_grid_cells_layout_beyond_safe_area({ tabBar: true }); | |
| 738 | 707 | } | |
@@ -747,7 +716,7 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 747 | 716 | this.getViews(snippet), | |
| 748 | 717 | this.noop, | |
| 749 | 718 | ({ root }) => { | |
| 750 | - this.layout_in_full_screen_test(root); | ||
| 719 | + this.layout_in_full_screen_test(root, pageOptions); | ||
| 751 | 720 | }, | |
| 752 | 721 | pageOptions | |
| 753 | 722 | ); | |
@@ -799,10 +768,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 799 | 768 | this.stack_horizontal_children_components_in_safe_area({ actionBarHidden: true }); | |
| 800 | 769 | } | |
| 801 | 770 | ||
| 802 | - public test_stack_horizontal_children_components_in_safe_area_action_bar_flat() { | ||
| 803 | - this.stack_horizontal_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 804 | - } | ||
| 805 | - | ||
| 806 | 771 | public test_stack_horizontal_children_components_in_safe_area_tab_bar() { | |
| 807 | 772 | this.stack_horizontal_children_components_in_safe_area({ tabBar: true }); | |
| 808 | 773 | } | |
@@ -837,10 +802,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 837 | 802 | this.stack_vertical_children_components_in_safe_area({ actionBarHidden: true }); | |
| 838 | 803 | } | |
| 839 | 804 | ||
| 840 | - public test_stack_vertical_children_components_in_safe_area_action_bar_flat() { | ||
| 841 | - this.stack_vertical_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 842 | - } | ||
| 843 | - | ||
| 844 | 805 | public test_stack_vertical_children_components_in_safe_area_tab_bar() { | |
| 845 | 806 | this.stack_vertical_children_components_in_safe_area({ tabBar: true }); | |
| 846 | 807 | } | |
@@ -876,10 +837,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 876 | 837 | this.stack_nested_layouts_beyond_safe_area({ actionBarHidden: true }); | |
| 877 | 838 | } | |
| 878 | 839 | ||
| 879 | - public test_stack_nested_layouts_beyond_safe_area_action_bar_flat() { | ||
| 880 | - this.stack_nested_layouts_beyond_safe_area({ actionBarFlat: true }); | ||
| 881 | - } | ||
| 882 | - | ||
| 883 | 840 | public test_stack_nested_layouts_beyond_safe_area_tab_bar() { | |
| 884 | 841 | this.stack_nested_layouts_beyond_safe_area({ tabBar: true }); | |
| 885 | 842 | } | |
@@ -894,7 +851,7 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 894 | 851 | this.getViews(snippet), | |
| 895 | 852 | this.noop, | |
| 896 | 853 | ({ root }) => { | |
| 897 | - this.layout_in_full_screen_test(root); | ||
| 854 | + this.layout_in_full_screen_test(root, pageOptions); | ||
| 898 | 855 | }, | |
| 899 | 856 | pageOptions | |
| 900 | 857 | ); | |
@@ -948,10 +905,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 948 | 905 | this.wrap_horizontal_children_components_in_safe_area({ actionBarHidden: true }); | |
| 949 | 906 | } | |
| 950 | 907 | ||
| 951 | - public test_wrap_horizontal_children_components_in_safe_area_action_bar_flat() { | ||
| 952 | - this.wrap_horizontal_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 953 | - } | ||
| 954 | - | ||
| 955 | 908 | public test_wrap_horizontal_children_components_in_safe_area_tab_bar() { | |
| 956 | 909 | this.wrap_horizontal_children_components_in_safe_area({ tabBar: true }); | |
| 957 | 910 | } | |
@@ -988,10 +941,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 988 | 941 | this.wrap_vertical_children_components_in_safe_area({ actionBarHidden: true }); | |
| 989 | 942 | } | |
| 990 | 943 | ||
| 991 | - public test_wrap_vertical_children_components_in_safe_area_action_bar_flat() { | ||
| 992 | - this.wrap_vertical_children_components_in_safe_area({ actionBarFlat: true }); | ||
| 993 | - } | ||
| 994 | - | ||
| 995 | 944 | public test_wrap_vertical_children_components_in_safe_area_tab_bar() { | |
| 996 | 945 | this.wrap_vertical_children_components_in_safe_area({ tabBar: true }); | |
| 997 | 946 | } | |
@@ -1025,10 +974,6 @@ export class SafeAreaTests extends testModule.UITest<any> { | |||
| 1025 | 974 | this.wrap_nested_layouts_beyond_safe_area({ actionBarHidden: true }); | |
| 1026 | 975 | } | |
| 1027 | 976 | ||
| 1028 | - public test_wrap_nested_layouts_beyond_safe_area_action_bar_flat() { | ||
| 1029 | - this.wrap_nested_layouts_beyond_safe_area({ actionBarFlat: true }); | ||
| 1030 | - } | ||
| 1031 | - | ||
| 1032 | 977 | public test_wrap_nested_layouts_beyond_safe_area_tab_bar() { | |
| 1033 | 978 | this.wrap_nested_layouts_beyond_safe_area({ tabBar: true }); | |
| 1034 | 979 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -780,12 +780,12 @@ export namespace ios { | |||
| 780 | 780 | adjustedPosition.top = fullscreenPosition.top; | |
| 781 | 781 | } | |
| 782 | 782 | ||
| 783 | - if (inWindowRight < fullscreenPosition.right && inWindowRight >= safeAreaPosition.right) { | ||
| 784 | - adjustedPosition.right = fullscreenPosition.right; | ||
| 783 | + if (inWindowRight < fullscreenPosition.right && inWindowRight >= safeAreaPosition.right + fullscreenPosition.left) { | ||
| 784 | + adjustedPosition.right = fullscreenPosition.right - fullscreenPosition.left; | ||
| 785 | 785 | } | |
| 786 | 786 | ||
| 787 | - if (inWindowBottom < fullscreenPosition.bottom && inWindowBottom >= safeAreaPosition.bottom) { | ||
| 788 | - adjustedPosition.bottom = fullscreenPosition.bottom; | ||
| 787 | + if (inWindowBottom < fullscreenPosition.bottom && inWindowBottom >= safeAreaPosition.bottom + fullscreenPosition.top) { | ||
| 788 | + adjustedPosition.bottom = fullscreenPosition.bottom - fullscreenPosition.top; | ||
| 789 | 789 | } | |
| 790 | 790 | ||
| 791 | 791 | const adjustedFrame = CGRectMake(layout.toDeviceIndependentPixels(adjustedPosition.left), layout.toDeviceIndependentPixels(adjustedPosition.top), layout.toDeviceIndependentPixels(adjustedPosition.right - adjustedPosition.left), layout.toDeviceIndependentPixels(adjustedPosition.bottom - adjustedPosition.top)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -311,10 +311,11 @@ export class Page extends PageBase { | |||
| 311 | 311 | View.layoutChild(this, this.actionBar, 0, 0, actionBarWidth, actionBarHeight); | |
| 312 | 312 | ||
| 313 | 313 | const insets = this.getSafeAreaInsets(); | |
| 314 | - const childLeft = left + insets.left; | ||
| 315 | - const childTop = top + insets.top; | ||
| 316 | - const childRight = right - insets.right; | ||
| 317 | - const childBottom = bottom - insets.bottom; | ||
| 314 | + | ||
| 315 | + const childLeft = 0 + insets.left; | ||
| 316 | + const childTop = 0 + insets.top; | ||
| 317 | + const childRight = right - left - insets.right; | ||
| 318 | + const childBottom = bottom - top - insets.bottom; | ||
| 318 | 319 | View.layoutChild(this, this.layoutView, childLeft, childTop, childRight, childBottom); | |
| 319 | 320 | } | |
| 320 | 321 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments