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 {
applicationId "chat.rocket.reactnative"
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 23
versionCode VERSIONCODE as Integer
versionName "1"
ndk {
@ -191,7 +191,7 @@ dependencies {
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.facebook.fresco:fresco: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;
}
}

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:
-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 com.facebook.infer.**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

6
package-lock.json generated
View File

@ -15921,14 +15921,14 @@
}
},
"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": {
"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": {
"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": {
"version": "1.2.0",

View File

@ -49,7 +49,6 @@
"react-native-fetch-blob": "^0.10.8",
"react-native-image-picker": "^0.26.7",
"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-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",