Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ yarn-error.*
# typescript
*.tsbuildinfo

android/*
android/*
ios/*
3 changes: 0 additions & 3 deletions app/App.tsx

This file was deleted.

15 changes: 9 additions & 6 deletions app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"expo": {
"name": "friend-lite-app",
"slug": "friend-lite-app",
"scheme": "friendlite",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"entryPoint": "./app/index.tsx",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
Expand All @@ -17,7 +17,7 @@
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.cupbearer5517.friendlite",
"bundleIdentifier": "com.sigmoid.friendlite",
"infoPlist": {
"NSMicrophoneUsageDescription": "Friend-Lite needs access to your microphone to stream audio to the backend for processing."
}
Expand All @@ -27,7 +27,7 @@
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.cupbearer5517.friendlite",
"package": "com.sigmoid.friendlite",
"permissions": [
"android.permission.BLUETOOTH",
"android.permission.BLUETOOTH_ADMIN",
Expand All @@ -49,7 +49,9 @@
"enableNotifications": true,
"enableBackgroundAudio": true,
"enableDeviceDetection": true,
"iosBackgroundModes": { "useProcessing": true },
"iosBackgroundModes": {
"useProcessing": true
},
"iosConfig": {
"microphoneUsageDescription": "We use the mic for live audio streaming"
}
Expand Down Expand Up @@ -91,12 +93,13 @@
]
}
}
]
],
"expo-router"
],
"extra": {
"eas": {
"projectId": "05d8598e-6fe7-4373-81e4-1654f3d8e181"
}
}
}
}
}
14 changes: 13 additions & 1 deletion app/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { Stack } from "expo-router";
import { useEffect } from "react";

export default function RootLayout() {
return <Stack />;
useEffect(() => {
console.log('[RootLayout] Navigation container initialized');
}, []);

return (
<Stack
screenOptions={{
headerShown: false,
animation: 'slide_from_right',
}}
/>
);
}
59 changes: 41 additions & 18 deletions app/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import React, { useRef, useCallback, useEffect, useState } from 'react';
import { StyleSheet, Text, View, SafeAreaView, ScrollView, Platform, FlatList, ActivityIndicator, Alert, Switch, Button, TouchableOpacity, KeyboardAvoidingView } from 'react-native';
import { OmiConnection } from 'friend-lite-react-native'; // OmiDevice also comes from here
import { State as BluetoothState } from 'react-native-ble-plx'; // Import State from ble-plx
import { Link } from 'expo-router';

// Hooks
import { useBluetoothManager } from './hooks/useBluetoothManager';
import { useDeviceScanning } from './hooks/useDeviceScanning';
import { useDeviceConnection } from './hooks/useDeviceConnection';
import { useBluetoothManager } from '../src/hooks/useBluetoothManager';
import { useDeviceScanning } from '../src/hooks/useDeviceScanning';
import { useDeviceConnection } from '../src/hooks/useDeviceConnection';
import {
saveLastConnectedDeviceId,
getLastConnectedDeviceId,
Expand All @@ -16,24 +17,26 @@ import {
getUserId,
getAuthEmail,
getJwtToken,
} from './utils/storage';
import { useAudioListener } from './hooks/useAudioListener';
import { useAudioStreamer } from './hooks/useAudioStreamer';
import { usePhoneAudioRecorder } from './hooks/usePhoneAudioRecorder';
} from '../src/utils/storage';
import { useAudioListener } from '../src/hooks/useAudioListener';
import { useAudioStreamer } from '../src/hooks/useAudioStreamer';
import { usePhoneAudioRecorder } from '../src/hooks/usePhoneAudioRecorder';

// Components
import BluetoothStatusBanner from './components/BluetoothStatusBanner';
import ScanControls from './components/ScanControls';
import DeviceListItem from './components/DeviceListItem';
import DeviceDetails from './components/DeviceDetails';
import AuthSection from './components/AuthSection';
import BackendStatus from './components/BackendStatus';
import PhoneAudioButton from './components/PhoneAudioButton';
import BluetoothStatusBanner from '../src/components/BluetoothStatusBanner';
import ScanControls from '../src/components/ScanControls';
import DeviceListItem from '../src/components/DeviceListItem';
import DeviceDetails from '../src/components/DeviceDetails';
import AuthSection from '../src/components/AuthSection';
import BackendStatus from '../src/components/BackendStatus';
import PhoneAudioButton from '../src/components/PhoneAudioButton';

export default function App() {
// Initialize OmiConnection
const omiConnection = useRef(new OmiConnection()).current;

// Removed router navigation - using Link component instead

// Filter state
const [showOnlyOmi, setShowOnlyOmi] = useState(false);

Expand Down Expand Up @@ -517,11 +520,18 @@ export default function App() {
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={Platform.OS === 'ios' ? 100 : 0}
>
<ScrollView
<ScrollView
contentContainerStyle={styles.content}
keyboardShouldPersistTaps="handled"
>
<Text style={styles.title}>Friend Lite</Text>
<View style={styles.headerContainer}>
<Text style={styles.title}>Friend Lite</Text>
<Link href="/stats" asChild>
<TouchableOpacity style={styles.statsButton}>
<Text style={styles.statsIcon}>⚙️</Text>
</TouchableOpacity>
</Link>
</View>

{/* Backend Connection - moved to top */}
<BackendStatus
Expand Down Expand Up @@ -713,12 +723,25 @@ const styles = StyleSheet.create({
paddingTop: Platform.OS === 'android' ? 30 : 10,
paddingBottom: 50,
},
headerContainer: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
marginBottom: 20,
position: 'relative',
},
title: {
fontSize: 24,
fontWeight: 'bold',
marginBottom: 20,
color: '#333',
textAlign: 'center',
},
statsButton: {
position: 'absolute',
right: 0,
padding: 8,
},
statsIcon: {
fontSize: 24,
},
section: {
marginBottom: 25,
Expand Down
Loading
Loading