How to use the @nativescript/core/ui/frame.topmost function in @nativescript/core

To help you get started, we’ve selected a few @nativescript/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Akylas / nativescript-material-components / src / snackbar / snackbar.android.ts View on Github external
public initSnack(options: SnackBarOptions, resolve?: Function) {
        if (this._snackbar) {
            return;
        }
        // options.actionText = options.actionText ? options.actionText : 'Close';
        options.hideDelay = options.hideDelay ? options.hideDelay : 3000;

        const attachToView = (options.view && options.view.android) || topmost().currentPage.android;
        this._snackbar = com.google.android.material.snackbar.Snackbar.make(attachToView, options.message, options.hideDelay);

        this._snackbar.setText(options.message);
        this._snackbar.setDuration(options.hideDelay);

        // set text color of the TextView in the Android SnackBar
        if (options.textColor && Color.isValid(options.textColor)) {
            const color = (options.textColor instanceof Color ? options.textColor : new Color(options.textColor)).android;

            if ((this._snackbar as any).setTextColor) {
                (this._snackbar as any).setTextColor(color);
            } else {
                const mainTextView = this._snackbar.getView().findViewById(SnackBar.SNACKBAR_TEXT_ID) as android.widget.TextView;
                if (mainTextView) {
                    mainTextView.setTextColor(color);
                }
github EddyVerbruggen / nativescript-bluetooth / demo / app / test-page-model.ts View on Github external
public onServiceTap(args) {
        const service = this.discoveredServices.getItem(args.index);
        console.log('--- service selected: ' + service.UUID);

        const navigationEntry = {
            moduleName: 'characteristics-page',
            context: {
                peripheral: this.peripheral,
                service
            },
            animated: true
        };

        topmost().navigate(navigationEntry);
    }
github EddyVerbruggen / nativescript-bluetooth / demo / app / main-view-model.ts View on Github external
public onPeripheralTestTap(peri) {
        this.doStopScanning();
        console.log('!!&&&&***** Long press item with index ' + peri);
        console.log('--- peripheral selected: ' + peri.UUID);

        const navigationEntry = {
            moduleName: 'test-page',
            context: {
                peripheral: peri
            },
            animated: true
        };
        topmost().navigate(navigationEntry);
    }
github Akylas / nativescript-material-components / demo-vue / app / examples / ButtonIssue.vue View on Github external
onNavigationButtonTap() {
            frameModule.topmost().goBack();
        },
        onTap() {
github Akylas / nativescript-material-components / demo-vue / app / examples / TextFields.vue View on Github external
onNavigationButtonTap() {
            frameModule.topmost().goBack();
        },
        onFocus() {
github Akylas / nativescript-material-components / demo-vue / app / examples / Dialogs.vue View on Github external
onNavigationButtonTap() {
            frameModule.topmost().goBack();
        },
        onTap(args: EventData) {
github Akylas / nativescript-material-components / demo-vue / app / examples / BottomSheet.vue View on Github external
onNavigationButtonTap() {
            frameModule.topmost().goBack();
        },
        onTap(args: EventData) {