Skip to content

Commit

Permalink
Merge pull request #1 from yujune/fix/20230416-june-fix-android-issues
Browse files Browse the repository at this point in the history
fix: Fix android issues.
  • Loading branch information
yujune authored Apr 16, 2023
2 parents 08573d7 + fc58895 commit 7544c64
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ dependencies {

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

implementation 'com.facebook.fresco:animated-gif:2.6.0'

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
Expand Down
2 changes: 2 additions & 0 deletions src/components/StatsListItem/StatsListItem.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const style = StyleSheet.create({
container: {
flexDirection: 'row',
marginVertical: AppSpacing.small,
alignItems: 'center',
},
name: {
flex: 1.5,
Expand All @@ -14,5 +15,6 @@ export const style = StyleSheet.create({
},
progressBar: {
flex: 2,
height: 15,
},
});
6 changes: 4 additions & 2 deletions src/components/StatsListItem/StatsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ export const StatsListItem: FC<Props> = ({stat}) => {
const {theme} = useCustomTheme();
return (
<View style={style.container}>
<Text numberOfLines={1} style={style.name}>
<Text numberOfLines={1} style={[theme.text?.bodyMedium, style.name]}>
{stat?.stat.name}
</Text>
<Text style={style.stat}>{stat?.base_stat}</Text>
<Text style={[theme.text?.bodyMedium, style.stat]}>
{stat?.base_stat}
</Text>
{/* TODO: animation not working */}
<Bar
style={style.progressBar}
Expand Down
8 changes: 8 additions & 0 deletions src/screens/gallery/GalleryScreen.style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {StyleSheet} from 'react-native';
import {AppSpacing} from '../../themes/theme';
import {windowWidth} from '../../utils/constants';

export const style = StyleSheet.create({
flatList: {
Expand All @@ -9,4 +10,11 @@ export const style = StyleSheet.create({
marginVertical: AppSpacing.small,
fontWeight: 'bold',
},
imageListContainer: {
flexDirection: 'row',
flexWrap: 'wrap',
},
imageContainer: {
width: windowWidth / 3.4,
},
});
18 changes: 10 additions & 8 deletions src/screens/gallery/GalleryScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ export const GalleryScreen: FC = () => {
<Text style={[theme.text?.bodyMedium, style.categoryTitle]}>
{item.name}
</Text>
<FlatList
horizontal
data={item.data}
keyExtractor={(_, index) => index.toString()}
renderItem={({item: pokemon}) => (
<PokemonListItem name={pokemon.name} customUrl={pokemon.url} />
)}
/>
<View style={style.imageListContainer}>
{item.data.map((pokemon, index) => (
<PokemonListItem
containerStyle={style.imageContainer}
key={pokemon.name + index.toString()}
name={pokemon.name}
customUrl={pokemon.url}
/>
))}
</View>
</View>
)}
/>
Expand Down

0 comments on commit 7544c64

Please sign in to comment.