Merge pull request #1241 from esteemapp/bugfix/android-splash

Bugfix/android splash
This commit is contained in:
Mustafa Buyukcelebi 2019-11-11 22:55:18 +03:00 committed by GitHub
commit 66af429b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 272 additions and 256 deletions

View File

@ -165,17 +165,17 @@ class NotificationView extends PureComponent {
rightIconType="MaterialIcons" rightIconType="MaterialIcons"
onRightIconPress={readAllNotification} onRightIconPress={readAllNotification}
/> />
<FlatList <ThemeContainer>
data={_notifications} {({ isDarkTheme }) => (
refreshing={isNotificationRefreshing} <FlatList
onRefresh={() => getActivities()} data={_notifications}
keyExtractor={item => item.title} refreshing={isNotificationRefreshing}
onEndReached={() => getActivities(null, selectedFilter, true)} onRefresh={() => getActivities()}
ListFooterComponent={this._renderFooterLoading} keyExtractor={item => item.title}
ListEmptyComponent={<ListPlaceHolder />} onEndReached={() => getActivities(null, selectedFilter, true)}
refreshControl={ ListFooterComponent={this._renderFooterLoading}
<ThemeContainer> ListEmptyComponent={<ListPlaceHolder />}
{({ isDarkTheme }) => ( refreshControl={
<RefreshControl <RefreshControl
refreshing={isNotificationRefreshing} refreshing={isNotificationRefreshing}
progressBackgroundColor="#357CE6" progressBackgroundColor="#357CE6"
@ -183,21 +183,21 @@ class NotificationView extends PureComponent {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
}
renderItem={({ item, index }) => (
<Fragment>
<ContainerHeader
hasSeperator={index !== 0}
isBoldTitle
title={item.title}
key={item.title}
/>
{this._renderList(item.notifications)}
</Fragment>
)} )}
</ThemeContainer> />
}
renderItem={({ item, index }) => (
<Fragment>
<ContainerHeader
hasSeperator={index !== 0}
isBoldTitle
title={item.title}
key={item.title}
/>
{this._renderList(item.notifications)}
</Fragment>
)} )}
/> </ThemeContainer>
</View> </View>
); );
} }

View File

