Skip to content

Commit fc7de74

Browse files
fix(ui): improve pull-to-refresh and splash screen timing
Pull-to-Refresh Improvements: - Hide native RefreshControl spinner completely in all tabs (home, wifi, sms) - Use progressViewOffset=-1000 to move native spinner off-screen - Use transparent tintColor and colors for invisible native indicator - ModernRefreshIndicator now sole visual indicator for refresh Splash Screen Timing Fix: - Hide native splash earlier (when fonts loaded, not after login) - Show AnimatedSplashScreen during silent login process - AnimatedSplashScreen now visible until authReady=true - Fixes issue where login happened during native white splash Files changed: - home.tsx, wifi.tsx, sms.tsx: Updated RefreshControl props - _layout.tsx: Fixed splash screen timing logic
1 parent e21149b commit fc7de74

6 files changed

Lines changed: 27 additions & 21 deletions

File tree

app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
2525
...config,
2626
name: 'Huawei Manager',
2727
slug: 'hm-mobile',
28-
version: '1.1.05',
28+
version: '1.1.07',
2929
orientation: 'portrait',
3030
icon: './assets/logo.png',
3131
userInterfaceStyle: 'automatic',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hm-mobile",
3-
"version": "1.1.05",
3+
"version": "1.1.07",
44
"main": "index.js",
55
"scripts": {
66
"start": "expo start",

src/app/(tabs)/home.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,12 @@ export default function HomeScreen() {
774774
<RefreshControl
775775
refreshing={isRefreshing}
776776
onRefresh={handleRefresh}
777-
tintColor={isDark ? '#FFFFFF' : 'transparent'}
778-
colors={isDark ? ['#FFFFFF'] : ['transparent']}
777+
// Hide native spinner completely - use ModernRefreshIndicator instead
778+
tintColor="transparent"
779+
colors={['transparent']}
779780
progressBackgroundColor="transparent"
780-
progressViewOffset={50}
781+
progressViewOffset={-1000}
782+
style={{ backgroundColor: 'transparent' }}
781783
/>
782784
}
783785
>

src/app/(tabs)/sms.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,12 @@ export default function SMSScreen() {
392392
<RefreshControl
393393
refreshing={isRefreshing}
394394
onRefresh={handleRefresh}
395-
tintColor={isDark ? '#FFFFFF' : 'transparent'}
396-
colors={isDark ? ['#FFFFFF'] : ['transparent']}
395+
// Hide native spinner completely - use ModernRefreshIndicator instead
396+
tintColor="transparent"
397+
colors={['transparent']}
397398
progressBackgroundColor="transparent"
398-
progressViewOffset={50}
399+
progressViewOffset={-1000}
400+
style={{ backgroundColor: 'transparent' }}
399401
/>
400402
}
401403
>

src/app/(tabs)/wifi.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,12 @@ export default function WiFiScreen() {
679679
<RefreshControl
680680
refreshing={isRefreshing}
681681
onRefresh={handleRefresh}
682-
tintColor={isDark ? '#FFFFFF' : 'transparent'}
683-
colors={isDark ? ['#FFFFFF'] : ['transparent']}
682+
// Hide native spinner completely - use ModernRefreshIndicator instead
683+
tintColor="transparent"
684+
colors={['transparent']}
684685
progressBackgroundColor="transparent"
685-
progressViewOffset={50}
686+
progressViewOffset={-1000}
687+
style={{ backgroundColor: 'transparent' }}
686688
/>
687689
}
688690
keyboardShouldPersistTaps="handled"

src/app/_layout.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,22 @@ export default function RootLayout() {
7575
const [isRestoringSession, setIsRestoringSession] = useState(false);
7676
const [authReady, setAuthReady] = useState(false); // Track when auth check is complete
7777

78-
// Hide splash screen when BOTH fonts loaded AND auth checked
78+
// Hide native splash screen when fonts loaded (show AnimatedSplashScreen during login)
7979
const onLayoutRootView = useCallback(async () => {
80-
if (fontsLoaded && authReady) {
81-
// Small delay for smoother transition
82-
await new Promise(resolve => setTimeout(resolve, 200));
80+
if (fontsLoaded) {
81+
// Hide native splash immediately when fonts ready
82+
// AnimatedSplashScreen will show until auth is complete
8383
await SplashScreen.hideAsync();
8484
setAppIsReady(true);
8585
}
86-
}, [fontsLoaded, authReady]);
86+
}, [fontsLoaded]);
8787

88-
// Trigger splash hide when ready
88+
// Trigger native splash hide when fonts ready
8989
useEffect(() => {
90-
if (fontsLoaded && authReady) {
90+
if (fontsLoaded) {
9191
onLayoutRootView();
9292
}
93-
}, [fontsLoaded, authReady, onLayoutRootView]);
93+
}, [fontsLoaded, onLayoutRootView]);
9494

9595
// Handle Android Navigation Bar Colors
9696
useEffect(() => {
@@ -384,8 +384,8 @@ export default function RootLayout() {
384384
}
385385
}, [isAuthenticated, segments]);
386386

387-
// Show animated splash screen while loading
388-
if (!fontsLoaded || !appIsReady) {
387+
// Show animated splash screen while loading fonts or during login
388+
if (!fontsLoaded || !authReady) {
389389
return <AnimatedSplashScreen isLoading={true} />;
390390
}
391391

0 commit comments

Comments
 (0)