-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(ios): iPhone Duo support #11438
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
91f3206
fix(ios): size a nested Frame from its container rather than the main…
NathanWalker 6d15a7f
fix(ios): read Screen.mainScreen bounds from the window's current screen
NathanWalker 19794be
feat(action-bar): iOS bar placement settings and titles for icon items
NathanWalker 37d8d33
refactor(ios): trim comments to the code comments guide
NathanWalker 1c40591
fix(ios): lay out a Frame or TabView hosted in a layout from its layo…
NathanWalker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,36 @@ | ||
| import { Frame, GridLayout, Label, TabView, View } from '@nativescript/core'; | ||
| import * as TKUnit from '../../tk-unit'; | ||
| import * as helper from '../../ui-helper'; | ||
|
|
||
| export * from './frame-tests-common'; | ||
|
|
||
| function assertHostedBelowHeader(hosted: View) { | ||
| const header = new Label(); | ||
| header.text = 'Header'; | ||
| const grid = new GridLayout(); | ||
| grid.rows = '50, *'; | ||
| GridLayout.setRow(hosted, 1); | ||
| grid.addChild(header); | ||
| grid.addChild(hosted); | ||
|
|
||
| helper.buildUIAndRunTest(grid, () => { | ||
| helper.waitUntilLayoutReady(hosted); | ||
|
|
||
| const headerFrame = (header.nativeViewProtected as UIView).frame; | ||
| const hostedFrame = (hosted.nativeViewProtected as UIView).frame; | ||
| const container = (grid.nativeViewProtected as UIView).bounds; | ||
|
|
||
| TKUnit.assertAreClose(hostedFrame.origin.y, headerFrame.origin.y + headerFrame.size.height, 0.5, 'top'); | ||
| TKUnit.assertAreClose(hostedFrame.origin.y + hostedFrame.size.height, container.size.height, 0.5, 'bottom'); | ||
| TKUnit.assertAreClose(hostedFrame.origin.x, 0, 0.5, 'left'); | ||
| TKUnit.assertAreClose(hostedFrame.size.width, container.size.width, 0.5, 'width'); | ||
| }); | ||
| } | ||
|
|
||
| export function test_frame_hosted_in_layout_fills_its_cell() { | ||
| assertHostedBelowHeader(new Frame()); | ||
| } | ||
|
|
||
| export function test_tab_view_hosted_in_layout_fills_its_cell() { | ||
| assertHostedBelowHeader(new TabView()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { Observable, EventData, Page, ActionItem } from '@nativescript/core'; | ||
|
|
||
| export function navigatingTo(args: EventData) { | ||
| const page = <Page>args.object; | ||
| page.bindingContext = new ActionItemsModel(); | ||
| } | ||
|
|
||
| export class ActionItemsModel extends Observable { | ||
| lastTapped = 'Tap an action item'; | ||
|
|
||
| onItemTap(args: EventData) { | ||
| this.set('lastTapped', `Tapped: ${(<ActionItem>args.object).text}`); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page"> | ||
| <Page.actionBar> | ||
| <ActionBar title="Action Items" class="action-bar"> | ||
| <ActionItem icon="sys://star" text="Favorite" ios.position="right" ios.visibilityPriority="high" tap="{{ onItemTap }}" /> | ||
| <ActionItem icon="sys://square.and.arrow.up" text="Share" ios.position="right" tap="{{ onItemTap }}" /> | ||
| <ActionItem icon="sys://bookmark" text="Bookmark" ios.position="right" tap="{{ onItemTap }}" /> | ||
| <ActionItem icon="sys://flag" text="Flag" ios.position="right" tap="{{ onItemTap }}" /> | ||
| <ActionItem icon="sys://folder" text="Move" ios.position="right" tap="{{ onItemTap }}" /> | ||
| <ActionItem icon="sys://tag" text="Tag" ios.position="right" ios.visibilityPriority="low" tap="{{ onItemTap }}" /> | ||
| <ActionItem icon="sys://archivebox" text="Archive" ios.position="right" ios.visibilityPriority="low" tap="{{ onItemTap }}" /> | ||
| <ActionItem icon="sys://printer" text="Print" ios.position="right" ios.visibilityPriority="low" ios.axisBehavior="horizontalOnly" tap="{{ onItemTap }}" /> | ||
| </ActionBar> | ||
| </Page.actionBar> | ||
|
|
||
| <StackLayout padding="20"> | ||
| <Label text="{{ lastTapped }}" textWrap="true" fontSize="17" /> | ||
| <Label text="Favorite: high priority. Tag, Archive and Print: low priority. Print: horizontal bars only." textWrap="true" marginTop="12" color="#888" /> | ||
| </StackLayout> | ||
| </Page> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.