33 * Created by Rabbit on 2019-02-25.
44 */
55import React , { useEffect , useRef } from 'react' ;
6- import { StyleSheet } from 'react-native' ;
6+ import { StyleSheet , ActivityIndicator } from 'react-native' ;
77import { WaterfallList } from 'react-native-largelist-v3' ;
88import { NormalFooter } from 'react-native-spring-scrollview/NormalFooter' ;
99
@@ -12,7 +12,8 @@ import { WelfareMobx } from '../../../mobx/News';
1212import { observer } from 'mobx-react-lite' ;
1313
1414import type { RTWeal } from '../../../servers/News/interfaces' ;
15- import { Button , CustomImage } from '../../../components' ;
15+ import { Button } from '../../../components' ;
16+ import { CustomImage } from '../../../components/CustomImage/index_new' ;
1617import { System } from '../../../utils' ;
1718import { ActionSheet , Overlay } from 'teaset' ;
1819import type { NavigationState } from 'react-navigation' ;
@@ -60,7 +61,7 @@ const Welfare = observer(function(props: Props) {
6061 function showPopCustom ( item : RTWeal ) {
6162 const overlayView = (
6263 < Overlay . PopView
63- style = { { alignItems : 'center' , justifyContent : 'center' } }
64+ // style={{ alignItems: 'center', justifyContent: 'center' }}
6465 overlayOpacity = { 1 }
6566 type = "zoomOut"
6667 ref = { customOverlayRef }
@@ -71,12 +72,14 @@ const Welfare = observer(function(props: Props) {
7172 >
7273 < CustomImage
7374 source = { { uri : item . largeUrl } }
74- // resizeMode="cover "
75+ resizeMode = "contain "
7576 style = { {
76- backgroundColor : 'white' ,
77+ // backgroundColor: 'white',
7778 width : SCREEN_WIDTH ,
7879 height : SCREEN_HEIGHT
7980 } }
81+ PlaceholderContent = { < ActivityIndicator /> }
82+ placeholderStyle = { { backgroundColor : 'black' } }
8083 />
8184 </ Button >
8285 </ Overlay . PopView >
@@ -87,7 +90,13 @@ const Welfare = observer(function(props: Props) {
8790 function renderItem ( item : RTWeal ) {
8891 return (
8992 < Button onPress = { ( ) => showPopCustom ( item ) } style = { { flex : 1 } } >
90- < CustomImage source = { { uri : item . url } } style = { [ styles . cell ] } />
93+ < CustomImage
94+ source = { { uri : item . url } }
95+ containerStyle = { [ styles . cell ] }
96+ style = { { flex : 1 } }
97+ placeholderStyle = { { backgroundColor : 'white' } }
98+ PlaceholderContent = { < ActivityIndicator /> }
99+ />
91100 </ Button >
92101 ) ;
93102 }
@@ -121,7 +130,11 @@ const styles = StyleSheet.create({
121130 } ,
122131 cell : {
123132 flex : 1 ,
124- margin : 3 ,
125- backgroundColor : 'white'
133+ margin : 3
134+ // backgroundColor: 'white',
135+ // height: 100,
136+ // width: 100,
137+ // width: SCREEN_WIDTH / 2 - 5,
138+ // height: 300
126139 }
127140} ) ;
0 commit comments