UNPKG

@nativescript/core

Version:

A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.

60 lines (59 loc) 2.57 kB
import type { View } from '../ui/core/view'; import { CoreTypes } from '../core-types'; import { NativeWindow } from './native-window-common'; import type { WindowRole } from './window-base'; /** * Android implementation of NativeWindow. * Wraps an AppCompatActivity. */ export declare class AndroidNativeWindow extends NativeWindow { private _activity; private _componentCallbacks; private _componentCallbacksActivity; constructor(activity: androidx.appcompat.app.AppCompatActivity, id?: string, isPrimary?: boolean, role?: WindowRole); /** * @internal – bind a recreated activity to this window session after a detach. */ _reattach(activity: androidx.appcompat.app.AppCompatActivity): void; /** * @internal – observe the activity's own configuration. * * Registered on the activity rather than the application context: in multi-window * and multi-display setups each activity gets its own configuration, and only these * callbacks report the one this window actually renders with. */ _registerConfigurationCallbacks(): void; /** * @internal – drop the configuration callbacks, so a recreated activity does not * leave the previous one registered. */ _unregisterConfigurationCallbacks(): void; _detach(): void; /** * The wrapped Android Activity (may be GC'd). */ get activity(): androidx.appcompat.app.AppCompatActivity | undefined; get android(): { activity: androidx.appcompat.app.AppCompatActivity; }; /** * Platform-specific: apply the view as root content of this Activity. */ protected _setNativeContent(view: View): void; /** * Close this window by finishing the activity. */ close(): void; protected _getOrientation(): 'portrait' | 'landscape' | 'unknown'; protected _getSystemAppearance(): 'light' | 'dark' | null; protected _getLayoutDirection(): CoreTypes.LayoutDirectionType | null; _getOrientationValue(configuration: android.content.res.Configuration): 'portrait' | 'landscape' | 'unknown'; _getSystemAppearanceValue(configuration: android.content.res.Configuration): 'dark' | 'light'; _getLayoutDirectionValue(configuration: android.content.res.Configuration): CoreTypes.LayoutDirectionType; protected _onDestroy(): void; /** * Mints a window identity. Android has no stable activity id, so the value is kept * in the activity saved state to survive recreation (rotation, theme change). */ static newWindowId(): string; }