mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
chore
This commit is contained in:
21
utils/OrientationLockConverter.ts
Normal file
21
utils/OrientationLockConverter.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { Orientation, OrientationLock } from "expo-screen-orientation";
|
||||||
|
|
||||||
|
function orientationToOrientationLock(
|
||||||
|
orientation: Orientation
|
||||||
|
): OrientationLock {
|
||||||
|
switch (orientation) {
|
||||||
|
case Orientation.PORTRAIT_UP:
|
||||||
|
return OrientationLock.PORTRAIT_UP;
|
||||||
|
case Orientation.PORTRAIT_DOWN:
|
||||||
|
return OrientationLock.PORTRAIT_DOWN;
|
||||||
|
case Orientation.LANDSCAPE_LEFT:
|
||||||
|
return OrientationLock.LANDSCAPE_LEFT;
|
||||||
|
case Orientation.LANDSCAPE_RIGHT:
|
||||||
|
return OrientationLock.LANDSCAPE_RIGHT;
|
||||||
|
case Orientation.UNKNOWN:
|
||||||
|
default:
|
||||||
|
return OrientationLock.DEFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default orientationToOrientationLock;
|
||||||
Reference in New Issue
Block a user