diff --git a/android/app/build.gradle b/android/app/build.gradle index 680234c68..ba656cd16 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -106,7 +106,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion 21 targetSdkVersion 23 - versionCode 71 + versionCode 72 versionName "1.5.0" multiDexEnabled true ndk { diff --git a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java index 98881b318..aa2d51f84 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java @@ -56,8 +56,10 @@ public class CustomPushNotification extends PushNotification { if (notificationId != -1) { channelIdToNotificationCount.remove(channelId); channelIdToNotification.remove(channelId); - final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancel(notificationId); + if (context != null) { + final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + notificationManager.cancel(notificationId); + } } } diff --git a/app/components/post_textbox/index.js b/app/components/post_textbox/index.js index a24489d00..23d60c155 100644 --- a/app/components/post_textbox/index.js +++ b/app/components/post_textbox/index.js @@ -24,7 +24,7 @@ function mapStateToProps(state, ownProps) { const currentDraft = ownProps.rootId ? getThreadDraft(state, ownProps.rootId) : getCurrentChannelDraft(state); return { - channelId: getCurrentChannelId(state), + channelId: ownProps.channelId || getCurrentChannelId(state), canUploadFiles: canUploadFilesOnMobile(state), channelIsLoading: state.views.channel.loading, currentUserId: getCurrentUserId(state), diff --git a/app/mattermost.js b/app/mattermost.js index 076e7d270..086c41a70 100644 --- a/app/mattermost.js +++ b/app/mattermost.js @@ -10,6 +10,7 @@ import { Alert, AppState, InteractionManager, + Keyboard, NativeModules, Platform } from 'react-native'; @@ -194,6 +195,7 @@ export default class Mattermost { } } else if (isActive) { this.inBackgroundSince = null; + Keyboard.dismiss(); } } catch (error) { // do nothing diff --git a/app/screens/edit_channel/edit_channel.js b/app/screens/edit_channel/edit_channel.js index 88872c0a3..af1097a8c 100644 --- a/app/screens/edit_channel/edit_channel.js +++ b/app/screens/edit_channel/edit_channel.js @@ -9,7 +9,7 @@ import { InteractionManager } from 'react-native'; -import {RequestStatus} from 'mattermost-redux/constants'; +import {General, RequestStatus} from 'mattermost-redux/constants'; import EventEmitter from 'mattermost-redux/utils/event_emitter'; import EditChannelInfo from 'app/components/edit_channel_info'; @@ -199,23 +199,27 @@ export default class EditChannel extends PureComponent { onUpdateChannel = () => { Keyboard.dismiss(); const {displayName, channelURL, purpose, header} = this.state; - const {channel: {id}} = this.props; + const {channel: {id, type}} = this.props; + const isDirect = type === General.DM_CHANNEL || type === General.GM_CHANNEL; const channel = { - display_name: displayName, + display_name: isDirect ? '' : displayName, name: channelURL, purpose, header }; - let result = this.validateDisplayName(displayName.trim()); - if (result.error) { - this.setState({error: result.error}); - return; - } - result = this.validateChannelURL(channelURL.trim()); - if (result.error) { - this.setState({error: result.error}); - return; + if (!isDirect) { + let result = this.validateDisplayName(displayName.trim()); + if (result.error) { + this.setState({error: result.error}); + return; + } + + result = this.validateChannelURL(channelURL.trim()); + if (result.error) { + this.setState({error: result.error}); + return; + } } this.props.actions.patchChannel(id, channel); diff --git a/app/screens/image_preview/previewer.js b/app/screens/image_preview/previewer.js index 4b8aa6ebc..87865f458 100644 --- a/app/screens/image_preview/previewer.js +++ b/app/screens/image_preview/previewer.js @@ -255,6 +255,10 @@ export default class Previewer extends Component { }; const opacity = isInFetchCache ? 1 : this.state.opacity; + const containerStyle = Platform.select({ + android: {height: imageHeight, width: this.state.imageWidth, backgroundColor: '#000'}, + ios: {flex: 1, backgroundColor: '#000'} + }); return ( - + { this.loginId.blur(); this.passwd.blur(); + Keyboard.dismiss(); }; preSignIn = wrapWithPreventDoubleTap(() => { @@ -341,6 +342,7 @@ class Login extends PureComponent { ref={this.scrollRef} style={style.container} contentContainerStyle={style.innerContainer} + keyboardShouldPersistTaps='handled' > { const {navigator} = this.props; - if (Platform.OS === 'ios') { - navigator.popToRoot({ - animated: true - }); - } else { + navigator.popToRoot({ + animated: true + }); + + if (Platform.OS === 'android') { navigator.dismissModal({ animationType: 'slide-down' }); diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index df453b053..8360a8646 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -2113,7 +2113,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 71; + CURRENT_PROJECT_VERSION = 72; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; @@ -2163,7 +2163,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 71; + CURRENT_PROJECT_VERSION = 72; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 46de1a08a..fce86fc9e 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -32,7 +32,7 @@ CFBundleVersion - 71 + 72 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index db54c2247..588970528 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 71 + 72