@ -40,22 +40,18 @@ class PointsView extends Component {
// Component Functions // Component Functions
refreshControl = () => { refreshControl = ({ isDarkTheme }) => {
const { fetchUserActivity, refreshing } = this.props; const { fetchUserActivity, refreshing } = this.props;
return ( return (
<ThemeContainer> <RefreshControl
{isDarkTheme => ( refreshing={refreshing}
<RefreshControl onRefresh={fetchUserActivity}
refreshing={refreshing} progressBackgroundColor="#357CE6"
onRefresh={fetchUserActivity} tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
progressBackgroundColor="#357CE6" titleColor="#fff"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'} colors={['#fff']}
titleColor="#fff" />
colors={['#fff']}
/>
)}
</ThemeContainer>
); );
}; };
@ -100,147 +96,166 @@ class PointsView extends Component {
return ( return (
<Fragment> <Fragment>
<LineBreak height={12} /> <LineBreak height={12} />
<ScrollView style={styles.scrollContainer} refreshControl={this.refreshControl()}> <ThemeContainer>
<View style={styles.pointsWrapper}> {isDarkTheme => (
<Text onPress={this._showDropdown} style={styles.pointText}> <ScrollView
{get(userPoints, 'points')} style={styles.scrollContainer}
</Text> refreshControl={this.refreshControl({ isDarkTheme })}
<DropdownButton >
dropdownRowWrapper={styles.dropdownRowStyle} <View style={styles.pointsWrapper}>
dropdownRef={this.dropdownRef} <Text onPress={this._showDropdown} style={styles.pointText}>
isHasChildIcon {get(userPoints, 'points')}
iconName="arrow-drop-down" </Text>
options={[ <DropdownButton
intl.formatMessage({ id: 'points.dropdown_transfer' }), dropdownRowWrapper={styles.dropdownRowStyle}
intl.formatMessage({ id: 'points.dropdown_promote' }), dropdownRef={this.dropdownRef}
intl.formatMessage({ id: 'points.dropdown_boost' }), isHasChildIcon
]} iconName="arrow-drop-down"
noHighlight options={[
dropdownButtonStyle={styles.dropdownButtonStyle} intl.formatMessage({ id: 'points.dropdown_transfer' }),
onSelect={handleOnDropdownSelected} intl.formatMessage({ id: 'points.dropdown_promote' }),
rowTextStyle={styles.dropdownRowText} intl.formatMessage({ id: 'points.dropdown_boost' }),
dropdownStyle={styles.dropdownStyle} ]}
/> noHighlight
</View> dropdownButtonStyle={styles.dropdownButtonStyle}
<Text style={styles.subText}>{intl.formatMessage({ id: 'points.esteemPoints' })}</Text> onSelect={handleOnDropdownSelected}
rowTextStyle={styles.dropdownRowText}
<MainButton dropdownStyle={styles.dropdownStyle}
isLoading={isClaiming} />
isDisable={isClaiming}
style={styles.mainButton}
height={50}
onPress={() =>
unclaimedPoints > 0 ? claimPoints() : navigation.navigate(ROUTES.SCREENS.BOOST)
}
>
<View style={styles.mainButtonWrapper}>
<Text style={styles.unclaimedText}>
{unclaimedPoints > 0 ? unclaimedPoints : intl.formatMessage({ id: 'boost.buy' })}
</Text>
<View style={styles.mainIconWrapper}>
<Icon name="add" iconType="MaterialIcons" color="#357ce6" size={23} />
</View> </View>
</View> <Text style={styles.subText}>
</MainButton> {intl.formatMessage({ id: 'points.esteemPoints' })}
</Text>
<View style={styles.iconsWrapper}> <MainButton
<FlatList isLoading={isClaiming}
style={styles.iconsList} isDisable={isClaiming}
data={POINTS_KEYS} style={styles.mainButton}
keyExtractor={item => get(item, 'type', Math.random()).toString()} height={50}
horizontal onPress={() =>
renderItem={({ item }) => ( unclaimedPoints > 0 ? claimPoints() : navigation.navigate(ROUTES.SCREENS.BOOST)
<PopoverController key={get(item, 'type')}> }
{({ >
openPopover, <View style={styles.mainButtonWrapper}>
closePopover, <Text style={styles.unclaimedText}>
popoverVisible, {unclaimedPoints > 0
setPopoverAnchor, ? unclaimedPoints
popoverAnchorRect, : intl.formatMessage({ id: 'boost.buy' })}
}) => ( </Text>
<View styles={styles.iconWrapper} key={get(item, 'type')}> <View style={styles.mainIconWrapper}>
<View style={styles.iconWrapper}> <Icon name="add" iconType="MaterialIcons" color="#357ce6" size={23} />
<TouchableOpacity ref={setPopoverAnchor} onPress={openPopover}> </View>
<IconButton </View>
iconStyle={styles.icon} </MainButton>
style={styles.iconButton}
iconType={get(POINTS[get(item, 'type')], 'iconType')} <View style={styles.iconsWrapper}>
name={get(POINTS[get(item, 'type')], 'icon')} <FlatList
badgeCount={get(POINTS[get(item, 'type')], 'point')} style={styles.iconsList}
badgeStyle={styles.badge} data={POINTS_KEYS}
badgeTextStyle={styles.badgeText} keyExtractor={item => get(item, 'type', Math.random()).toString()}
disabled horizontal
/> renderItem={({ item }) => (
</TouchableOpacity> <PopoverController key={get(item, 'type')}>
</View> {({
<Text style={styles.subText}> openPopover,
{this._getTranslation(get(POINTS[get(item, 'type')], 'nameKey'))} closePopover,
</Text> popoverVisible,
<Popover setPopoverAnchor,
backgroundStyle={styles.overlay} popoverAnchorRect,
contentStyle={styles.popoverDetails} }) => (
arrowStyle={styles.arrow} <View styles={styles.iconWrapper} key={get(item, 'type')}>
visible={popoverVisible} <View style={styles.iconWrapper}>
onClose={() => closePopover()} <TouchableOpacity ref={setPopoverAnchor} onPress={openPopover}>
fromRect={popoverAnchorRect} <IconButton
placement="top" iconStyle={styles.icon}
supportedOrientations={['portrait', 'landscape']} style={styles.iconButton}
> iconType={get(POINTS[get(item, 'type')], 'iconType')}
<View style={styles.popoverWrapper}> name={get(POINTS[get(item, 'type')], 'icon')}
<Text style={styles.popoverText}> badgeCount={get(POINTS[get(item, 'type')], 'point')}
{this._getTranslation(get(POINTS[get(item, 'type')], 'descriptionKey'))} badgeStyle={styles.badge}
badgeTextStyle={styles.badgeText}
disabled
/>
</TouchableOpacity>
</View>
<Text style={styles.subText}>
{this._getTranslation(get(POINTS[get(item, 'type')], 'nameKey'))}
</Text> </Text>
<Popover
backgroundStyle={styles.overlay}
contentStyle={styles.popoverDetails}
arrowStyle={styles.arrow}
visible={popoverVisible}
onClose={() => closePopover()}
fromRect={popoverAnchorRect}
placement="top"
supportedOrientations={['portrait', 'landscape']}
>
<View style={styles.popoverWrapper}>
<Text style={styles.popoverText}>
{this._getTranslation(
get(POINTS[get(item, 'type')], 'descriptionKey'),
)}
</Text>
</View>
</Popover>
</View> </View>
</Popover> )}
</View> </PopoverController>
)} )}
</PopoverController> />
)} </View>
/>
</View>
<View style={styles.listWrapper}> <View style={styles.listWrapper}>
<FlatList <FlatList
data={userActivities} data={userActivities}
keyExtractor={item => item.id.toString()} keyExtractor={item => item.id.toString()}
ListEmptyComponent={this._renderLoading()} ListEmptyComponent={this._renderLoading()}
renderItem={({ item, index }) => ( renderItem={({ item, index }) => (
<CollapsibleCard <CollapsibleCard
noBorder noBorder
noContainer noContainer
key={item.id.toString()} key={item.id.toString()}
titleComponent={ titleComponent={
<WalletLineItem <WalletLineItem
index={index + 1} index={index + 1}
text={this._getTranslation(get(item, 'textKey'))} text={this._getTranslation(get(item, 'textKey'))}
description={getTimeFromNow(get(item, 'created'))} description={getTimeFromNow(get(item, 'created'))}
isCircleIcon isCircleIcon
isThin isThin
isBlackText isBlackText
iconName={get(item, 'icon')} iconName={get(item, 'icon')}
iconType={get(item, 'iconType')} iconType={get(item, 'iconType')}
rightText={`${get(item, 'amount')} ESTM`} rightText={`${get(item, 'amount')} ESTM`}
/> />
}
>
{(get(item, 'memo') || get(item, 'sender')) && (
<WalletLineItem
isBlackText
isThin
text={
get(item, 'sender')
? `${intl.formatMessage({ id: 'points.from' })} @${get(item, 'sender')}`
: get(item, 'receiver') &&
`${intl.formatMessage({ id: 'points.to' })} @${get(item, 'receiver')}`
} }
description={get(item, 'memo')} >
/> {(get(item, 'memo') || get(item, 'sender')) && (
<WalletLineItem
isBlackText
isThin
text={
get(item, 'sender')
? `${intl.formatMessage({ id: 'points.from' })} @${get(
item,
'sender',
)}`
: get(item, 'receiver') &&
`${intl.formatMessage({ id: 'points.to' })} @${get(
item,
'receiver',
)}`
}
description={get(item, 'memo')}
/>
)}
</CollapsibleCard>
)} )}
</CollapsibleCard> />
)} </View>
/> </ScrollView>
</View> )}
</ScrollView> </ThemeContainer>
</Fragment> </Fragment>
); );
} }

