-
Notifications
You must be signed in to change notification settings - Fork 77
@mlodyjesienin/example app UI #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8fa203a
feat: use expo router and add drawer to enhance ux
mlodyjesienin 89dd2c5
feat: expo routers, drawer navigation, small fixes
mlodyjesienin 09b523a
fix: deps for apps/computer-vision
mlodyjesienin cfb4fe9
fix: scheme and typos, computer-vision
mlodyjesienin ec4d27f
feat: disable camera on emulator for computer-vision
mlodyjesienin e261b9c
fix: Change order (OCR Vertical) in computer-vision
mlodyjesienin 59fa5d7
fix: dependecies and scheme for app/llm
mlodyjesienin 660020d
fix: disable voice chat on emulator and change to moonshine apps/llm/…
mlodyjesienin 55e988f
fix: remove redundant llm tool calling information
mlodyjesienin 62bbdad
work in progress - fix:switching between screens while model is gener…
mlodyjesienin 4a0e7c4
feat: clear list button and disabled buttons logic for apps/text-embe…
mlodyjesienin 9fad500
fix: proper your-scheme value in android/ files
mlodyjesienin fec4dc1
refactor: get rid of not used LlmContext
mlodyjesienin 7eeebce
fix: after rebase main build issues
mlodyjesienin c503ab9
fix: after rebase main build issues, increase memory limit ios
mlodyjesienin 9bc6d65
fix: fully removed wheel-scroll-picker from the deps
mlodyjesienin cd6c900
Added custom drawer content and forced reloads on Screen components w…
pweglik 2741dcd
Merge branch '@mlodyjesienin/example-app-ui' remote with local
mlodyjesienin aa7a6b1
fix: truly disable camera in computer-vision on emulator
mlodyjesienin 688ea55
refactor: rename ScreenWrapper to Pascal Case
mlodyjesienin 7b9433f
fix: case sensitivity issues with renaming ScreenWrapper
mlodyjesienin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/computer-vision/android/app/src/main/res/values/styles.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| import { Drawer } from 'expo-router/drawer'; | ||
| import ColorPalette from '../colors'; | ||
| import React, { useState } from 'react'; | ||
| import { Text, StyleSheet, View } from 'react-native'; | ||
|
|
||
| import { | ||
| DrawerContentComponentProps, | ||
| DrawerContentScrollView, | ||
| DrawerItemList, | ||
| } from '@react-navigation/drawer'; | ||
| import { GeneratingContext } from '../context'; | ||
|
|
||
| interface CustomDrawerProps extends DrawerContentComponentProps { | ||
| isGenerating: boolean; | ||
| } | ||
|
|
||
| function CustomDrawerContent(props: CustomDrawerProps) { | ||
| const { isGenerating, ...otherProps } = props; | ||
| return ( | ||
| <DrawerContentScrollView {...otherProps}> | ||
| {!isGenerating ? ( | ||
| <DrawerItemList {...otherProps} /> | ||
| ) : ( | ||
| <View style={styles.centerContent}> | ||
| <Text style={styles.mainText}>Model is generating...</Text> | ||
| <Text style={styles.subText}>Interrupt before switching model</Text> | ||
| </View> | ||
| )} | ||
| </DrawerContentScrollView> | ||
| ); | ||
| } | ||
|
|
||
| export default function _layout() { | ||
| const [isGenerating, setIsGenerating] = useState(false); | ||
|
|
||
| return ( | ||
| <GeneratingContext | ||
| value={{ | ||
| setGlobalGenerating: (newState: boolean) => { | ||
| setIsGenerating(newState); | ||
| }, | ||
| }} | ||
| > | ||
| <Drawer | ||
| drawerContent={(props) => ( | ||
| <CustomDrawerContent {...props} isGenerating={isGenerating} /> | ||
| )} | ||
| screenOptions={{ | ||
| drawerActiveTintColor: ColorPalette.primary, | ||
| drawerInactiveTintColor: '#888', | ||
| headerTintColor: ColorPalette.primary, | ||
| headerTitleStyle: { color: ColorPalette.primary }, | ||
| }} | ||
| > | ||
| <Drawer.Screen | ||
| name="classification/index" | ||
| options={{ | ||
| drawerLabel: 'Classification', | ||
| title: 'Classification', | ||
| headerTitleStyle: { color: ColorPalette.primary }, | ||
| }} | ||
| /> | ||
| <Drawer.Screen | ||
| name="image_segmentation/index" | ||
| options={{ | ||
| drawerLabel: 'Image Segmentation', | ||
| title: 'Image Segmentation', | ||
| headerTitleStyle: { color: ColorPalette.primary }, | ||
| }} | ||
| /> | ||
| <Drawer.Screen | ||
| name="object_detection/index" | ||
| options={{ | ||
| drawerLabel: 'Object Detection', | ||
| title: 'Object Detection', | ||
| headerTitleStyle: { color: ColorPalette.primary }, | ||
| }} | ||
| /> | ||
| <Drawer.Screen | ||
| name="ocr/index" | ||
| options={{ | ||
| drawerLabel: 'OCR', | ||
| title: 'OCR', | ||
| headerTitleStyle: { color: ColorPalette.primary }, | ||
| }} | ||
| /> | ||
| <Drawer.Screen | ||
| name="ocr_vertical/index" | ||
| options={{ | ||
| drawerLabel: 'OCR Vertical', | ||
| title: 'Vertical OCR', | ||
| headerTitleStyle: { color: ColorPalette.primary }, | ||
| }} | ||
| /> | ||
| <Drawer.Screen | ||
| name="style_transfer/index" | ||
| options={{ | ||
| drawerLabel: 'Style Transfer', | ||
| title: 'Style Transfer', | ||
| headerTitleStyle: { color: ColorPalette.primary }, | ||
| }} | ||
| /> | ||
| <Drawer.Screen | ||
| name="index" | ||
| options={{ | ||
| drawerLabel: () => null, | ||
| title: 'Main Menu', | ||
| drawerItemStyle: { display: 'none' }, | ||
| }} | ||
| /> | ||
| </Drawer> | ||
| </GeneratingContext> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| centerContent: { | ||
| flex: 1, | ||
| justifyContent: 'center', | ||
| alignItems: 'center', | ||
| padding: 20, | ||
| }, | ||
| mainText: { | ||
| fontSize: 18, | ||
| fontWeight: 'bold', | ||
| marginBottom: 10, | ||
| color: ColorPalette.primary, | ||
| }, | ||
| subText: { | ||
| fontSize: 14, | ||
| color: ColorPalette.strongPrimary, | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name of the screenWrapper file should start from large letter as it's a component