Revert change to android manifest.

This commit is contained in:
Dylan Vann 2018-05-06 03:44:02 -04:00
parent bf67634a44
commit 52ccc8ce9a
2 changed files with 63 additions and 28 deletions

View File

@ -1,5 +1,5 @@
import React from 'react' import React, { Component } from 'react'
import { StyleSheet, View } from 'react-native' import { StyleSheet, View, Text } from 'react-native'
import withCacheBust from './withCacheBust' import withCacheBust from './withCacheBust'
import SectionFlex from './SectionFlex' import SectionFlex from './SectionFlex'
import FastImage from 'react-native-fast-image' import FastImage from 'react-native-fast-image'
@ -8,33 +8,63 @@ import FeatureText from './FeatureText'
const IMAGE_URL = 'https://media.giphy.com/media/GEsoqZDGVoisw/giphy.gif' const IMAGE_URL = 'https://media.giphy.com/media/GEsoqZDGVoisw/giphy.gif'
const getTestProgressCallbacks = label => ({ class ProgressExample extends Component {
onLoadStart: () => console.log(`${label} - onLoadStart`), state = {
onProgress: e => mount: new Date(),
console.log( start: undefined,
`${label} - onProgress - ${e.nativeEvent.loaded / e.nativeEvent.total}`, progress: undefined,
), end: undefined,
onLoad: e => console.log(`${label} - onLoad`, e.nativeEvent), }
onError: () => console.log(`${label} - onError`),
onLoadEnd: () => console.log(`${label} - onLoadEnd`),
})
const ProgressExample = ({ onPressReload, bust }) => ( render() {
<View> const { onPressReload, bust } = this.props
<Section> const { mount, start, progress, end } = this.state
<FeatureText text="• Progress callbacks." /> return (
</Section> <View>
<SectionFlex onPress={onPressReload}> <Section>
<FastImage <FeatureText text="• Progress callbacks." />
style={styles.image} </Section>
source={{ <SectionFlex
uri: IMAGE_URL + bust, onPress={onPressReload}
}} style={{
{...getTestProgressCallbacks('ProgressExample')} flexDirection: 'column',
/> alignItems: 'center',
</SectionFlex> paddingBottom: 20,
</View> }}
) >
<FastImage
style={styles.image}
source={{
uri: IMAGE_URL + bust,
}}
onLoadStart={() => this.setState({ start: Date.now() })}
onProgress={e =>
this.setState({
progress: Math.round(
100 * (e.nativeEvent.loaded / e.nativeEvent.total),
),
})
}
onLoad={() => this.setState({ end: Date.now() })}
onLoadEnd={() => {}}
/>
<Text>
onLoadStart
{start !== undefined && ` - ${start - mount} ms`}
</Text>
<Text>
onProgress
{progress !== undefined && ` - ${progress} %`}
</Text>
<Text>
onLoad
{end !== undefined && ` - ${end - mount} ms`}
</Text>
</SectionFlex>
</View>
)
}
}
const styles = StyleSheet.create({ const styles = StyleSheet.create({
image: { image: {

View File

@ -8,5 +8,10 @@
android:name="com.dylanvann.fastimage.OkHttpProgressGlideModule" android:name="com.dylanvann.fastimage.OkHttpProgressGlideModule"
android:value="GlideModule" android:value="GlideModule"
/> />
<meta-data
android:name="com.bumptech.glide.integration.okhttp.OkHttpGlideModule"
tools:node="remove"
android:value="GlideModule"
/>
</application> </application>
</manifest> </manifest>