View File

@ -376,27 +376,27 @@ class PostsView extends Component {
/> />
)} )}
<FlatList <ThemeContainer>
data={posts} {({ isDarkTheme }) => (
showsVerticalScrollIndicator={false} <FlatList
renderItem={({ item }) => data={posts}
get(item, 'author', null) && ( showsVerticalScrollIndicator={false}
<PostCard isRefresh={refreshing} content={item} isHideImage={isHideImage} /> renderItem={({ item }) =>
) get(item, 'author', null) && (
} <PostCard isRefresh={refreshing} content={item} isHideImage={isHideImage} />
keyExtractor={(content, i) => `${get(content, 'permlink', '')}${i.toString()}`} )
onEndReached={() => this._loadPosts()} }
removeClippedSubviews keyExtractor={(content, i) => `${get(content, 'permlink', '')}${i.toString()}`}
refreshing={refreshing} onEndReached={() => this._loadPosts()}
onRefresh={() => this._handleOnRefreshPosts()} removeClippedSubviews
onEndThreshold={0} refreshing={refreshing}
initialNumToRender={10} onRefresh={() => this._handleOnRefreshPosts()}
ListFooterComponent={this._renderFooter} onEndThreshold={0}
onScrollEndDrag={this._handleOnScroll} initialNumToRender={10}
ListEmptyComponent={this._renderEmptyContent} ListFooterComponent={this._renderFooter}
refreshControl={ onScrollEndDrag={this._handleOnScroll}
<ThemeContainer> ListEmptyComponent={this._renderEmptyContent}
{({ isDarkTheme }) => ( refreshControl={
<RefreshControl <RefreshControl
refreshing={refreshing} refreshing={refreshing}
onRefresh={this._handleOnRefreshPosts} onRefresh={this._handleOnRefreshPosts}
@ -405,13 +405,13 @@ class PostsView extends Component {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
)} }
</ThemeContainer> ref={ref => {
} this.flatList = ref;
ref={ref => { }}
this.flatList = ref; />
}} )}
/> </ThemeContainer>
</View> </View>
); );
} }

