[DRAFT] Android (#424)

* add android & ios folders to .gitignore

* delete android and ios dirs

* fix android build errors

* fix status bar color

* fix top cutoff on composer in android

* fix weird whitespace issue in post

* fix greyed out header android

* fix main feed getting cut off android

* fix swiping on main feed

* fix profile tabs switching on android

* A few app.json config items for iOS

* Update app.json for bgfetch

* make swiping work on android

* make splash screen cover

* add eas.json

* fix image container on android

* fix android status bar color

* use expo-splash-screen instead of react-native-splash-screen

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
Ansh 2023-04-09 18:02:44 -07:00 committed by GitHub
parent 362ea7240d
commit 14c8473210
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 212 additions and 3427 deletions

View file

@ -1,4 +1,4 @@
import React, {createRef, useState, useMemo} from 'react'
import React, {createRef, useState, useMemo, useRef} from 'react'
import {
Animated,
StyleSheet,
@ -46,6 +46,7 @@ export function TabBar({
[items.length],
)
const panX = Animated.add(position, offset)
const containerRef = useRef<View>(null)
const indicatorStyle = {
backgroundColor: indicatorColor || pal.colors.link,
@ -73,7 +74,12 @@ export function TabBar({
for (let i = 0; i < items.length; i++) {
promises.push(
new Promise<Layout>(resolve => {
itemRefs[i].current?.measure(
if (!containerRef.current || !itemRefs[i].current) {
return resolve({x: 0, width: 0})
}
itemRefs[i].current?.measureLayout(
containerRef.current,
(x: number, _y: number, width: number) => {
resolve({x, width})
},
@ -94,7 +100,11 @@ export function TabBar({
}
return (
<View testID={testID} style={[pal.view, styles.outer]} onLayout={onLayout}>
<View
testID={testID}
style={[pal.view, styles.outer]}
onLayout={onLayout}
ref={containerRef}>
<Animated.View style={[styles.indicator, indicatorStyle]} />
{items.map((item, i) => {
const selected = i === selectedPage