Merge branch 'master' of github.com:esteemapp/esteem-mobile

This commit is contained in:
Feruz 2018-12-16 20:08:25 +02:00
commit 7f1a37d2be
10 changed files with 283 additions and 22 deletions

View File

@ -1,7 +1,7 @@
### eSteem Mobile
iOS ![iOS](https://build.appcenter.ms/v0.1/apps/fc3725c3-719b-4081-8c1b-e65921f76aba/branches/master/badge)
Android ![Android](https://build.appcenter.ms/v0.1/apps/3df3ec7f-c9a2-457b-b132-94dbd7db99db/branches/master/badge)
iOS ![iOS](https://build.appcenter.ms/v0.1/apps/ef80aa2a-d4e1-4f43-a4f8-be12ea72ba9b/branches/master/badge)
Android ![Android](https://build.appcenter.ms/v0.1/apps/12aace32-b58a-49da-bf85-5477f89ae16e/branches/master/badge)
### I. How do I get set up?

View File

@ -7,30 +7,33 @@
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B9ACF6901AD9FA03B3DE721FDBC13721"
BlueprintIdentifier = "0447315A437E159623BB7CFF7F9F90E0"
BuildableName = "QBImagePicker.bundle"
BlueprintName = "QBImagePickerController-QBImagePicker"
ReferencedContainer = "container:Pods.xcodeproj"
BuildableName = "QBImagePickerController-QBImagePicker.bundle">
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
@ -38,17 +41,25 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0447315A437E159623BB7CFF7F9F90E0"
BuildableName = "QBImagePicker.bundle"
BlueprintName = "QBImagePickerController-QBImagePicker"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@ -8,56 +8,93 @@
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>FLAnimatedImage.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>65</integer>
</dict>
<key>Folly.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>Pods-eSteem-tvOS.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>8</integer>
</dict>
<key>Pods-eSteem-tvOSTests.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>9</integer>
</dict>
<key>Pods-eSteem.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>7</integer>
</dict>
<key>Pods-eSteemTests.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>10</integer>
</dict>
<key>QBImagePickerController-QBImagePicker.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>12</integer>
</dict>
<key>QBImagePickerController.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>11</integer>
</dict>
<key>RNImageCropPicker.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>16</integer>
</dict>
<key>RSKImageCropper.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>17</integer>
</dict>
<key>SDWebImage.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>67</integer>
</dict>
<key>glog.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
<key>react-native-fast-image.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>66</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>eSteem-tvOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>eSteem-tvOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>eSteem.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -31,10 +31,7 @@ class PostButtonContainer extends Component {
_handleButtonCollapse = (status) => {
const { dispatch, isCollapsePostButtonOpen } = this.props;
if (isCollapsePostButtonOpen !== status) {
dispatch(isCollapsePostButton(status));
}
dispatch(isCollapsePostButton(!isCollapsePostButtonOpen));
};
render() {

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import {
Animated, Easing, TouchableOpacity, View,
Animated, Easing, TouchableOpacity, View, Platform,
} from 'react-native';
import { Icon } from '../../icon';
@ -116,8 +116,7 @@ class PostButtonView extends Component {
outputRange: ['0deg', '45deg'],
});
const { handleSubButtonPress } = this.props;
const { handleSubButtonPress, handleButtonCollapse } = this.props;
return (
<View style={styles.postButtonWrapper}>
<SubPostButton
@ -147,7 +146,10 @@ class PostButtonView extends Component {
icon="camera"
onPress={() => handleSubButtonPress(ROUTES.SCREENS.EDITOR, 'image')}
/>
<TouchableOpacity onPress={() => this._toggleView()} activeOpacity={1}>
<TouchableOpacity
onPress={() => (Platform.OS === 'ios' ? this._toggleView() : handleButtonCollapse())}
activeOpacity={1}
>
<Animated.View
style={[
styles.postButton,

View File

@ -0,0 +1,179 @@
import React, { Component } from 'react';
import { Animated, Easing, View } from 'react-native';
import { connect } from 'react-redux';
import { withNavigation } from 'react-navigation';
// Components
import SubPostButton from './subPostButtonView';
import { isCollapsePostButton } from '../../../redux/actions/uiAction';
// Constant
import { default as ROUTES } from '../../../constants/routeNames';
// Styles
import styles from './postButtonStyles';
const SIZE = 60;
const durationIn = 300;
const durationOut = 200;
class PostButtonsForAndroid extends Component {
mode = new Animated.Value(0);
icon1 = new Animated.Value(0);
icon2 = new Animated.Value(0);
icon3 = new Animated.Value(0);
constructor(props) {
super(props);
this.state = {
isCollapse: false,
};
}
componentWillReceiveProps(nextProps) {
console.log('nextProps :', nextProps);
// For closing sub buttons
const { routes, isCollapsePostButtonOpen } = this.props;
const nextRouteName = nextProps.routes[0].routes[nextProps.routes[0].routes.length - 1].routeName;
const routeName = routes[0].routes[routes[0].routes.length - 1].routeName;
const { isCollapse } = this.state;
if (
(routeName !== nextRouteName && nextRouteName !== ROUTES.DRAWER.MAIN)
|| (isCollapsePostButtonOpen !== nextProps.isCollapsePostButtonOpen
&& isCollapse !== nextProps.isCollapsePostButtonOpen)
) {
this._toggleView();
}
}
_toggleView = () => {
const { isCollapse } = this.state;
if (this.mode._value) {
Animated.parallel(
[this.mode, this.icon1, this.icon2, this.icon3].map(item => Animated.timing(item, {
toValue: 0,
duration: durationIn,
easing: Easing.cubic,
})),
).start();
} else {
Animated.parallel([
Animated.timing(this.mode, {
toValue: 1,
duration: durationOut,
easing: Easing.cubic,
}),
Animated.sequence([
...[this.icon1, this.icon2, this.icon3].map(item => Animated.timing(item, {
toValue: 1,
duration: durationOut,
easing: Easing.elastic(1),
})),
]),
]).start();
}
this.setState({ isCollapse: !isCollapse });
this._handleButtonCollapse(!isCollapse);
};
_handleButtonCollapse = (status) => {
const { dispatch, isCollapsePostButtonOpen } = this.props;
if (isCollapsePostButtonOpen !== status) {
dispatch(isCollapsePostButton(status));
}
};
_handleSubButtonPress = (route, action) => {
const { navigation } = this.props;
navigation.navigate({
routeName: route,
params: {
action,
},
});
// navigation.navigate(route);
};
render() {
const firstX = this.icon1.interpolate({
inputRange: [0, 1],
outputRange: [0, -50],
});
const firstY = this.icon1.interpolate({
inputRange: [0, 1],
outputRange: [0, -70],
});
const secondX = this.icon2.interpolate({
inputRange: [0, 1],
outputRange: [0, 0],
});
const secondY = this.icon2.interpolate({
inputRange: [0, 1],
outputRange: [0, -95],
});
const thirdX = this.icon3.interpolate({
inputRange: [0, 1],
outputRange: [0, 50],
});
const thirdY = this.icon3.interpolate({
inputRange: [0, 1],
outputRange: [0, -70],
});
return (
<View
style={{
justifyContent: 'center',
}}
>
<SubPostButton
size={SIZE}
style={{
left: firstX,
top: firstY,
position: 'relative',
}}
icon="video-camera"
onPress={() => this._handleSubButtonPress(ROUTES.SCREENS.EDITOR, 'camera')}
/>
<SubPostButton
size={SIZE}
style={{
left: secondX,
top: secondY,
position: 'relative',
}}
icon="pencil"
onPress={() => this._handleSubButtonPress(ROUTES.SCREENS.EDITOR)}
/>
<SubPostButton
size={SIZE}
style={{
left: thirdX,
top: thirdY,
position: 'relative',
}}
icon="camera"
onPress={() => this._handleSubButtonPress(ROUTES.SCREENS.EDITOR, 'image')}
/>
</View>
);
}
}
const mapStateToProps = state => ({
routes: state.nav.routes,
isCollapsePostButtonOpen: state.ui.isCollapsePostButton,
});
export default connect(mapStateToProps)(withNavigation(PostButtonsForAndroid));

View File

@ -1,5 +1,5 @@
import React, { Component, Fragment } from 'react';
import { AppState } from 'react-native';
import { AppState, Platform } from 'react-native';
import { connect } from 'react-redux';
import Push from 'appcenter-push';
@ -10,6 +10,7 @@ import { getExistUser } from '../../../realm/realm';
// Components
import { Modal } from '../../../components';
import { PinCode } from '../..';
import PostButtonForAndroid from '../../../components/postButton/view/postButtonsForAndroid';
// Constants
import ROUTES from '../../../constants/routeNames';
@ -108,6 +109,7 @@ const RootContainer = () => (WrappedComponent) => {
{...wrappedComponentStates}
setPinCodeState={this._setPinCodeState}
/>
{Platform.OS === 'android' && <PostButtonForAndroid />}
</Fragment>
);
}