[FIX] Missing current server (#427)
* server.current removed * Increased area of touch on header * Hide search when sort dropdown is tapped * default server icon url * 1.1.1
This commit is contained in:
parent
101d4c727c
commit
92cedf76c1
|
@ -102,7 +102,7 @@ android {
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode VERSIONCODE as Integer
|
versionCode VERSIONCODE as Integer
|
||||||
versionName "1.1"
|
versionName "1.1.1"
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "x86"
|
abiFilters "armeabi-v7a", "x86"
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,7 @@ const serversSchema = {
|
||||||
properties: {
|
properties: {
|
||||||
id: 'string',
|
id: 'string',
|
||||||
name: { type: 'string', optional: true },
|
name: { type: 'string', optional: true },
|
||||||
iconURL: { type: 'string', optional: true },
|
iconURL: { type: 'string', optional: true }
|
||||||
current: 'bool'
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ const handleServerRequest = function* handleServerRequest({ server }) {
|
||||||
yield call(validate, server);
|
yield call(validate, server);
|
||||||
yield call(NavigationActions.push, { screen: 'LoginSignupView', title: server, backButtonTitle: '' });
|
yield call(NavigationActions.push, { screen: 'LoginSignupView', title: server, backButtonTitle: '' });
|
||||||
database.databases.serversDB.write(() => {
|
database.databases.serversDB.write(() => {
|
||||||
database.databases.serversDB.create('servers', { id: server, current: false }, true);
|
database.databases.serversDB.create('servers', { id: server }, true);
|
||||||
});
|
});
|
||||||
yield put(selectServerRequest(server));
|
yield put(selectServerRequest(server));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -33,8 +33,12 @@ const styles = StyleSheet.create({
|
||||||
|
|
||||||
const Header = ({ onPress, serverName, showServerDropdown }) => (
|
const Header = ({ onPress, serverName, showServerDropdown }) => (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={onPress}
|
||||||
|
testID='rooms-list-header-server-dropdown-button'
|
||||||
|
style={styles.container}
|
||||||
|
>
|
||||||
<Text style={styles.title}>{I18n.t('Messages')}</Text>
|
<Text style={styles.title}>{I18n.t('Messages')}</Text>
|
||||||
<TouchableOpacity onPress={onPress} testID='rooms-list-header-server-dropdown-button'>
|
|
||||||
<View style={styles.button}>
|
<View style={styles.button}>
|
||||||
<Text style={styles.server}>{serverName}</Text>
|
<Text style={styles.server}>{serverName}</Text>
|
||||||
<Image style={[styles.disclosure, showServerDropdown && styles.upsideDown]} source={{ uri: 'disclosure_indicator_server' }} />
|
<Image style={[styles.disclosure, showServerDropdown && styles.upsideDown]} source={{ uri: 'disclosure_indicator_server' }} />
|
||||||
|
|
|
@ -126,7 +126,17 @@ export default class ServerDropdown extends Component {
|
||||||
renderServer = ({ item }) => (
|
renderServer = ({ item }) => (
|
||||||
<Touch onPress={() => this.select(item.id)} style={styles.serverItem} testID={`rooms-list-header-server-${ item.id }`}>
|
<Touch onPress={() => this.select(item.id)} style={styles.serverItem} testID={`rooms-list-header-server-${ item.id }`}>
|
||||||
<View style={styles.serverItemContainer}>
|
<View style={styles.serverItemContainer}>
|
||||||
<Image source={{ uri: item.iconURL }} defaultSource={{ uri: 'logo' }} style={styles.serverIcon} />
|
{item.iconURL ?
|
||||||
|
<Image
|
||||||
|
source={{ uri: item.iconURL }}
|
||||||
|
defaultSource={{ uri: 'logo' }}
|
||||||
|
style={styles.serverIcon}
|
||||||
|
/> :
|
||||||
|
<Image
|
||||||
|
source={{ uri: 'logo' }}
|
||||||
|
style={styles.serverIcon}
|
||||||
|
/>
|
||||||
|
}
|
||||||
<View style={styles.serverTextContainer}>
|
<View style={styles.serverTextContainer}>
|
||||||
<Text style={styles.serverName}>{item.name || item.id}</Text>
|
<Text style={styles.serverName}>{item.name || item.id}</Text>
|
||||||
<Text style={styles.serverUrl}>{item.id}</Text>
|
<Text style={styles.serverUrl}>{item.id}</Text>
|
||||||
|
|
|
@ -18,6 +18,7 @@ import Touch from '../../utils/touch';
|
||||||
import { toggleSortDropdown } from '../../actions/rooms';
|
import { toggleSortDropdown } from '../../actions/rooms';
|
||||||
|
|
||||||
const ROW_HEIGHT = 70;
|
const ROW_HEIGHT = 70;
|
||||||
|
const SCROLL_OFFSET = 56;
|
||||||
|
|
||||||
const isAndroid = () => Platform.OS === 'android';
|
const isAndroid = () => Platform.OS === 'android';
|
||||||
const getItemLayout = (data, index) => ({ length: ROW_HEIGHT, offset: ROW_HEIGHT * index, index });
|
const getItemLayout = (data, index) => ({ length: ROW_HEIGHT, offset: ROW_HEIGHT * index, index });
|
||||||
|
@ -62,6 +63,7 @@ export default class RoomsListView extends LoggedView {
|
||||||
|
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
navBarCustomView: 'RoomsListHeaderView',
|
navBarCustomView: 'RoomsListHeaderView',
|
||||||
|
navBarComponentAlignment: 'fill',
|
||||||
navBarBackgroundColor: isAndroid() ? '#2F343D' : undefined,
|
navBarBackgroundColor: isAndroid() ? '#2F343D' : undefined,
|
||||||
navBarTextColor: isAndroid() ? '#FFF' : undefined,
|
navBarTextColor: isAndroid() ? '#FFF' : undefined,
|
||||||
navBarButtonColor: isAndroid() ? '#FFF' : undefined
|
navBarButtonColor: isAndroid() ? '#FFF' : undefined
|
||||||
|
@ -272,6 +274,7 @@ export default class RoomsListView extends LoggedView {
|
||||||
navigator.setButtons({ leftButtons, rightButtons });
|
navigator.setButtons({ leftButtons, rightButtons });
|
||||||
navigator.setStyle({
|
navigator.setStyle({
|
||||||
navBarCustomView: 'RoomsListHeaderView',
|
navBarCustomView: 'RoomsListHeaderView',
|
||||||
|
navBarComponentAlignment: 'fill',
|
||||||
navBarBackgroundColor: isAndroid() ? '#2F343D' : undefined,
|
navBarBackgroundColor: isAndroid() ? '#2F343D' : undefined,
|
||||||
navBarTextColor: isAndroid() ? '#FFF' : undefined,
|
navBarTextColor: isAndroid() ? '#FFF' : undefined,
|
||||||
navBarButtonColor: isAndroid() ? '#FFF' : undefined
|
navBarButtonColor: isAndroid() ? '#FFF' : undefined
|
||||||
|
@ -355,7 +358,16 @@ export default class RoomsListView extends LoggedView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSort = () => this.props.toggleSortDropdown();
|
toggleSort = () => {
|
||||||
|
if (Platform.OS === 'ios') {
|
||||||
|
this.scroll.scrollTo({ x: 0, y: SCROLL_OFFSET, animated: true });
|
||||||
|
} else {
|
||||||
|
this.scroll.scrollTo({ x: 0, y: 0, animated: true });
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.props.toggleSortDropdown();
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
renderHeader = () => {
|
renderHeader = () => {
|
||||||
if (this.state.search.length > 0) {
|
if (this.state.search.length > 0) {
|
||||||
|
@ -471,7 +483,8 @@ export default class RoomsListView extends LoggedView {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
contentOffset={Platform.OS === 'ios' ? { x: 0, y: 56 } : {}}
|
ref={ref => this.scroll = ref}
|
||||||
|
contentOffset={Platform.OS === 'ios' ? { x: 0, y: SCROLL_OFFSET } : {}}
|
||||||
keyboardShouldPersistTaps='always'
|
keyboardShouldPersistTaps='always'
|
||||||
testID='rooms-list-view-list'
|
testID='rooms-list-view-list'
|
||||||
>
|
>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.1</string>
|
<string>1.1.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
|
|
Loading…
Reference in New Issue