feat(utils): dismissKeyboard, copyToClipboard, setWindowBackgroundColor, getCurrentActivity and getResource (#10089)

This commit is contained in:
Nathan Walker
2022-11-17 21:05:54 -08:00
committed by GitHub
parent 0226f47f8d
commit 2e1d2c175b
12 changed files with 129 additions and 18 deletions

View File

@@ -1,7 +1,11 @@
import { EventData, Page } from '@nativescript/core';
import { EventData, Page, Utils } from '@nativescript/core';
import { HelloWorldModel } from './main-view-model';
export function navigatingTo(args: EventData) {
const page = <Page>args.object;
page.bindingContext = new HelloWorldModel();
if (global.isIOS) {
Utils.ios.setWindowBackgroundColor('blue');
}
}

View File

@@ -1,3 +1,3 @@
import { Application } from '@nativescript/core';
import { Application, Utils } from '@nativescript/core';
Application.run({ moduleName: 'app-root' });

View File

@@ -10,7 +10,7 @@ export class BoxShadowModel extends Observable {
private _selectedBackgroundType: string;
private _selectedBorderType: string;
private _selectedAnimation: string;
private _boxShadow: string = '0 10 15 -3 rgba(200, 0, 0, 0.4)';
private _boxShadow: string = '0 0 2 2 rgba(200, 0, 0, 0.4)';
// private _boxShadow: string = '5 5 1 1 rgba(255, 0, 0, .9)';
// private _boxShadow: string = '5 5 5 10 rgba(255, 0, 0, .9)';

View File

@@ -5,13 +5,16 @@
</Page.actionBar>
<StackLayout class="p-10">
<Label text="iPhone by default plays media content in a webview in full screen, meaning it takes over your whole UI. You can toggle this on and off with a cool new property: iosAllowInlineMediaPlayback" textWrap="true" style="color: gray;" class="m-b-10 v-center text-center" />
<Label text="iPhone by default plays media content in a webview in full screen, meaning it takes over your whole UI. You can toggle this on and off with a cool new property: iosAllowInlineMediaPlayback" textWrap="true" style="color: gray;" class="m-b-10 v-center text-center" />
<Label style="color: gray;" textWrap="true" class="m-b-5 text-center" text="This webview plays this youtube content inline." />
<WebView iosAllowInlineMediaPlayback="true" src="https://sphere.presonus.com/video/youtube/QnGX0xrv6Dw" height="200" />
<Label style="color: gray;" textWrap="true" class="m-b-5 text-center" text="This webview plays this youtube content inline." />
<GridLayout rows="200" columns="">
<WebView iosAllowInlineMediaPlayback="true" src="https://www.youtube.com/embed/Mzy1jWxrSiw" height="200" />
</GridLayout>
<Label style="color: gray;" textWrap="true" class="m-b-5 m-t-20 text-center" text="This webview forces media content into fullscreen on iPhone." />
<GridLayout rows="200" columns="">
<WebView src="https://www.youtube.com/embed/Mzy1jWxrSiw" height="200" />
</GridLayout>
<Label style="color: gray;" textWrap="true" class="m-b-5 m-t-20 text-center" text="This webview forces media content into fullscreen on iPhone." />
<WebView src="https://sphere.presonus.com/video/youtube/QnGX0xrv6Dw" height="200" />
</StackLayout>
</StackLayout>
</Page>