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"
onRightIconPress={readAllNotification}
/>
<FlatList
data={_notifications}
refreshing={isNotificationRefreshing}
onRefresh={() => getActivities()}
keyExtractor={item => item.title}
onEndReached={() => getActivities(null, selectedFilter, true)}
ListFooterComponent={this._renderFooterLoading}
ListEmptyComponent={<ListPlaceHolder />}
refreshControl={
<ThemeContainer>
{({ isDarkTheme }) => (
<ThemeContainer>
{({ isDarkTheme }) => (
<FlatList
data={_notifications}
refreshing={isNotificationRefreshing}
onRefresh={() => getActivities()}
keyExtractor={item => item.title}
onEndReached={() => getActivities(null, selectedFilter, true)}
ListFooterComponent={this._renderFooterLoading}
ListEmptyComponent={<ListPlaceHolder />}
refreshControl={
<RefreshControl
refreshing={isNotificationRefreshing}
progressBackgroundColor="#357CE6"
@ -183,21 +183,21 @@ class NotificationView extends PureComponent {
titleColor="#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 File

@ -40,22 +40,18 @@ class PointsView extends Component {
// Component Functions
refreshControl = () => {
refreshControl = ({ isDarkTheme }) => {
const { fetchUserActivity, refreshing } = this.props;
return (
<ThemeContainer>
{isDarkTheme => (
<RefreshControl
refreshing={refreshing}
onRefresh={fetchUserActivity}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
)}
</ThemeContainer>
<RefreshControl
refreshing={refreshing}
onRefresh={fetchUserActivity}
progressBackgroundColor="#357CE6"
tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'}
titleColor="#fff"
colors={['#fff']}
/>
);
};
@ -100,147 +96,166 @@ class PointsView extends Component {
return (
<Fragment>
<LineBreak height={12} />
<ScrollView style={styles.scrollContainer} refreshControl={this.refreshControl()}>
<View style={styles.pointsWrapper}>
<Text onPress={this._showDropdown} style={styles.pointText}>
{get(userPoints, 'points')}
</Text>
<DropdownButton
dropdownRowWrapper={styles.dropdownRowStyle}
dropdownRef={this.dropdownRef}
isHasChildIcon
iconName="arrow-drop-down"
options={[
intl.formatMessage({ id: 'points.dropdown_transfer' }),
intl.formatMessage({ id: 'points.dropdown_promote' }),
intl.formatMessage({ id: 'points.dropdown_boost' }),
]}
noHighlight
dropdownButtonStyle={styles.dropdownButtonStyle}
onSelect={handleOnDropdownSelected}
rowTextStyle={styles.dropdownRowText}
dropdownStyle={styles.dropdownStyle}
/>
</View>
<Text style={styles.subText}>{intl.formatMessage({ id: 'points.esteemPoints' })}</Text>
<MainButton
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} />
<ThemeContainer>
{isDarkTheme => (
<ScrollView
style={styles.scrollContainer}
refreshControl={this.refreshControl({ isDarkTheme })}
>
<View style={styles.pointsWrapper}>
<Text onPress={this._showDropdown} style={styles.pointText}>
{get(userPoints, 'points')}
</Text>
<DropdownButton
dropdownRowWrapper={styles.dropdownRowStyle}
dropdownRef={this.dropdownRef}
isHasChildIcon
iconName="arrow-drop-down"
options={[
intl.formatMessage({ id: 'points.dropdown_transfer' }),
intl.formatMessage({ id: 'points.dropdown_promote' }),
intl.formatMessage({ id: 'points.dropdown_boost' }),
]}
noHighlight
dropdownButtonStyle={styles.dropdownButtonStyle}
onSelect={handleOnDropdownSelected}
rowTextStyle={styles.dropdownRowText}
dropdownStyle={styles.dropdownStyle}
/>
</View>
</View>
</MainButton>
<Text style={styles.subText}>
{intl.formatMessage({ id: 'points.esteemPoints' })}
</Text>
<View style={styles.iconsWrapper}>
<FlatList
style={styles.iconsList}
data={POINTS_KEYS}
keyExtractor={item => get(item, 'type', Math.random()).toString()}
horizontal
renderItem={({ item }) => (
<PopoverController key={get(item, 'type')}>
{({
openPopover,
closePopover,
popoverVisible,
setPopoverAnchor,
popoverAnchorRect,
}) => (
<View styles={styles.iconWrapper} key={get(item, 'type')}>
<View style={styles.iconWrapper}>
<TouchableOpacity ref={setPopoverAnchor} onPress={openPopover}>
<IconButton
iconStyle={styles.icon}
style={styles.iconButton}
iconType={get(POINTS[get(item, 'type')], 'iconType')}
name={get(POINTS[get(item, 'type')], 'icon')}
badgeCount={get(POINTS[get(item, 'type')], 'point')}
badgeStyle={styles.badge}
badgeTextStyle={styles.badgeText}
disabled
/>
</TouchableOpacity>
</View>
<Text style={styles.subText}>
{this._getTranslation(get(POINTS[get(item, 'type')], 'nameKey'))}
</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'))}
<MainButton
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>
</MainButton>
<View style={styles.iconsWrapper}>
<FlatList
style={styles.iconsList}
data={POINTS_KEYS}
keyExtractor={item => get(item, 'type', Math.random()).toString()}
horizontal
renderItem={({ item }) => (
<PopoverController key={get(item, 'type')}>
{({
openPopover,
closePopover,
popoverVisible,
setPopoverAnchor,
popoverAnchorRect,
}) => (
<View styles={styles.iconWrapper} key={get(item, 'type')}>
<View style={styles.iconWrapper}>
<TouchableOpacity ref={setPopoverAnchor} onPress={openPopover}>
<IconButton
iconStyle={styles.icon}
style={styles.iconButton}
iconType={get(POINTS[get(item, 'type')], 'iconType')}
name={get(POINTS[get(item, 'type')], 'icon')}
badgeCount={get(POINTS[get(item, 'type')], 'point')}
badgeStyle={styles.badge}
badgeTextStyle={styles.badgeText}
disabled
/>
</TouchableOpacity>
</View>
<Text style={styles.subText}>
{this._getTranslation(get(POINTS[get(item, 'type')], 'nameKey'))}
</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>
</Popover>
</View>
)}
</PopoverController>
)}
</PopoverController>
)}
/>
</View>
/>
</View>
<View style={styles.listWrapper}>
<FlatList
data={userActivities}
keyExtractor={item => item.id.toString()}
ListEmptyComponent={this._renderLoading()}
renderItem={({ item, index }) => (
<CollapsibleCard
noBorder
noContainer
key={item.id.toString()}
titleComponent={
<WalletLineItem
index={index + 1}
text={this._getTranslation(get(item, 'textKey'))}
description={getTimeFromNow(get(item, 'created'))}
isCircleIcon
isThin
isBlackText
iconName={get(item, 'icon')}
iconType={get(item, 'iconType')}
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')}`
<View style={styles.listWrapper}>
<FlatList
data={userActivities}
keyExtractor={item => item.id.toString()}
ListEmptyComponent={this._renderLoading()}
renderItem={({ item, index }) => (
<CollapsibleCard
noBorder
noContainer
key={item.id.toString()}
titleComponent={
<WalletLineItem
index={index + 1}
text={this._getTranslation(get(item, 'textKey'))}
description={getTimeFromNow(get(item, 'created'))}
isCircleIcon
isThin
isBlackText
iconName={get(item, 'icon')}
iconType={get(item, 'iconType')}
rightText={`${get(item, 'amount')} ESTM`}
/>
}
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>
);
}

View File

@ -376,27 +376,27 @@ class PostsView extends Component {
/>
)}
<FlatList
data={posts}
showsVerticalScrollIndicator={false}
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
refreshing={refreshing}
onRefresh={() => this._handleOnRefreshPosts()}
onEndThreshold={0}
initialNumToRender={10}
ListFooterComponent={this._renderFooter}
onScrollEndDrag={this._handleOnScroll}
ListEmptyComponent={this._renderEmptyContent}
refreshControl={
<ThemeContainer>
{({ isDarkTheme }) => (
<ThemeContainer>
{({ isDarkTheme }) => (
<FlatList
data={posts}
showsVerticalScrollIndicator={false}
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
refreshing={refreshing}
onRefresh={() => this._handleOnRefreshPosts()}
onEndThreshold={0}
initialNumToRender={10}
ListFooterComponent={this._renderFooter}
onScrollEndDrag={this._handleOnScroll}
ListEmptyComponent={this._renderEmptyContent}
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={this._handleOnRefreshPosts}
@ -405,13 +405,13 @@ class PostsView extends Component {
titleColor="#fff"
colors={['#fff']}
/>
)}
</ThemeContainer>
}
ref={ref => {
this.flatList = ref;
}}
/>
}
ref={ref => {
this.flatList = ref;
}}
/>
)}
</ThemeContainer>
</View>
);
}

View File

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

View File

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