From 41d78f0d2f98226b58f74bac05ffd6600f9548db Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:49:58 +0900 Subject: [PATCH] reworked placeholder also fixed downloads finishing early and reading corrupted files --- App.tsx | 3 + .../main/java/com/subsonify/MainActivity.java | 6 ++ src/components/common/BottomTabBar.tsx | 2 +- src/components/library/AlbumsTab.tsx | 84 +++++++++++++------ src/styles/text.ts | 18 +++- src/subsonic/api.ts | 47 +++++++++-- 6 files changed, 127 insertions(+), 33 deletions(-) diff --git a/App.tsx b/App.tsx index 8322053..06537cd 100644 --- a/App.tsx +++ b/App.tsx @@ -4,6 +4,9 @@ import { RecoilRoot } from 'recoil'; import SplashPage from './src/components/SplashPage'; import RootNavigator from './src/components/navigation/RootNavigator'; +import { enableScreens } from 'react-native-screens'; +enableScreens(); + const App = () => ( diff --git a/android/app/src/main/java/com/subsonify/MainActivity.java b/android/app/src/main/java/com/subsonify/MainActivity.java index 572ac48..4c1957a 100644 --- a/android/app/src/main/java/com/subsonify/MainActivity.java +++ b/android/app/src/main/java/com/subsonify/MainActivity.java @@ -1,6 +1,7 @@ package com.subsonify; import com.facebook.react.ReactActivity; +import android.os.Bundle; public class MainActivity extends ReactActivity { @@ -12,4 +13,9 @@ public class MainActivity extends ReactActivity { protected String getMainComponentName() { return "SubSonify"; } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(null); + } } diff --git a/src/components/common/BottomTabBar.tsx b/src/components/common/BottomTabBar.tsx index 417e526..2d47dd9 100644 --- a/src/components/common/BottomTabBar.tsx +++ b/src/components/common/BottomTabBar.tsx @@ -75,7 +75,7 @@ const BottomTabBar: React.FC = ({ state, descriptors, navigat }} /> {label} diff --git a/src/components/library/AlbumsTab.tsx b/src/components/library/AlbumsTab.tsx index fa23645..ffb9482 100644 --- a/src/components/library/AlbumsTab.tsx +++ b/src/components/library/AlbumsTab.tsx @@ -12,22 +12,42 @@ import LinearGradient from 'react-native-linear-gradient'; const AlbumArt: React.FC<{ height: number, width: number, id?: string }> = ({ height, width, id }) => { const coverArtSource = useCoverArtUri(id); - return ( + // useEffect(() => { + // console.log(id); + // }); + + const Placeholder = ( - ) + ); + + const CoverArt = ( + + + + ); + + return coverArtSource ? CoverArt : Placeholder; } const AlbumItem: React.FC<{ id: string } > = ({ id }) => { @@ -37,23 +57,46 @@ const AlbumItem: React.FC<{ id: string } > = ({ id }) => { // console.log(album.name); // }); + const size = 180; + return ( - {album.name} + + + {album.name} + + + {album.name} + + ); } @@ -83,26 +126,19 @@ const AlbumsList = () => { if (!refreshing && albumIds.length === 0) { refresh(); } - }) + }); return ( - {/*