Skip to content

Commit

Permalink
Fabric and image fix (#284)
Browse files Browse the repository at this point in the history
* Fixed images not showing

* Keyboard libs updated
  • Loading branch information
diegolmello authored and ggazzo committed Apr 26, 2018
1 parent bf8d0c3 commit d4ed353
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 47 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ android {
defaultConfig {
applicationId "chat.rocket.reactnative"
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 23
versionCode VERSIONCODE as Integer
versionName "1"
ndk {
Expand Down Expand Up @@ -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;
}
}
Expand Down
7 changes: 6 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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.**
27 changes: 12 additions & 15 deletions app/containers/MessageBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
/>
);
}
}
6 changes: 3 additions & 3 deletions app/containers/message/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} />;
}

Expand Down
6 changes: 3 additions & 3 deletions app/views/LoginSignupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -87,7 +87,7 @@ export default class LoginView extends React.Component {
}

constructor(props) {
super(props);
super('LoginSignupView', props);

this.state = {
modalVisible: false,
Expand Down
14 changes: 9 additions & 5 deletions app/views/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -24,18 +25,21 @@ 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,
login: PropTypes.object,
server: PropTypes.string
}

state = {
username: '',
password: ''
};
constructor(props) {
super('LoginView', props);
this.state = {
username: '',
password: ''
};
}

submit = async() => {
const { username, password, code } = this.state;
Expand Down
5 changes: 3 additions & 2 deletions app/views/NewServerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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'
};
Expand Down
20 changes: 12 additions & 8 deletions app/views/RegisterView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions app/views/RoomsListView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ 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,
server: state.server.server,
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,
Expand All @@ -33,7 +34,7 @@ export default class RoomsListView extends React.Component {
});

constructor(props) {
super(props);
super('RoomsListView', props);

this.state = {
search: []
Expand Down
5 changes: 3 additions & 2 deletions app/views/SelectedUsersView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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: []
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d4ed353

Please sign in to comment.