feat: Implement Food Camera Screen and Floating Food Overlay

- Added FoodCameraScreen for capturing food images with camera functionality.
- Integrated image picker for selecting images from the gallery.
- Created FloatingFoodOverlay for quick access to food library and scanning options.
- Updated NutritionRadarCard to utilize FloatingFoodOverlay for adding food.
- Enhanced ExploreScreen layout and styles for better user experience.
- Removed unused SafeAreaView from ExploreScreen.
- Updated profile edit screen to remove unnecessary state variables.
- Updated avatar image source in profile edit screen.
- Added ExpoCamera dependency for camera functionalities.
This commit is contained in:
richarjiang
2025-09-03 19:17:26 +08:00
parent 45f8415a38
commit 02883869fe
10 changed files with 931 additions and 233 deletions

View File

@@ -9,6 +9,7 @@ import { useColorScheme } from '@/hooks/useColorScheme';
export type HeaderBarProps = {
title: string | React.ReactNode;
onBack?: () => void;
backColor?: string;
right?: React.ReactNode;
tone?: 'light' | 'dark';
showBottomBorder?: boolean;
@@ -20,6 +21,7 @@ export type HeaderBarProps = {
export function HeaderBar({
title,
onBack,
backColor,
right,
tone,
showBottomBorder = false,
@@ -34,7 +36,7 @@ export function HeaderBar({
// 根据变体确定背景色和样式
const getBackgroundColor = () => {
if (transparent) return 'transparent';
switch (variant) {
case 'elevated':
return theme.background;
@@ -47,11 +49,11 @@ export function HeaderBar({
const getBorderStyle = () => {
if (!showBottomBorder) return {};
return {
borderBottomWidth: 1,
borderBottomColor: variant === 'elevated'
? theme.border
borderBottomColor: variant === 'elevated'
? theme.border
: `${theme.border}40`, // 40% 透明度
};
};
@@ -75,16 +77,16 @@ export function HeaderBar({
]}
>
{onBack ? (
<TouchableOpacity
accessibilityRole="button"
onPress={onBack}
<TouchableOpacity
accessibilityRole="button"
onPress={onBack}
style={styles.backButton}
activeOpacity={0.7}
>
<Ionicons
name="chevron-back"
size={24}
color={theme.text}
<Ionicons
name="chevron-back"
size={24}
color={backColor || theme.text}
/>
</TouchableOpacity>
) : (
@@ -94,8 +96,8 @@ export function HeaderBar({
<View style={styles.titleContainer}>
{typeof title === 'string' ? (
<Text style={[
styles.title,
{
styles.title,
{
color: theme.text,
fontWeight: variant === 'elevated' ? '700' : '800',
}