Skip to content

Commit 580c3b1

Browse files
committed
add extra height to keyboard text view
1 parent f8b74fc commit 580c3b1

File tree

6 files changed

+33
-30
lines changed

6 files changed

+33
-30
lines changed

ios/openlittermap.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@
985985
CLANG_ENABLE_MODULES = YES;
986986
CODE_SIGN_IDENTITY = "Apple Development";
987987
CODE_SIGN_STYLE = Automatic;
988-
CURRENT_PROJECT_VERSION = 16;
988+
CURRENT_PROJECT_VERSION = 18;
989989
DEAD_CODE_STRIPPING = NO;
990990
DEVELOPMENT_TEAM = QWDQLVZP87;
991991
INFOPLIST_FILE = openlittermap/Info.plist;
@@ -1014,7 +1014,7 @@
10141014
CLANG_ENABLE_MODULES = YES;
10151015
CODE_SIGN_IDENTITY = "Apple Development";
10161016
CODE_SIGN_STYLE = Automatic;
1017-
CURRENT_PROJECT_VERSION = 16;
1017+
CURRENT_PROJECT_VERSION = 18;
10181018
DEVELOPMENT_TEAM = QWDQLVZP87;
10191019
INFOPLIST_FILE = openlittermap/Info.plist;
10201020
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"react-native-image-crop-picker": "^0.26.2",
4040
"react-native-infinite-looping-scroll": "0.0.4",
4141
"react-native-keyboard-aware-scroll-view": "^0.9.1",
42+
"react-native-keyboard-spacer": "^0.4.1",
4243
"react-native-linear-gradient": "^2.5.6",
4344
"react-native-localize": "^2.0.1",
4445
"react-native-location": "^2.5.0",

screens/pages/LeftPage.js

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,22 @@ class LeftPage extends PureComponent
122122
style={styles.uploadText}
123123
dictionary={`${lang}.leftpage.please-wait-uploading`}
124124
/>
125+
125126
<ActivityIndicator style={{ marginBottom: 10 }} />
127+
126128
<Text style={styles.uploadCount}>
127129
{this._getRemainingUploadCount()} /{' '}
128130
{this.props.totalImagesToUpload}
129131
</Text>
132+
130133
{/* <Progress.Circle
131134
progress={this.props.galleryUploadProgress}
132135
showsText={true}
133136
size={100}
134137
style={{ marginBottom: 30 }}
135138
/> */}
136139
{/* Todo - translate cancel */}
140+
137141
<Button onPress={this._toggleUpload.bind(this)} title="Cancel" />
138142
</View>
139143
)
@@ -166,12 +170,13 @@ class LeftPage extends PureComponent
166170

167171
<View style={{ flexDirection: 'row' }}>
168172
<TouchableWithoutFeedback
169-
onPress={this._toggleThankYou.bind(this)}>
173+
onPress={this._toggleThankYou.bind(this)}
174+
>
170175
<View style={styles.thankYouButton}>
171-
<TransText
172-
style={styles.normalWhiteText}
173-
dictionary={`${lang}.leftpage.close`}
174-
/>
176+
<TransText
177+
style={styles.normalWhiteText}
178+
dictionary={`${lang}.leftpage.close`}
179+
/>
175180
</View>
176181
</TouchableWithoutFeedback>
177182
</View>
@@ -203,6 +208,7 @@ class LeftPage extends PureComponent
203208
isSelecting={this.props.isSelecting}
204209
webImages={this.props.webImages}
205210
/>
211+
206212
<View style={styles.bottomContainer}>{this.renderBottomTabBar()}</View>
207213
</SafeAreaView>
208214
<SafeAreaView style={{ flex: 0, backgroundColor: 'white' }} />
@@ -238,8 +244,6 @@ class LeftPage extends PureComponent
238244

239245
// async-storage photos & gallery set
240246
setTimeout(() => {
241-
console.log(this.props.photos);
242-
console.log(this.props.gallery);
243247
AsyncStorage.setItem('openlittermap-photos', JSON.stringify(this.props.photos));
244248
AsyncStorage.setItem('openlittermap-gallery', JSON.stringify(this.props.gallery));
245249
}, 1000);
@@ -449,13 +453,9 @@ class LeftPage extends PureComponent
449453
*/
450454
uploadPhotos = async () => {
451455

452-
console.log('uploadPhotos1');
453-
454456
this.props.resetGalleryToUpload(); // gallery
455457
this.props.resetPhotosToUpload(); // photo
456458

457-
console.log('uploadPhotos2');
458-
459459
let galleryCount = 0;
460460
let sessionCount = 0;
461461
let model = '';
@@ -470,8 +470,6 @@ class LeftPage extends PureComponent
470470
if (item.litter) sessionCount++;
471471
});
472472

