Fabric and image fix (#284)

* Fixed images not showing

* Keyboard libs updated
This commit is contained in:
Diego Mello 2018-04-26 14:33:43 -03:00 committed by Guilherme Gazzo
parent 557e485613
commit 96914f3869
12 changed files with 59 additions and 47 deletions

View File

@ -96,7 +96,7 @@ android {
defaultConfig { defaultConfig {
applicationId "chat.rocket.reactnative" applicationId "chat.rocket.reactnative"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 23
versionCode VERSIONCODE as Integer versionCode VERSIONCODE as Integer
versionName "1" versionName "1"
ndk { ndk {
@ -191,7 +191,7 @@ dependencies {
compile "com.facebook.react:react-native:+" // From node_modules compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.facebook.fresco:fresco:1.7.1' compile 'com.facebook.fresco:fresco:1.7.1'
compile 'com.facebook.fresco:animated-gif:1.7.1' compile 'com.facebook.fresco:animated-gif:1.7.1'
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') { compile('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
transitive = true; transitive = true;
} }
} }

View File

@ -87,7 +87,12 @@
} }
# For Fabric to properly de-obfuscate your crash reports, you need to remove this line from your ProGuard config: # For Fabric to properly de-obfuscate your crash reports, you need to remove this line from your ProGuard config:
-printmapping mapping.txt # -printmapping mapping.txt
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
-dontwarn javax.annotation.** -dontwarn javax.annotation.**
-dontwarn com.facebook.infer.** -dontwarn com.facebook.infer.**

View File

@ -6,7 +6,6 @@ import ImagePicker from 'react-native-image-picker';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { emojify } from 'react-emojione'; import { emojify } from 'react-emojione';
import { KeyboardAccessoryView } from 'react-native-keyboard-input'; import { KeyboardAccessoryView } from 'react-native-keyboard-input';
import { isIphoneX } from 'react-native-iphone-x-helper';
import { userTyping, layoutAnimation } from '../../actions/room'; import { userTyping, layoutAnimation } from '../../actions/room';
import RocketChat from '../../lib/rocketchat'; import RocketChat from '../../lib/rocketchat';
@ -504,20 +503,18 @@ export default class MessageBox extends React.PureComponent {
render() { render() {
return ( return (
[ <KeyboardAccessoryView
<KeyboardAccessoryView key='input'
key='input' renderContent={() => this.renderContent()}
renderContent={() => this.renderContent()} kbInputRef={this.component}
kbInputRef={this.component} kbComponent={this.state.showEmojiKeyboard ? 'EmojiKeyboard' : null}
kbComponent={this.state.showEmojiKeyboard ? 'EmojiKeyboard' : null} onKeyboardResigned={() => this.onKeyboardResigned()}
onKeyboardResigned={() => this.onKeyboardResigned()} onItemSelected={this._onEmojiSelected}
onItemSelected={this._onEmojiSelected} trackInteractive
trackInteractive // revealKeyboardInteractive
// revealKeyboardInteractive requiresSameParentToManageScrollView
requiresSameParentToManageScrollView addBottomView
/>, />
isIphoneX() ? <View key='iphonex-area' style={styles.iphoneXArea} /> : null
]
); );
} }
} }

View File

