diff --git a/app.json b/app.json
index de37a56c..9e227a49 100644
--- a/app.json
+++ b/app.json
@@ -2,7 +2,7 @@
"expo": {
"name": "Streamyfin",
"slug": "streamyfin",
- "version": "0.17.0",
+ "version": "0.18.0",
"orientation": "default",
"icon": "./assets/images/icon.png",
"scheme": "streamyfin",
@@ -33,7 +33,7 @@
},
"android": {
"jsEngine": "hermes",
- "versionCode": 43,
+ "versionCode": 46,
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive_icon.png"
},
diff --git a/app/(auth)/(tabs)/(libraries)/[libraryId].tsx b/app/(auth)/(tabs)/(libraries)/[libraryId].tsx
index f2439409..1f345a0a 100644
--- a/app/(auth)/(tabs)/(libraries)/[libraryId].tsx
+++ b/app/(auth)/(tabs)/(libraries)/[libraryId].tsx
@@ -32,7 +32,6 @@ import {
tagsFilterAtom,
yearFilterAtom,
} from "@/utils/atoms/filters";
-import { orientationAtom } from "@/utils/atoms/orientation";
import {
BaseItemDto,
BaseItemDtoQueryResult,
@@ -44,6 +43,7 @@ import {
} from "@jellyfin/sdk/lib/utils/api";
import { FlashList } from "@shopify/flash-list";
import { useSafeAreaInsets } from "react-native-safe-area-context";
+import { useOrientation } from "@/hooks/useOrientation";
const MemoizedTouchableItemRouter = React.memo(TouchableItemRouter);
@@ -60,12 +60,13 @@ const Page = () => {
const [selectedTags, setSelectedTags] = useAtom(tagsFilterAtom);
const [sortBy, _setSortBy] = useAtom(sortByAtom);
const [sortOrder, _setSortOrder] = useAtom(sortOrderAtom);
- const [orientation] = useAtom(orientationAtom);
const [sortByPreference, setSortByPreference] = useAtom(sortByPreferenceAtom);
const [sortOrderPreference, setOderByPreference] = useAtom(
sortOrderPreferenceAtom
);
+ const { orientation } = useOrientation();
+
useEffect(() => {
const sop = getSortOrderPreference(libraryId, sortOrderPreference);
if (sop) {
@@ -106,11 +107,12 @@ const Page = () => {
[libraryId, sortOrderPreference]
);
- const getNumberOfColumns = useCallback(() => {
- if (orientation === ScreenOrientation.Orientation.PORTRAIT_UP) return 3;
- if (screenWidth < 600) return 5;
- if (screenWidth < 960) return 6;
- if (screenWidth < 1280) return 7;
+ const nrOfCols = useMemo(() => {
+ if (screenWidth < 300) return 2;
+ if (screenWidth < 500) return 3;
+ if (screenWidth < 800) return 5;
+ if (screenWidth < 1000) return 6;
+ if (screenWidth < 1500) return 7;
return 6;
}, [screenWidth, orientation]);
@@ -219,7 +221,7 @@ const Page = () => {
const renderItem = useCallback(
({ item, index }: { item: BaseItemDto; index: number }) => (
- {
{
-
+
),
[orientation]
);
@@ -429,6 +431,7 @@ const Page = () => {
return (
No results
@@ -437,10 +440,10 @@ const Page = () => {
contentInsetAdjustmentBehavior="automatic"
data={flatData}
renderItem={renderItem}
- extraData={orientation}
+ extraData={[orientation, nrOfCols]}
keyExtractor={keyExtractor}
estimatedItemSize={244}
- numColumns={getNumberOfColumns()}
+ numColumns={nrOfCols}
onEndReached={() => {
if (hasNextPage) {
fetchNextPage();
diff --git a/app/(auth)/play-video.tsx b/app/(auth)/play-video.tsx
index c601210c..59ef2733 100644
--- a/app/(auth)/play-video.tsx
+++ b/app/(auth)/play-video.tsx
@@ -22,11 +22,9 @@ import { Dimensions, Pressable, StatusBar, View } from "react-native";
import { useSharedValue } from "react-native-reanimated";
import Video, {
OnProgressData,
- VideoRef,
- SelectedTrack,
SelectedTrackType,
+ VideoRef,
} from "react-native-video";
-import { WithDefault } from "react-native/Libraries/Types/CodegenTypes";
export default function page() {
const { playSettings, playUrl, playSessionId } = usePlaySettings();
@@ -216,18 +214,28 @@ export default function page() {
return (
{
setShowControls(!showControls);
}}
- className="absolute z-0 h-full w-full"
+ style={{
+ position: "absolute",
+ top: 0,
+ left: 0,
+ width: screenDimensions.width,
+ height: screenDimensions.height,
+ zIndex: 0,
+ }}
>