View File

@ -58,12 +58,12 @@ class WalletView extends PureComponent {
} = this.props; } = this.props;
return ( return (
<ScrollView <ThemeContainer>
onScroll={handleOnScroll && handleOnScroll} {isDarkTheme => (
style={styles.scrollView} <ScrollView
refreshControl={ onScroll={handleOnScroll && handleOnScroll}
<ThemeContainer> style={styles.scrollView}
{isDarkTheme => ( refreshControl={
<RefreshControl <RefreshControl
refreshing={isRefreshing} refreshing={isRefreshing}
onRefresh={handleOnWalletRefresh} onRefresh={handleOnWalletRefresh}
@ -72,62 +72,62 @@ class WalletView extends PureComponent {
titleColor="#fff" titleColor="#fff"
colors={['#fff']} colors={['#fff']}
/> />
)} }
</ThemeContainer> >
} {!walletData ? (
> <Fragment>
{!walletData ? ( <WalletDetailsPlaceHolder />
<Fragment> </Fragment>
<WalletDetailsPlaceHolder /> ) : (
</Fragment> <Fragment>
) : ( {walletData.hasUnclaimedRewards && (
<Fragment> <CollapsibleCard
{walletData.hasUnclaimedRewards && ( titleColor="#788187"
<CollapsibleCard isBoldTitle
titleColor="#788187" defaultTitle={intl.formatMessage({
isBoldTitle id: 'profile.unclaimed_rewards',
defaultTitle={intl.formatMessage({ })}
id: 'profile.unclaimed_rewards', expanded
})}
expanded
>
{currentAccountUsername === selectedUsername ? (
<MainButton
isLoading={isClaiming}
isDisable={isClaiming}
style={styles.mainButton}
height={50}
onPress={() => claimRewardBalance()}
> >
<View style={styles.mainButtonWrapper}> {currentAccountUsername === selectedUsername ? (
{this._getUnclaimedText(walletData)} <MainButton
<View style={styles.mainIconWrapper}> isLoading={isClaiming}
<Icon name="add" iconType="MaterialIcons" color="#357ce6" size={23} /> isDisable={isClaiming}
</View> style={styles.mainButton}
</View> height={50}
</MainButton> onPress={() => claimRewardBalance()}
) : ( >
this._getUnclaimedText(walletData, true) <View style={styles.mainButtonWrapper}>
{this._getUnclaimedText(walletData)}
<View style={styles.mainIconWrapper}>
<Icon name="add" iconType="MaterialIcons" color="#357ce6" size={23} />
</View>
</View>
</MainButton>
) : (
this._getUnclaimedText(walletData, true)
)}
</CollapsibleCard>
)} )}
</CollapsibleCard> <CollapsibleCard
titleColor="#788187"
title={intl.formatMessage({
id: 'profile.wallet_details',
})}
expanded
>
<WalletDetails
intl={intl}
walletData={walletData}
isShowDropdowns={currentAccountUsername === selectedUsername}
/>
</CollapsibleCard>
<Transaction walletData={walletData} />
</Fragment>
)} )}
<CollapsibleCard </ScrollView>
titleColor="#788187"
title={intl.formatMessage({
id: 'profile.wallet_details',
})}
expanded
>
<WalletDetails
intl={intl}
walletData={walletData}
isShowDropdowns={currentAccountUsername === selectedUsername}
/>
</CollapsibleCard>
<Transaction walletData={walletData} />
</Fragment>
)} )}
</ScrollView> </ThemeContainer>
); );
} }
} }

View File

@ -5,5 +5,6 @@ export default EStyleSheet.create({
flex: 1, flex: 1,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center', alignItems: 'center',
backgroundColor: '$pureWhite',
}, },
}); });