From 474aeb209b74167d279adcc5c55cf089e60e54f4 Mon Sep 17 00:00:00 2001 From: Sadaqat Ali Date: Wed, 27 Jul 2022 20:30:30 +0500 Subject: [PATCH 1/4] changed keyboard detection --- .../formInput/view/formInputView.tsx | 8 ------- src/screens/login/screen/loginScreen.js | 22 ++++++++++++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/formInput/view/formInputView.tsx b/src/components/formInput/view/formInputView.tsx index 69e87a4e3..6ca0f2e10 100644 --- a/src/components/formInput/view/formInputView.tsx +++ b/src/components/formInput/view/formInputView.tsx @@ -26,7 +26,6 @@ interface Props extends TextInputProps { inputStyle:TextStyle; isValid:boolean; onChange?:(value:string)=>void; - handleFocus?:(value:boolean)=>void; } const FormInputView = ({ @@ -45,7 +44,6 @@ const FormInputView = ({ isValid, value, onBlur, - handleFocus, ...props }:Props) => { const [_value, setValue] = useState(value || ''); @@ -64,16 +62,10 @@ const FormInputView = ({ const _handleOnFocus = () => { setInputBorderColor('#357ce6'); - if(handleFocus){ - handleFocus(true); - } }; const _handleOnBlur = () => { setInputBorderColor('#e7e7e7'); - if(handleFocus){ - handleFocus(false); - } if (onBlur) { onBlur(); } diff --git a/src/screens/login/screen/loginScreen.js b/src/screens/login/screen/loginScreen.js index 8f6861ce8..7f4721e16 100644 --- a/src/screens/login/screen/loginScreen.js +++ b/src/screens/login/screen/loginScreen.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { View, StatusBar, Platform } from 'react-native'; +import { View, StatusBar, Platform, Keyboard } from 'react-native'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import ScrollableTabView from 'react-native-scrollable-tab-view'; import { injectIntl } from 'react-intl'; @@ -41,6 +41,11 @@ class LoginScreen extends PureComponent { }; } + componentWillUnmount() { + this.keyboardDidShowListener.remove(); + this.keyboardDidHideListener.remove(); + } + _handleOnPasswordChange = (value) => { this.setState({ password: value }); }; @@ -62,13 +67,20 @@ class LoginScreen extends PureComponent { this.setState({ isModalOpen: !isModalOpen }); }; - _handleFormInputFocus = (isFocused) => { - this.setState({ keyboardIsOpen: isFocused }); - }; + UNSAFE_componentWillMount() { + this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => + this.setState({ keyboardIsOpen: true }), + ); + this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => + this.setState({ keyboardIsOpen: false }), + ); + } + render() { const { navigation, intl, handleOnPressLogin, handleSignUp, isLoading } = this.props; const { username, isUsernameValid, keyboardIsOpen, password, isModalOpen } = this.state; + console.log('keyboardIsOpen : ', keyboardIsOpen); return ( - {!isKeyboardOpen && ( + {title} @@ -51,7 +56,7 @@ class LoginHeaderView extends PureComponent { - )} + @@ -60,3 +65,27 @@ class LoginHeaderView extends PureComponent { } export default LoginHeaderView; + +const { height } = getWindowDimensions(); +const bodyHeight = height / 3.9; +const showAnimation = { + from: { + opacity: 0, + height: 0, + }, + to: { + opacity: 1, + height: bodyHeight, + }, +}; + +const hideAnimation = { + from: { + opacity: 1, + height: bodyHeight, + }, + to: { + opacity: 0, + height: 0, + }, +}; From 9af25faaa9ae4f4b9535238f62bf7795244beab1 Mon Sep 17 00:00:00 2001 From: feruzm Date: Thu, 28 Jul 2022 08:07:58 +0300 Subject: [PATCH 3/4] version bump --- android/app/build.gradle | 2 +- ios/Ecency-tvOS/Info.plist | 4 ++-- ios/Ecency-tvOSTests/Info.plist | 4 ++-- ios/Ecency.xcodeproj/project.pbxproj | 4 ++-- ios/Ecency/Info.plist | 2 +- ios/EcencyTests/Info.plist | 4 ++-- ios/eshare/Info.plist | 4 ++-- package.json | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 7c2c534c0..c98c263d1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -144,7 +144,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch - versionName "3.0.32" + versionName "3.0.33" resValue "string", "build_config_package", "app.esteem.mobile.android" multiDexEnabled true // react-native-image-crop-picker diff --git a/ios/Ecency-tvOS/Info.plist b/ios/Ecency-tvOS/Info.plist index 052930363..79764d9f1 100644 --- a/ios/Ecency-tvOS/Info.plist +++ b/ios/Ecency-tvOS/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 3.0.32 + 3.0.33 CFBundleSignature ???? CFBundleVersion - 2811 + 2812 LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/ios/Ecency-tvOSTests/Info.plist b/ios/Ecency-tvOSTests/Info.plist index 1194ebd08..d4bd5690e 100644 --- a/ios/Ecency-tvOSTests/Info.plist +++ b/ios/Ecency-tvOSTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 3.0.32 + 3.0.33 CFBundleSignature ???? CFBundleVersion - 2811 + 2812 diff --git a/ios/Ecency.xcodeproj/project.pbxproj b/ios/Ecency.xcodeproj/project.pbxproj index de6e162b9..443f0bf7d 100644 --- a/ios/Ecency.xcodeproj/project.pbxproj +++ b/ios/Ecency.xcodeproj/project.pbxproj @@ -1132,7 +1132,7 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 2811; + CURRENT_PROJECT_VERSION = 2812; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = 75B6RXTKGT; EXCLUDED_ARCHS = ""; @@ -1211,7 +1211,7 @@ CODE_SIGN_ENTITLEMENTS = Ecency/Ecency.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 2811; + CURRENT_PROJECT_VERSION = 2812; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = 75B6RXTKGT; EXCLUDED_ARCHS = ""; diff --git a/ios/Ecency/Info.plist b/ios/Ecency/Info.plist index b9e62bb75..7bff4366f 100644 --- a/ios/Ecency/Info.plist +++ b/ios/Ecency/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 3.0.32 + 3.0.33 CFBundleSignature ???? CFBundleURLTypes diff --git a/ios/EcencyTests/Info.plist b/ios/EcencyTests/Info.plist index 0855462d7..9129244d1 100644 --- a/ios/EcencyTests/Info.plist +++ b/ios/EcencyTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 3.0.32 + 3.0.33 CFBundleSignature ???? CFBundleVersion - 2811 + 2812 diff --git a/ios/eshare/Info.plist b/ios/eshare/Info.plist index ccd7ced18..859129763 100644 --- a/ios/eshare/Info.plist +++ b/ios/eshare/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 3.0.32 + 3.0.33 CFBundleVersion - 2811 + 2812 NSExtension NSExtensionAttributes diff --git a/package.json b/package.json index e99b29616..55eb2ea38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ecency", - "version": "3.0.32", + "version": "3.0.33", "displayName": "Ecency", "private": true, "rnpm": { From f56219235392870dd9d9059bf8ffa44ea40c430a Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Thu, 28 Jul 2022 10:26:02 +0500 Subject: [PATCH 4/4] updated footer styling to hide background on small screen devices --- src/screens/login/screen/loginStyles.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/screens/login/screen/loginStyles.js b/src/screens/login/screen/loginStyles.js index ece5687c9..4a83a154a 100644 --- a/src/screens/login/screen/loginStyles.js +++ b/src/screens/login/screen/loginStyles.js @@ -27,9 +27,9 @@ export default EStyleSheet.create({ justifyContent: 'center', alignItems: 'center', alignSelf: 'flex-end', - marginRight: 10, - bottom: 24, - right: 24, + paddingRight: 24, + paddingBottom: 24, + backgroundColor: '$primaryBackgroundColor', }, cancelButton: { marginRight: 10,