473-
console.log('uploadPhotos3');
474-
475473
const totalCount = galleryCount + sessionCount;
476474
// console.log(({ totalCount }));
477475

@@ -482,7 +480,6 @@ class LeftPage extends PureComponent
482480
// 2. Open Upload Modal
483481
this.props.toggleUpload();
484482

485-
console.log('uploadPhotos4');
486483
// 3. Upload Photos
487484
// Photo Gallery - On Device
488485
// this.props.totalTaggedGalleryCount > 0
@@ -541,8 +538,6 @@ class LeftPage extends PureComponent
541538
}
542539
}
543540

544-
console.log('uploadPhotos5');
545-
546541
if (this.props.totalTaggedSessionCount > 0)
547542
{
548543
// upload session photos
@@ -587,8 +582,6 @@ class LeftPage extends PureComponent
587582
}
588583
}
589584

590-
591-
console.log('uploadPhotos6');
592585
// Last step - if all photos have been deleted, close modal
593586
if (this._getRemainingUploadCount() === this.props.totalImagesToUpload)
594587
{
@@ -605,7 +598,6 @@ class LeftPage extends PureComponent
605598
AsyncStorage.setItem('openlittermap-photos', JSON.stringify(this.props.photos));
606599
AsyncStorage.setItem('openlittermap-gallery', JSON.stringify(this.props.gallery));
607600
}, 1000);
608-
console.log('uploadPhotos7');
609601
};
610602

611603
/**

screens/pages/LitterPicker.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,23 @@ class LitterPicker extends PureComponent
131131

132132
if (x.includes('X') || parseInt(x) >= 10)
133133
{
134-
height = 0.2;
134+
height = 0.345;
135135
}
136136

137137
// iPhone 5,6,7,8
138138
else
139139
{
140-
height = 0.2; // 0.2425;
140+
height = 0.39; // 0.2425;
141141
}
142142
}
143143

144-
console.log({ height });
145-
console.log({ bottomHeight });
144+
height = height * SCREEN_HEIGHT;
145+
bottomHeight = bottomHeight * SCREEN_HEIGHT;
146146

147147
this.setState({
148148
keyboardOpen: true,
149-
bottomHeight: SCREEN_HEIGHT * bottomHeight,
150-
height: SCREEN_HEIGHT * height
149+
bottomHeight: bottomHeight,
150+
height: height
151151
});
152152
}
153153

@@ -230,6 +230,8 @@ class LitterPicker extends PureComponent
230230
*/
231231
categoryClicked = () => {
232232
this.closeKeyboardAndroid();
233+
234+
console.log('category clicked');
233235
}
234236

235237
/**

screens/pages/components/LitterBottomSearch.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { Icon } from 'react-native-elements'
2121
const SCREEN_HEIGHT = Dimensions.get('window').height
2222
const SCREEN_WIDTH = Dimensions.get('window').width
2323

24+
import KeyboardSpacer from 'react-native-keyboard-spacer';
25+
2426
class LitterBottomSearch extends PureComponent
2527
{
2628
constructor (props)
@@ -240,15 +242,16 @@ class LitterBottomSearch extends PureComponent
240242
const lang = this.props.lang;
241243
const suggest = getTranslation(`${lang}.litter.tags.type-to-suggest`);
242244

245+
console.log('keyboard-view', this.props.keyboardOpen);
246+
243247
return (
244248
<KeyboardAvoidingView
245249
style={{
246250
position: 'absolute',
247251
bottom: this.props.bottomHeight, // bottom: 0 for android
248252
left: 0,
249253
right: 0,
250-
height: this.props.height,
251-
backgroundColor: 'white' // doesn't work properly without setting this
254+
height: this.props.height
252255
}}
253256
behavior={'padding'}
254257
>

0 commit comments

Comments
 (0)