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() {
const { onPressReload, bust } = this.props
const { mount, start, progress, end } = this.state
return (
<View> <View>
<Section> <Section>
<FeatureText text="• Progress callbacks." /> <FeatureText text="• Progress callbacks." />
</Section> </Section>
<SectionFlex onPress={onPressReload}> <SectionFlex
onPress={onPressReload}
style={{
flexDirection: 'column',
alignItems: 'center',
paddingBottom: 20,
}}
>
<FastImage <FastImage
style={styles.image} style={styles.image}
source={{ source={{
uri: IMAGE_URL + bust, uri: IMAGE_URL + bust,
}} }}
{...getTestProgressCallbacks('ProgressExample')} 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> </SectionFlex>
</View> </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>