feat(Theme): enhance theming and UI consistency across components
- Updated app.json to set userInterfaceStyle to automatic for improved theme adaptability. - Refactored layout components to utilize useAppColors for dynamic theming, ensuring consistent color usage. - Introduced SystemChrome component to manage system UI background color based on theme. - Enhanced TabsLayout, ProfileStackLayout, and other components to leverage new theming structure. - Improved QRCodeScanner, SearchBar, and CommentItem styles to align with the updated theme system. - Consolidated styles in SystemMessageItem and TabBar for better maintainability and visual coherence.
This commit is contained in:
@@ -23,7 +23,14 @@ import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
||||
import { useFocusEffect } from '@react-navigation/native';
|
||||
import { useRouter } from 'expo-router';
|
||||
import { colors, fontSizes, spacing, borderRadius, shadows } from '../../theme';
|
||||
import {
|
||||
fontSizes,
|
||||
spacing,
|
||||
borderRadius,
|
||||
shadows,
|
||||
useAppColors,
|
||||
type AppColors,
|
||||
} from '../../theme';
|
||||
import { useResponsive } from '../../hooks/useResponsive';
|
||||
import {
|
||||
Course,
|
||||
@@ -148,6 +155,8 @@ const getWeekDates = (weekOffset: number = 0) => {
|
||||
const INITIAL_WEEK = getCurrentWeekNumber();
|
||||
|
||||
export const ScheduleScreen: React.FC = () => {
|
||||
const colors = useAppColors();
|
||||
const styles = useMemo(() => createScheduleStyles(colors), [colors]);
|
||||
const router = useRouter();
|
||||
// 使用响应式 hook 检测屏幕尺寸
|
||||
const { width: screenWidth, height: screenHeight, isMobile, platform } = useResponsive();
|
||||
@@ -1063,7 +1072,8 @@ export const ScheduleScreen: React.FC = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
function createScheduleStyles(colors: AppColors) {
|
||||
return StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: colors.background.paper,
|
||||
@@ -1483,6 +1493,7 @@ const styles = StyleSheet.create({
|
||||
color: colors.text.secondary,
|
||||
fontWeight: '500',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default ScheduleScreen;
|
||||
|
||||
Reference in New Issue
Block a user