Skip to content

Commit e05c007

Browse files
authored
Merge pull request #47 from TriPSs/feature/new-design
Feature/new design
2 parents 019d010 + f78340a commit e05c007

File tree

94 files changed

+3145
-1906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3145
-1906
lines changed

.babelrc

-28
This file was deleted.

.github/home-bottom.jpg

-1.22 MB
Binary file not shown.

.github/home-bottom.png

1.59 MB
Loading

.github/home.jpg

-1.65 MB
Binary file not shown.

.github/home.png

1.67 MB
Loading

.github/movie.jpg

-891 KB
Binary file not shown.

.github/movie.png

872 KB
Loading

.github/show.jpg

-707 KB
Binary file not shown.

.github/show.png

735 KB
Loading

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 align="center">
2-
<img height="200" width="200" src="./app/images/logo.png" alt="logo" />
2+
<img height="200" width="200" src="./logo.png" alt="logo" />
33
<br />
44
Popcorn Native
55
</h1>
@@ -57,9 +57,9 @@ Please see the [contributing guide](https://github.com/tripss/popcorn-native/blo
5757

5858
Home Screen | Home Screen
5959
:-------------------------:|:-------------------------:
60-
![Home Screen](./.github/home.jpg) | ![Home Screen](./.github/home-bottom.jpg)
60+
![Home Screen](./.github/home.png) | ![Home Screen](./.github/home-bottom.png)
6161

6262
Show Screen | Movie Screen
6363
:-------------------------:|:-------------------------:
64-
![Shows Screen](./.github/show.jpg) |![Show Screen](./.github/movie.jpg)
64+
![Shows Screen](./.github/show.png) |![Show Screen](./.github/movie.png)
6565

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ android {
122122
applicationId "com.popcorn"
123123
minSdkVersion rootProject.ext.minSdkVersion
124124
targetSdkVersion rootProject.ext.targetSdkVersion
125-
versionCode 20
126-
versionName "v0.15.0"
125+
versionCode 21
126+
versionName "v0.16.0"
127127
ndk {
128128
abiFilters "armeabi-v7a", "x86"
129129
}
95 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>
Loading
Loading
Loading
-722 Bytes
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<color name="background">#111214</color>
4-
<color name="background_secondary">#0D0E0F</color>
5-
<color name="dropdown_background">#212225</color>
3+
<color name="background">#000000</color>
64

75
<color name="text_color">#FAFAFA</color>
86
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_launcher_background">#000000</color>
4+
</resources>

android/app/src/main/res/values/styles.xml

+1-18
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
<item name="colorAccent">@color/text_color</item>
77

88
<item name="android:windowBackground">@color/background</item>
9-
<item name="android:spinnerItemStyle">@style/SpinnerItem</item>
10-
<item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
11-
<item name="android:navigationBarColor">@color/background_secondary</item>
9+
<item name="android:navigationBarColor">@color/background</item>
1210

1311
<item name="castExpandedControllerToolbarStyle">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
1412
<item name="castExpandedControllerStyle">@style/CustomCastExpandedController</item>
@@ -24,19 +22,4 @@
2422
<item name="android:windowBackground">@color/background</item>
2523
</style>
2624

27-
<style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">>
28-
<item name="android:textColor">@color/text_color</item>
29-
<item name="android:textSize">18dp</item>
30-
<item name="android:fontFamily">Roboto-Bold</item>
31-
<item name="android:gravity">center</item>
32-
</style>
33-
34-
<style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">>
35-
<item name="android:textColor">@color/text_color</item>
36-
<item name="android:textSize">18dp</item>
37-
<item name="android:fontFamily">Roboto-Bold</item>
38-
<item name="android:background">@color/dropdown_background</item>
39-
<item name="android:gravity">center</item>
40-
</style>
41-
4225
</resources>

android/build.gradle

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buildscript {
1515
google()
1616
}
1717
dependencies {
18-
classpath 'com.android.tools.build:gradle:3.2.0'
18+
classpath 'com.android.tools.build:gradle:3.3.0'
1919

2020
// NOTE: Do not place your application dependencies here; they belong
2121
// in the individual module build.gradle files
@@ -42,8 +42,7 @@ allprojects {
4242
subprojects {
4343
project.configurations.all {
4444
resolutionStrategy.eachDependency { details ->
45-
if (details.requested.group == 'com.android.support'
46-
&& !details.requested.name.contains('multidex')) {
45+
if (details.requested.group == 'com.android.support' && !details.requested.name.contains('multidex')) {
4746
details.useVersion "26.0.0"
4847
}
4948
}

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

app/components/Button/Button.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import PropTypes from 'prop-types'
33
import { StyleSheet } from 'react-native'
44

55
import colors from 'modules/colors'
6+
import dimensions from 'modules/dimensions'
67

78
import TextButton from '../TextButton'
89

910
const defaultPadding = {
10-
paddingLeft : 16,
11-
paddingRight : 16,
12-
paddingTop : 8,
13-
paddingBottom: 8,
14-
borderRadius : 4,
11+
paddingLeft : dimensions.UNIT * 2,
12+
paddingRight : dimensions.UNIT * 2,
13+
paddingTop : dimensions.UNIT,
14+
paddingBottom: dimensions.UNIT,
15+
borderRadius : dimensions.BORDER_RADIUS,
1516
}
1617

1718
export const styles = StyleSheet.create({

app/components/Card/Card.js

+55-103
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,82 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import { StyleSheet, View, Image, Dimensions, StatusBar } from 'react-native'
3+
import { StyleSheet, View, Dimensions } from 'react-native'
44
import Device from 'modules/DeviceDetection'
55

6-
import posterHolderImage from 'images/posterholder.png'
6+
import colors from 'modules/colors'
7+
import dimensions from 'modules/dimensions'
78

89
import BaseButton from '../BaseButton'
10+
import Overlay from '../Overlay'
11+
import Image from '../Image'
912

10-
const { width, height } = Dimensions.get('window')
11-
12-
const smallHeight = (height - StatusBar.currentHeight) / 4
13-
const smallWidth = (width - 40) / 3.1
14-
const mediumHeight = height - StatusBar.currentHeight / 3.3
15-
const mediumWidth = (width - 40) / 3.5
13+
const { width } = Dimensions.get('window')
1614

1715
const rootWidth = (width - (Device.isTablet ? 40 : 32)) / (Device.isTablet ? 4 : 3)
1816

1917
const styles = StyleSheet.create({
2018

2119
root: {
22-
height : (rootWidth * 1.5),
23-
width : rootWidth,
24-
marginLeft : 4,
25-
marginRight: 4,
26-
alignSelf : 'stretch',
27-
position : 'relative',
20+
height : (rootWidth * 1.5),
21+
width : rootWidth,
22+
alignSelf : 'stretch',
23+
position : 'relative',
24+
borderRadius : dimensions.BORDER_RADIUS,
25+
overflow : 'hidden',
26+
backgroundColor: colors.BACKGROUND_LIGHTER,
2827
},
2928

3029
default: {},
3130

3231
small: {
33-
height: smallHeight,
34-
width : smallWidth,
32+
height: dimensions.CARD_SMALL_HEIGHT,
33+
width : dimensions.CARD_SMALL_WIDTH,
3534
},
3635

37-
// For now is this only correct for Tablet
3836
medium: {
39-
height: mediumHeight,
40-
width : mediumWidth,
41-
},
42-
43-
image: {
44-
height: '100%',
45-
width : '100%',
37+
height: dimensions.CARD_MEDIUM_HEIGHT,
38+
width : dimensions.CARD_MEDIUM_WIDTH,
4639
},
4740

48-
overlay: {
49-
position: 'absolute',
50-
top : 0,
51-
left : 0,
52-
height : '100%',
53-
width : '100%',
54-
opacity : 0.8,
41+
})
5542

56-
backgroundColor: '#000',
57-
},
43+
export const Card = ({ item, variant, empty, ...rest }) => {
44+
return (
45+
<BaseButton
46+
// onLongPress={() => console.warn(item.title)}
47+
// onPress={() => this.openItem(item)}
48+
{...rest}>
49+
<View style={[styles.root, styles[variant]]}>
50+
<Image
51+
images={
52+
empty
53+
? {}
54+
: item.images
55+
} />
56+
57+
{item && item.watched && item.watched.complete && (
58+
<Overlay variant={'dark'} />
59+
)}
60+
61+
</View>
62+
</BaseButton>
63+
)
64+
}
5865

59-
})
66+
Card.propTypes = {
67+
item : PropTypes.object,
68+
empty : PropTypes.bool,
69+
variant: PropTypes.oneOf([
70+
'default',
71+
'medium',
72+
'small',
73+
]),
74+
}
6075

61-
export default class Card extends React.PureComponent {
62-
63-
static propTypes = {
64-
item : PropTypes.object,
65-
empty : PropTypes.bool,
66-
variant: PropTypes.oneOf([
67-
'default',
68-
'medium',
69-
'small',
70-
]),
71-
}
72-
73-
static defaultProps = {
74-
item : null,
75-
empty : false,
76-
variant: 'default',
77-
}
78-
79-
constructor(props) {
80-
super(props)
81-
82-
const { item, empty } = props
83-
84-
this.state = {
85-
showPlaceholder: empty || !item.images.poster.thumb,
86-
}
87-
}
88-
89-
handleImageError = () => {
90-
this.setState({
91-
showPlaceholder: true,
92-
})
93-
}
94-
95-
getImage = () => {
96-
const { item, empty } = this.props
97-
const { showPlaceholder } = this.state
98-
99-
if (showPlaceholder || empty) {
100-
return posterHolderImage
101-
}
102-
103-
return { uri: item.images.poster.thumb }
104-
}
105-
106-
render() {
107-
const { item, variant, empty, ...rest } = this.props
108-
109-
return (
110-
<BaseButton
111-
// onLongPress={() => console.warn(item.title)}
112-
// onPress={() => this.openItem(item)}
113-
{...rest}>
114-
<View style={[styles.root, styles[variant]]}>
115-
<Image
116-
style={styles.image}
117-
defaultSource={posterHolderImage}
118-
onError={this.handleImageError}
119-
source={this.getImage()}
120-
/>
121-
122-
{item && item.watched && item.watched.complete && (
123-
<View style={styles.overlay} />
124-
)}
125-
126-
</View>
127-
</BaseButton>
128-
)
129-
}
76+
Card.defaultProps = {
77+
item : null,
78+
empty : false,
79+
variant: 'default',
13080
}
81+
82+
export default Card

0 commit comments

Comments
 (0)