@ -226,13 +226,13 @@ export default class Message extends React.Component {
const file = this.props.item.attachments[0]; const file = this.props.item.attachments[0];
const { user } = this.props; const { user } = this.props;
if (file.image_type) { if (file.image_url) {
return <Image file={file} user={user} />; return <Image file={file} user={user} />;
} }
if (file.audio_type) { if (file.audio_url) {
return <Audio file={file} user={user} />; return <Audio file={file} user={user} />;
} }
if (file.video_type) { if (file.video_url) {
return <Video file={file} user={user} />; return <Video file={file} user={user} />;
} }

View File

@ -9,7 +9,7 @@ import Modal from 'react-native-modal';
import RocketChat from '../lib/rocketchat'; import RocketChat from '../lib/rocketchat';
import { open, close } from '../actions/login'; import { open, close } from '../actions/login';
import LoggedView from './View';
import sharedStyles from './Styles'; import sharedStyles from './Styles';
import scrollPersistTaps from '../utils/scrollPersistTaps'; import scrollPersistTaps from '../utils/scrollPersistTaps';
import random from '../utils/random'; import random from '../utils/random';
@ -66,7 +66,7 @@ const styles = StyleSheet.create({
open: () => dispatch(open()), open: () => dispatch(open()),
close: () => dispatch(close()) close: () => dispatch(close())
})) }))
export default class LoginView extends React.Component { export default class LoginSignupView extends LoggedView {
static propTypes = { static propTypes = {
loginOAuth: PropTypes.func.isRequired, loginOAuth: PropTypes.func.isRequired,
open: PropTypes.func.isRequired, open: PropTypes.func.isRequired,
@ -87,7 +87,7 @@ export default class LoginView extends React.Component {
} }
constructor(props) { constructor(props) {
super(props); super('LoginSignupView', props);
this.state = { this.state = {
modalVisible: false, modalVisible: false,

View File

@ -14,6 +14,7 @@ import styles from './Styles';
import scrollPersistTaps from '../utils/scrollPersistTaps'; import scrollPersistTaps from '../utils/scrollPersistTaps';
import { showToast } from '../utils/info'; import { showToast } from '../utils/info';
import { COLOR_BUTTON_PRIMARY } from '../constants/colors'; import { COLOR_BUTTON_PRIMARY } from '../constants/colors';
import LoggedView from './View';
@connect(state => ({ @connect(state => ({
server: state.server.server, server: state.server.server,
@ -24,7 +25,7 @@ import { COLOR_BUTTON_PRIMARY } from '../constants/colors';
}), () => ({ }), () => ({
loginSubmit: params => RocketChat.loginWithPassword(params) loginSubmit: params => RocketChat.loginWithPassword(params)
})) }))
export default class LoginView extends React.PureComponent { export default class LoginView extends LoggedView {
static propTypes = { static propTypes = {
loginSubmit: PropTypes.func.isRequired, loginSubmit: PropTypes.func.isRequired,
navigation: PropTypes.object.isRequired, navigation: PropTypes.object.isRequired,
@ -32,10 +33,13 @@ export default class LoginView extends React.PureComponent {
server: PropTypes.string server: PropTypes.string
} }
state = { constructor(props) {
username: '', super('LoginView', props);
password: '' this.state = {
}; username: '',
password: ''
};
}
submit = async() => { submit = async() => {
const { username, password, code } = this.state; const { username, password, code } = this.state;

View File

@ -10,6 +10,7 @@ import scrollPersistTaps from '../utils/scrollPersistTaps';
import Button from '../containers/Button'; import Button from '../containers/Button';
import TextInput from '../containers/TextInput'; import TextInput from '../containers/TextInput';
import Loading from '../containers/Loading'; import Loading from '../containers/Loading';
import LoggedView from './View';
@connect(state => ({ @connect(state => ({
validInstance: !state.server.failure && !state.server.connecting, validInstance: !state.server.failure && !state.server.connecting,
@ -19,7 +20,7 @@ import Loading from '../containers/Loading';
validateServer: url => dispatch(serverRequest(url)), validateServer: url => dispatch(serverRequest(url)),
addServer: url => dispatch(addServer(url)) addServer: url => dispatch(addServer(url))
})) }))
export default class NewServerView extends React.Component { export default class NewServerView extends LoggedView {
static propTypes = { static propTypes = {
validateServer: PropTypes.func.isRequired, validateServer: PropTypes.func.isRequired,
addServer: PropTypes.func.isRequired, addServer: PropTypes.func.isRequired,
@ -30,7 +31,7 @@ export default class NewServerView extends React.Component {
} }
constructor(props) { constructor(props) {
super(props); super('NewServerView', props);
this.state = { this.state = {
defaultServer: 'https://open.rocket.chat' defaultServer: 'https://open.rocket.chat'
}; };

View File

@ -12,6 +12,7 @@ import styles from './Styles';
import { showToast } from '../utils/info'; import { showToast } from '../utils/info';
import CloseModalButton from '../containers/CloseModalButton'; import CloseModalButton from '../containers/CloseModalButton';
import scrollPersistTaps from '../utils/scrollPersistTaps'; import scrollPersistTaps from '../utils/scrollPersistTaps';
import LoggedView from './View';
@connect(state => ({ @connect(state => ({
server: state.server.server, server: state.server.server,
@ -24,7 +25,7 @@ import scrollPersistTaps from '../utils/scrollPersistTaps';
registerSubmit: params => dispatch(registerSubmit(params)), registerSubmit: params => dispatch(registerSubmit(params)),
setUsernameSubmit: params => dispatch(setUsernameSubmit(params)) setUsernameSubmit: params => dispatch(setUsernameSubmit(params))
})) }))
export default class RegisterView extends React.Component { export default class RegisterView extends LoggedView {
static propTypes = { static propTypes = {
registerSubmit: PropTypes.func.isRequired, registerSubmit: PropTypes.func.isRequired,
setUsernameSubmit: PropTypes.func, setUsernameSubmit: PropTypes.func,
@ -36,13 +37,16 @@ export default class RegisterView extends React.Component {
login: PropTypes.object login: PropTypes.object
} }
state = { constructor(props) {
name: '', super('RegisterView', props);
email: '', this.state = {
password: '', name: '',
confirmPassword: '', email: '',
username: '' password: '',
}; confirmPassword: '',
username: ''
};
}
valid() { valid() {
const { const {

View File

@ -12,6 +12,7 @@ import Header from '../../containers/Header';
import RoomsListHeader from './Header'; import RoomsListHeader from './Header';
import styles from './styles'; import styles from './styles';
import throttle from '../../utils/throttle'; import throttle from '../../utils/throttle';
import LoggedView from '../View';
@connect(state => ({ @connect(state => ({
user: state.login.user, user: state.login.user,
@ -19,7 +20,7 @@ import throttle from '../../utils/throttle';
Site_Url: state.settings.Site_Url, Site_Url: state.settings.Site_Url,
searchText: state.rooms.searchText searchText: state.rooms.searchText
})) }))
export default class RoomsListView extends React.Component { export default class RoomsListView extends LoggedView {
static propTypes = { static propTypes = {
navigation: PropTypes.object.isRequired, navigation: PropTypes.object.isRequired,
user: PropTypes.object, user: PropTypes.object,
@ -33,7 +34,7 @@ export default class RoomsListView extends React.Component {
}); });
constructor(props) { constructor(props) {
super(props); super('RoomsListView', props);
this.state = { this.state = {
search: [] search: []

View File

@ -11,6 +11,7 @@ import RoomItem from '../presentation/RoomItem';
import Avatar from '../containers/Avatar'; import Avatar from '../containers/Avatar';
import Loading from '../containers/Loading'; import Loading from '../containers/Loading';
import debounce from '../utils/debounce'; import debounce from '../utils/debounce';
import LoggedView from './View';
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
@ -73,7 +74,7 @@ const styles = StyleSheet.create({
reset: () => dispatch(reset()) reset: () => dispatch(reset())
}) })
) )
export default class SelectedUsersView extends React.Component { export default class SelectedUsersView extends LoggedView {
static propTypes = { static propTypes = {
navigation: PropTypes.object.isRequired, navigation: PropTypes.object.isRequired,
user: PropTypes.object, user: PropTypes.object,
@ -115,7 +116,7 @@ export default class SelectedUsersView extends React.Component {
}; };
constructor(props) { constructor(props) {
super(props); super('SelectedUsersView', props);
this.data = database.objects('subscriptions').filtered('t = $0', 'd').sorted('roomUpdatedAt', true); this.data = database.objects('subscriptions').filtered('t = $0', 'd').sorted('roomUpdatedAt', true);
this.state = { this.state = {
search: [] search: []

6
package-lock.json generated
View File

@ -15921,14 +15921,14 @@
} }
}, },
"react-native-keyboard-input": { "react-native-keyboard-input": {
"version": "git+https://github.com/RocketChat/react-native-keyboard-input.git#5bc63ae8b80a4ca5a3714a81dd058ee6bbe00a30", "version": "git+https://github.com/RocketChat/react-native-keyboard-input.git#1b5c45176e846ec5eb18e6d24c11c0481783a6d2",
"requires": { "requires": {
"lodash": "4.17.5", "lodash": "4.17.5",
"react-native-keyboard-tracking-view": "git+https://github.com/RocketChat/react-native-keyboard-tracking-view.git#151979f82a5aba8755993e7001ba608c135de6b7" "react-native-keyboard-tracking-view": "git+https://github.com/RocketChat/react-native-keyboard-tracking-view.git#82be12805eb3aa448c1f09f545c334e4776b3148"
} }
}, },
"react-native-keyboard-tracking-view": { "react-native-keyboard-tracking-view": {
"version": "git+https://github.com/RocketChat/react-native-keyboard-tracking-view.git#151979f82a5aba8755993e7001ba608c135de6b7" "version": "git+https://github.com/RocketChat/react-native-keyboard-tracking-view.git#82be12805eb3aa448c1f09f545c334e4776b3148"
}, },
"react-native-meteor": { "react-native-meteor": {
"version": "1.2.0", "version": "1.2.0",

View File

@ -49,7 +49,6 @@
"react-native-fetch-blob": "^0.10.8", "react-native-fetch-blob": "^0.10.8",
"react-native-image-picker": "^0.26.7", "react-native-image-picker": "^0.26.7",
"react-native-img-cache": "^1.5.2", "react-native-img-cache": "^1.5.2",
"react-native-iphone-x-helper": "^1.0.2",
"react-native-keyboard-aware-scroll-view": "^0.5.0", "react-native-keyboard-aware-scroll-view": "^0.5.0",
"react-native-keyboard-input": "git+https://github.com/RocketChat/react-native-keyboard-input.git", "react-native-keyboard-input": "git+https://github.com/RocketChat/react-native-keyboard-input.git",
"react-native-keyboard-tracking-view": "git+https://github.com/RocketChat/react-native-keyboard-tracking-view.git", "react-native-keyboard-tracking-view": "git+https://github.com/RocketChat/react-native-keyboard-tracking-view.git",