mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(visionos): ui-mobile-base supporting xros plus improvements to window handling (#10478)
This commit is contained in:
@@ -9,7 +9,7 @@ Button {
|
||||
text-transform: none;
|
||||
}
|
||||
.btn-view-demo {
|
||||
background-color: #65ADF1;
|
||||
/* background-color: #65ADF1; */
|
||||
border-radius: 5;
|
||||
font-size: 17;
|
||||
padding: 15;
|
||||
@@ -223,6 +223,22 @@ Button {
|
||||
background-color: #777;
|
||||
}
|
||||
|
||||
.ns-visionos Page {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.ns-visionos Label, TextField, TextView {
|
||||
font-size: 24;
|
||||
padding: 12
|
||||
}
|
||||
|
||||
.ns-visionos Button {
|
||||
padding: 12;
|
||||
font-size: 24;
|
||||
background-color: transparent;
|
||||
width: 400;
|
||||
}
|
||||
|
||||
.no-shadow {
|
||||
box-shadow: none;
|
||||
}
|
||||
@@ -5,7 +5,8 @@ export function navigatingTo(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
page.bindingContext = new HelloWorldModel();
|
||||
|
||||
if (global.isIOS) {
|
||||
Utils.ios.setWindowBackgroundColor('blue');
|
||||
}
|
||||
// Testing setting window background color
|
||||
// if (global.isIOS) {
|
||||
// Utils.ios.setWindowBackgroundColor('blue');
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export class DemoModel extends Observable {
|
||||
},
|
||||
(err) => {
|
||||
this.addingPhoto = false;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,24 +5,24 @@
|
||||
</Page.actionBar>
|
||||
<ScrollView>
|
||||
<StackLayout padding="20">
|
||||
<GridLayout borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#dedede" height="60" paddingLeft="5">
|
||||
<Label text="Test Label 1: should be aligned middle" />
|
||||
</GridLayout>
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#dedede" height="60" paddingLeft="5">
|
||||
<Label text="Test Label 2: should be aligned bottom" verticalAlignment="bottom" />
|
||||
</GridLayout>
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#dedede" height="60" paddingLeft="5">
|
||||
<Label text="Test Label 3: should be aligned top" verticalAlignment="top" />
|
||||
</GridLayout>
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#dedede" height="60" paddingLeft="5">
|
||||
<Label text="Test Label text-overflow: ellipsis, this should be long sentence and clipped at very end." textOverflow="ellipsis" whiteSpace="nowrap" />
|
||||
</GridLayout>
|
||||
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#dedede" height="60" paddingLeft="5">
|
||||
<Button text="Test Button text-overflow: ellipsis, this should be long sentence and clipped at very end." textOverflow="ellipsis" whiteSpace="nowrap" />
|
||||
</GridLayout>
|
||||
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#efefef" height="60" paddingLeft="5">
|
||||
<GridLayout marginTop="10" borderWidth="1" borderColor="#dedede" height="60" paddingLeft="5">
|
||||
<Button text="Test Button text-overflow: initial, this should be long sentence and truncated in the middle with ellipsis." textOverflow="initial" whiteSpace="nowrap" />
|
||||
</GridLayout>
|
||||
<GridLayout marginTop="10" height="60" paddingLeft="5" tap="{{toggleStrokeStyle}}">
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<StackLayout class="list-row-item">
|
||||
<GridLayout>
|
||||
<FlexboxLayout flexDirection="row" class="list-view-row" verticalAlignment="center">
|
||||
<visionos>
|
||||
<Label text="{{ iconText }}" class="icon-around icon-label"/>
|
||||
</visionos>
|
||||
<ios>
|
||||
<Label text="{{ iconText }}" class="icon-around icon-label"/>
|
||||
</ios>
|
||||
@@ -33,6 +36,9 @@
|
||||
<StackLayout class="list-row-item">
|
||||
<GridLayout>
|
||||
<FlexboxLayout flexDirection="row" class="list-view-row" verticalAlignment="center">
|
||||
<visionos>
|
||||
<Label text="{{ iconText }}" class="icon-around icon-label"/>
|
||||
</visionos>
|
||||
<ios>
|
||||
<Label text="{{ iconText }}" class="icon-around icon-label"/>
|
||||
</ios>
|
||||
|
||||
@@ -17,6 +17,12 @@ export class ScrollViewModel extends Observable {
|
||||
1914 translation by H. Rackham
|
||||
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
|
||||
|
||||
Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
||||
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
|
||||
|
||||
Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
||||
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
|
||||
|
||||
Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
|
||||
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."`;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</Page.actionBar>
|
||||
|
||||
<ScrollView scroll="{{ scroll }}">
|
||||
<StackLayout>
|
||||
<StackLayout class="p-20">
|
||||
|
||||
<Label text="{{longText}}" textWrap="true" />
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
|
||||
<GridLayout padding="20" class="switch-demo-page">
|
||||
<GridLayout class="switch-demo-page">
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<StackLayout ios:padding="20" visionos:padding="40">
|
||||
|
||||
<GridLayout columns="*, auto" marginTop="24">
|
||||
<Label text="Default + Checked + Enabled" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
|
||||
<!-- <ScrollView> -->
|
||||
<ScrollView>
|
||||
|
||||
<StackLayout class="p-x-20" loaded="{{ loadedContainer }}">
|
||||
<Label id="label" tap="{{ onTapAnything }}" text="Touchable label" class="t-18 c-black text-center m-t-5" touchAnimation="{{ touchAnimationLabel }}" />
|
||||
@@ -36,5 +36,5 @@
|
||||
<Button text="TAP" tap="{{ onTapAnything }}" class="btn btn-primary btn-view-demo" touchAnimation="true" /> -->
|
||||
|
||||
</StackLayout>
|
||||
<!-- </ScrollView> -->
|
||||
</ScrollView>
|
||||
</Page>
|
||||
|
||||
Reference in New Issue
Block a user