![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@capawesome/capacitor-screen-orientation
Advanced tools
Capacitor plugin to lock/unlock the screen orientation.
Capacitor plugin to lock/unlock the screen orientation.
npm install @capawesome/capacitor-screen-orientation
npx cap sync
On iOS you must add the following to your app's AppDelegate.swift
:
+ import CapawesomeCapacitorScreenOrientation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
+ func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
+ return ScreenOrientation.getSupportedInterfaceOrientations()
+ }
No configuration required for this plugin.
A working example can be found here: robingenz/capacitor-plugin-demo
import { ScreenOrientation, OrientationType } from '@capawesome/capacitor-screen-orientation';
const lock = async () => {
await ScreenOrientation.lock({ type: OrientationType.LANDSCAPE });
};
const unlock = async () => {
await ScreenOrientation.unlock();
};
const getCurrentOrientation = async () => {
const result = await ScreenOrientation.getCurrentOrientation();
return result.type;
};
lock(...)
unlock()
getCurrentOrientation()
addListener('screenOrientationChange', ...)
removeAllListeners()
lock(options: LockOptions) => Promise<void>
Locks the device orientation.
Param | Type |
---|---|
options | LockOptions |
unlock() => Promise<void>
Unlocks the device orientation.
getCurrentOrientation() => Promise<GetCurrentOrientationResult>
Gets the current device orientation type.
Returns: Promise<GetCurrentOrientationResult>
addListener(eventName: 'screenOrientationChange', listenerFunc: ScreenOrientationChangeListener) => Promise<PluginListenerHandle>
Listen for screen orientation changes.
Param | Type |
---|---|
eventName | 'screenOrientationChange' |
listenerFunc | ScreenOrientationChangeListener |
Returns: Promise<PluginListenerHandle>
removeAllListeners() => Promise<void>
Remove all listeners for this plugin.
Prop | Type | Description |
---|---|---|
type | OrientationType | The orientation lock type. |
Prop | Type | Description |
---|---|---|
type | OrientationType | The current orientation type. |
Prop | Type |
---|---|
remove | () => Promise<void> |
Prop | Type | Description |
---|---|---|
type | OrientationType | The current orientation type. |
Callback to receive the screen orientation change notifications.
(change: ScreenOrientationChange): void
Members | Value | Description |
---|---|---|
LANDSCAPE | 'landscape' | The orientation is either landscape-primary or landscape-secondary. |
LANDSCAPE_PRIMARY | 'landscape-primary' | The orientation is in the primary landscape mode. |
LANDSCAPE_SECONDARY | 'landscape-secondary' | The orientation is in the secondary landscape mode. |
PORTRAIT | 'portrait' | The orientation is either portrait-primary or portrait-secondary. |
PORTRAIT_PRIMARY | 'portrait-primary' | The orientation is in the primary portrait mode. |
PORTRAIT_SECONDARY | 'portrait-secondary' | The orientation is in the secondary portrait mode. |
See CHANGELOG.md.
See LICENSE.
This plugin is based on the Capacitor Screen Orientation plugin. Thanks to everyone who contributed to the project!
FAQs
Capacitor plugin to lock/unlock the screen orientation.
The npm package @capawesome/capacitor-screen-orientation receives a total of 0 weekly downloads. As such, @capawesome/capacitor-screen-orientation popularity was classified as not popular.
We found that @capawesome/capacitor-screen-orientation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.