clean up round 1

remove fast-image, switched to all image
cleaned up icons
added fading splash page
This commit is contained in:
austinried
2021-08-22 17:44:42 +09:00
parent cb824f76ca
commit 1508a35a76
35 changed files with 134 additions and 95 deletions

View File

@@ -9,7 +9,6 @@ import { NavigationProp, useNavigation } from '@react-navigation/native'
import { ReactComponentLike } from 'prop-types'
import React from 'react'
import { ScrollView, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native'
import FastImage from 'react-native-fast-image'
import { Menu, MenuOption, MenuOptions, MenuTrigger, renderers } from 'react-native-popup-menu'
import IconFA from 'react-native-vector-icons/FontAwesome'
import IconFA5 from 'react-native-vector-icons/FontAwesome5'
@@ -121,15 +120,9 @@ const MenuHeader = React.memo<{
}>(({ coverArt, artistId, title, subtitle }) => (
<View style={styles.menuHeader}>
{artistId ? (
<CoverArt
type="artist"
artistId={artistId}
style={styles.coverArt}
resizeMode={FastImage.resizeMode.cover}
round={true}
/>
<CoverArt type="artist" artistId={artistId} style={styles.coverArt} resizeMode={'cover'} round={true} />
) : (
<CoverArt type="cover" coverArt={coverArt} style={styles.coverArt} resizeMode={FastImage.resizeMode.cover} />
<CoverArt type="cover" coverArt={coverArt} style={styles.coverArt} resizeMode={'cover'} />
)}
<View style={styles.menuHeaderText}>
<Text numberOfLines={1} style={styles.menuTitle}>

View File

@@ -2,13 +2,21 @@ import { useArtistArtFile, useCoverArtFile } from '@app/hooks/cache'
import { CacheFile, CacheImageSize, CacheRequest } from '@app/models/cache'
import colors from '@app/styles/colors'
import React, { useState } from 'react'
import { ActivityIndicator, StyleSheet, View, ViewStyle, Image, ImageStyle, ImageSourcePropType } from 'react-native'
import FastImage from 'react-native-fast-image'
import {
ActivityIndicator,
Image,
ImageResizeMode,
ImageSourcePropType,
ImageStyle,
StyleSheet,
View,
ViewStyle,
} from 'react-native'
type BaseProps = {
style?: ViewStyle
imageStyle?: ImageStyle
resizeMode?: keyof typeof FastImage.resizeMode
resizeMode?: ImageResizeMode
round?: boolean
size?: CacheImageSize
}
@@ -39,7 +47,7 @@ const ImageSource = React.memo<{ cache?: { file?: CacheFile; request?: CacheRequ
<Image
source={source}
fadeDuration={150}
resizeMode={resizeMode || FastImage.resizeMode.contain}
resizeMode={resizeMode || 'contain'}
style={[{ height: style?.height, width: style?.width }, imageStyle]}
onError={() => setError(true)}
/>

View File

@@ -78,7 +78,7 @@ const styles = StyleSheet.create({
maxWidth: 145,
},
optionsContainer: {
backgroundColor: 'rgba(45, 45, 45, 0.95)',
backgroundColor: colors.gradient.high,
maxWidth: 145,
},
option: {

View File

@@ -8,7 +8,6 @@ import font from '@app/styles/font'
import { useNavigation } from '@react-navigation/native'
import React, { useCallback } from 'react'
import { StyleSheet, Text, View } from 'react-native'
import FastImage from 'react-native-fast-image'
import IconFA5 from 'react-native-vector-icons/FontAwesome5'
import IconMat from 'react-native-vector-icons/MaterialIcons'
import { AlbumContextPressable, ArtistContextPressable, SongContextPressable } from './ContextMenu'
@@ -148,7 +147,7 @@ const ListItem: React.FC<{
}
const artStyle = { ...styles.art, ...sizeStyle.art }
const resizeMode = FastImage.resizeMode.cover
const resizeMode = 'cover'
let coverArt = <></>
if (item.itemType === 'artist') {
coverArt = <CoverArt type="artist" artistId={item.id} round={true} style={artStyle} resizeMode={resizeMode} />