初版
This commit is contained in:
commit
8a60654731
82 files changed
+22637
No files matched your search
@@ -0,0 +1,73 @@
|
||||
import * as React from "react";
|
||||
import { NavigationContainer } from "@react-navigation/native";
|
||||
import { createNativeStackNavigator } from "@react-navigation/native-stack";
|
||||
|
||||
import HomeScreen from "./src/HomeScreen";
|
||||
import ScanScreen from "./src/ScanScreen";
|
||||
import InfoScreen from "./src/InfoScreen";
|
||||
import DfuScreen from "./src/DfuScreen";
|
||||
import PrivacyScreen from "./src/PrivacyScreen";
|
||||
import SplashScreen from "./src/SplashScreen"; // ✅ 新增启动页
|
||||
|
||||
export type RootStackParamList = {
|
||||
Splash: undefined;
|
||||
Home: undefined;
|
||||
Scan: undefined;
|
||||
Info: { peripheral: any };
|
||||
Dfu: { deviceId: string; name: string; firmware: string };
|
||||
Privacy: undefined;
|
||||
};
|
||||
|
||||
const Stack = createNativeStackNavigator<RootStackParamList>();
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<NavigationContainer>
|
||||
<Stack.Navigator
|
||||
initialRouteName="Splash"
|
||||
// ✅ 统一所有导航栏样式
|
||||
screenOptions={{
|
||||
headerStyle: { backgroundColor: "#E7141E" }, // 顶部背景红色
|
||||
headerTintColor: "#fff", // 返回箭头和文字为白色
|
||||
headerTitleStyle: { fontWeight: "bold", color: "#fff" }, // 标题白色+加粗
|
||||
}}
|
||||
>
|
||||
{/* 启动页(无标题) */}
|
||||
<Stack.Screen
|
||||
name="Splash"
|
||||
component={SplashScreen}
|
||||
options={{ headerShown: false }}
|
||||
/>
|
||||
|
||||
{/* 首页(标题栏无文字) */}
|
||||
<Stack.Screen
|
||||
name="Home"
|
||||
component={HomeScreen}
|
||||
options={{ title: "" }}
|
||||
/>
|
||||
|
||||
{/* 其他页面默认显示标题栏 */}
|
||||
<Stack.Screen
|
||||
name="Scan"
|
||||
component={ScanScreen}
|
||||
options={{ title: "搜索设备" }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Info"
|
||||
component={InfoScreen}
|
||||
options={{ title: "设备信息" }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Dfu"
|
||||
component={DfuScreen}
|
||||
options={{ title: "固件升级" }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="Privacy"
|
||||
component={PrivacyScreen}
|
||||
options={{ title: "隐私协议" }}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
</NavigationContainer>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user