-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from TriPSs/feature/new-design
Feature/new design
- Loading branch information
Showing
94 changed files
with
3,145 additions
and
1,906 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<background android:drawable="@color/ic_launcher_background"/> | ||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
</adaptive-icon> |
5 changes: 5 additions & 0 deletions
5
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<background android:drawable="@color/ic_launcher_background"/> | ||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
</adaptive-icon> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="background">#111214</color> | ||
<color name="background_secondary">#0D0E0F</color> | ||
<color name="dropdown_background">#212225</color> | ||
<color name="background">#000000</color> | ||
|
||
<color name="text_color">#FAFAFA</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="ic_launcher_background">#000000</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,130 +1,82 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { StyleSheet, View, Image, Dimensions, StatusBar } from 'react-native' | ||
import { StyleSheet, View, Dimensions } from 'react-native' | ||
import Device from 'modules/DeviceDetection' | ||
|
||
import posterHolderImage from 'images/posterholder.png' | ||
import colors from 'modules/colors' | ||
import dimensions from 'modules/dimensions' | ||
|
||
import BaseButton from '../BaseButton' | ||
import Overlay from '../Overlay' | ||
import Image from '../Image' | ||
|
||
const { width, height } = Dimensions.get('window') | ||
|
||
const smallHeight = (height - StatusBar.currentHeight) / 4 | ||
const smallWidth = (width - 40) / 3.1 | ||
const mediumHeight = height - StatusBar.currentHeight / 3.3 | ||
const mediumWidth = (width - 40) / 3.5 | ||
const { width } = Dimensions.get('window') | ||
|
||
const rootWidth = (width - (Device.isTablet ? 40 : 32)) / (Device.isTablet ? 4 : 3) | ||
|
||
const styles = StyleSheet.create({ | ||
|
||
root: { | ||
height : (rootWidth * 1.5), | ||
width : rootWidth, | ||
marginLeft : 4, | ||
marginRight: 4, | ||
alignSelf : 'stretch', | ||
position : 'relative', | ||
height : (rootWidth * 1.5), | ||
width : rootWidth, | ||
alignSelf : 'stretch', | ||
position : 'relative', | ||
borderRadius : dimensions.BORDER_RADIUS, | ||
overflow : 'hidden', | ||
backgroundColor: colors.BACKGROUND_LIGHTER, | ||
}, | ||
|
||
default: {}, | ||
|
||
small: { | ||
height: smallHeight, | ||
width : smallWidth, | ||
height: dimensions.CARD_SMALL_HEIGHT, | ||
width : dimensions.CARD_SMALL_WIDTH, | ||
}, | ||
|
||
// For now is this only correct for Tablet | ||
medium: { | ||
height: mediumHeight, | ||
width : mediumWidth, | ||
}, | ||
|
||
image: { | ||
height: '100%', | ||
width : '100%', | ||
height: dimensions.CARD_MEDIUM_HEIGHT, | ||
width : dimensions.CARD_MEDIUM_WIDTH, | ||
}, | ||
|
||
overlay: { | ||
position: 'absolute', | ||
top : 0, | ||
left : 0, | ||
height : '100%', | ||
width : '100%', | ||
opacity : 0.8, | ||
}) | ||
|
||
backgroundColor: '#000', | ||
}, | ||
export const Card = ({ item, variant, empty, ...rest }) => { | ||
return ( | ||
<BaseButton | ||
// onLongPress={() => console.warn(item.title)} | ||
// onPress={() => this.openItem(item)} | ||
{...rest}> | ||
<View style={[styles.root, styles[variant]]}> | ||
<Image | ||
images={ | ||
empty | ||
? {} | ||
: item.images | ||
} /> | ||
|
||
{item && item.watched && item.watched.complete && ( | ||
<Overlay variant={'dark'} /> | ||
)} | ||
|
||
</View> | ||
</BaseButton> | ||
) | ||
} | ||
|
||
}) | ||
Card.propTypes = { | ||
item : PropTypes.object, | ||
empty : PropTypes.bool, | ||
variant: PropTypes.oneOf([ | ||
'default', | ||
'medium', | ||
'small', | ||
]), | ||
} | ||
|
||
export default class Card extends React.PureComponent { | ||
|
||
static propTypes = { | ||
item : PropTypes.object, | ||
empty : PropTypes.bool, | ||
variant: PropTypes.oneOf([ | ||
'default', | ||
'medium', | ||
'small', | ||
]), | ||
} | ||
|
||
static defaultProps = { | ||
item : null, | ||
empty : false, | ||
variant: 'default', | ||
} | ||
|
||
constructor(props) { | ||
super(props) | ||
|
||
const { item, empty } = props | ||
|
||
this.state = { | ||
showPlaceholder: empty || !item.images.poster.thumb, | ||
} | ||
} | ||
|
||
handleImageError = () => { | ||
this.setState({ | ||
showPlaceholder: true, | ||
}) | ||
} | ||
|
||
getImage = () => { | ||
const { item, empty } = this.props | ||
const { showPlaceholder } = this.state | ||
|
||
if (showPlaceholder || empty) { | ||
return posterHolderImage | ||
} | ||
|
||
return { uri: item.images.poster.thumb } | ||
} | ||
|
||
render() { | ||
const { item, variant, empty, ...rest } = this.props | ||
|
||
return ( | ||
<BaseButton | ||
// onLongPress={() => console.warn(item.title)} | ||
// onPress={() => this.openItem(item)} | ||
{...rest}> | ||
<View style={[styles.root, styles[variant]]}> | ||
<Image | ||
style={styles.image} | ||
defaultSource={posterHolderImage} | ||
onError={this.handleImageError} | ||
source={this.getImage()} | ||
/> | ||
|
||
{item && item.watched && item.watched.complete && ( | ||
<View style={styles.overlay} /> | ||
)} | ||
|
||
</View> | ||
</BaseButton> | ||
) | ||
} | ||
Card.defaultProps = { | ||
item : null, | ||
empty : false, | ||
variant: 'default', | ||
} | ||
|
||
export default Card |
Oops, something went wrong.