remove/disable download options

This commit is contained in:
austinried
2021-08-16 11:05:38 +09:00
parent d72258c68e
commit ad25972774
7 changed files with 84 additions and 62 deletions

View File

@@ -13,7 +13,7 @@ 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'
import IconMat from 'react-native-vector-icons/MaterialIcons'
// import IconMat from 'react-native-vector-icons/MaterialIcons'
import CoverArt from './CoverArt'
import Star from './Star'
@@ -200,11 +200,11 @@ const OptionViewAlbum = React.memo<{
)
})
const OptionDownload = React.memo<{
itemType: string
}>(({ itemType }) => (
<ContextMenuIconTextOption IconComponent={IconMat} name="file-download" size={26} text={`Download ${itemType}`} />
))
// const OptionDownload = React.memo<{
// itemType: string
// }>(({ itemType }) => (
// <ContextMenuIconTextOption IconComponent={IconMat} name="file-download" size={26} text={`Download ${itemType}`} />
// ))
export type AlbumContextPressableProps = ContextMenuProps & {
album: AlbumListItem
@@ -222,7 +222,7 @@ export const AlbumContextPressable: React.FC<AlbumContextPressableProps> = props
<>
<OptionStar id={album.id} type={album.itemType} />
<OptionViewArtist artist={album.artist} artistId={album.artistId} navigation={navigation} />
<OptionDownload itemType={album.itemType} />
{/* <OptionDownload itemType={album.itemType} /> */}
</>
}>
{children}
@@ -247,7 +247,7 @@ export const SongContextPressable: React.FC<SongContextPressableProps> = props =
<OptionStar id={song.id} type={song.itemType} />
<OptionViewArtist artist={song.artist} artistId={song.artistId} navigation={navigation} />
<OptionViewAlbum album={song.album} albumId={song.albumId} navigation={navigation} />
<OptionDownload itemType={song.itemType} />
{/* <OptionDownload itemType={song.itemType} /> */}
</>
}>
{children}
@@ -269,7 +269,7 @@ export const ArtistContextPressable: React.FC<ArtistContextPressableProps> = pro
menuOptions={
<>
<OptionStar id={artist.id} type={artist.itemType} />
<OptionDownload itemType={artist.itemType} />
{/* <OptionDownload itemType={artist.itemType} /> */}
</>
}>
{children}

View File

@@ -18,6 +18,7 @@ const ImageGradientBackground: React.FC<{
useEffect(() => {
async function getColors() {
console.log(`imagePath: ${imagePath}`)
if (imagePath === undefined) {
return
}
@@ -26,6 +27,7 @@ const ImageGradientBackground: React.FC<{
let res: AndroidImageColors
if (cachedResult) {
console.log(`cachedResult: ${JSON.stringify(cachedResult)}`)
res = cachedResult as AndroidImageColors
} else {
const path = `file://${imagePath}`
@@ -33,12 +35,21 @@ const ImageGradientBackground: React.FC<{
cache: true,
key: imagePath,
})) as AndroidImageColors
console.log(`res: ${JSON.stringify(res)}`)
}
if (res.muted && res.muted !== '#000000') {
setHighColor(res.muted)
} else if (res.darkMuted && res.darkMuted !== '#000000') {
setHighColor(res.darkMuted)
} else if (res.lightMuted && res.lightMuted !== '#000000') {
setHighColor(res.lightMuted)
} else if (res.vibrant && res.vibrant !== '#000000') {
setHighColor(res.vibrant)
} else if (res.darkVibrant && res.darkVibrant !== '#000000') {
setHighColor(res.darkVibrant)
} else if (res.lightVibrant && res.lightVibrant !== '#000000') {
setHighColor(res.lightVibrant)
}
}
getColors()

View File

@@ -26,12 +26,10 @@ const TitleTextSong = React.memo<{
return (
<View style={styles.textLine}>
<Text style={[styles.title, { color: playing ? colors.accent : colors.text.primary }]}>
{playing ? (
{playing && (
<View style={styles.playingIcon}>
<IconFA5 name="play" size={9} color={colors.accent} />
</View>
) : (
<></>
)}
{title}
</Text>
@@ -159,35 +157,29 @@ const ListItem: React.FC<{
return (
<View style={[styles.container, sizeStyle.container]}>
<PressableComponent>
{showArt ? coverArt : <></>}
{showArt && coverArt}
<View style={styles.text}>
{title}
{subtitle ? (
{subtitle !== undefined && (
<View style={styles.textLine}>
{starred ? (
{false && (
<IconMat
name="file-download-done"
size={17}
color={colors.text.secondary}
style={styles.downloadedIcon}
/>
) : (
<></>
)}
<Text style={styles.subtitle}>{subtitle}</Text>
</View>
) : (
<></>
)}
</View>
</PressableComponent>
<View style={styles.controls}>
{showStar ? (
{showStar && (
<PressableOpacity onPress={toggleStarred} style={styles.controlItem}>
<Star size={26} starred={starred} />
</PressableOpacity>
) : (
<></>
)}
</View>
</View>

View File

@@ -22,7 +22,10 @@ const ListPlayerControls = React.memo<{
return (
<View style={[styles.controls, style]}>
<View style={styles.controlsSide}>
<Button buttonStyle={downloaded ? 'highlight' : 'hollow'} onPress={() => setDownloaded(!downloaded)}>
<Button
disabled={true}
buttonStyle={downloaded ? 'highlight' : 'hollow'}
onPress={() => setDownloaded(!downloaded)}>
{downloaded ? (
<IconMat name="file-download-done" size={26} color={colors.text.primary} />
) : (