-
Notifications
You must be signed in to change notification settings - Fork 66
feat: LVGL 8.4 upgrade, focus navigation, component API refactors, navigation/gateway demos, fix memory leak, and i18n #54
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
Open
sunnyswag
wants to merge
62
commits into
lvgl:master
Choose a base branch
from
sunnyswag:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
60fc3fa
chore: update .gitignore to include compile_commands.json for clangd
sunnyswag 69f2ddb
fix: update image paths in test components to use correct directory s…
sunnyswag b4817d7
chore: update txiki subproject to latest commit to support fetch blob
sunnyswag 36cffee
refactor: replace getBinary functions with fetchBinary utility for GI…
sunnyswag 1b8da28
Update .gitignore
sunnyswag ec284e1
fix: enhance fetchBinary function to handle HTTP errors and improve e…
sunnyswag e07f1be
build: add support for building static library and refactor main entr…
78c3560
build: add display resolution configuration to CMake and update devic…
a92a974
build: enhance CMake configuration with LVGLJS_CONF_DIR and display r…
04a6d88
feat: implement LVGL Group focus navigation support
053617d
refactor: extract init_input_devices for indev init
1b17f0c
demo: add flex ViewPager demo (ts)
sunnyswag 41ed000
feat: add arc test code
90e252a
feat: enhance group management in React components
5a940ea
feat: add navigation demo with multiple pages and auto-focus function…
ae96c38
feat: update component registration to support refs
8532641
feat: enhance ViewPager component with debugging features and style u…
18af2f3
feat: update React dependencies and enhance reconciler functionality
559ebbb
feat: implement internationalization support in navigation demo
e37d270
fix: update i18n message handling and improve localization performance
sunnyswag 6824574
feat: upgrade React and related dependencies, enhance component final…
dfd947a
feat: enhance navigation demo with React Router integration
e174731
refactor: remove useAutoFocus hook and enhance focus management in co…
b04cef2
refactor: remove GroupManager and streamline focus handling in compon…
4ec2817
refactor: simplify Header component by removing onBack prop and using…
sunnyswag 05842af
refactor: remove LV_OBJ_FLAG_SCROLL_ON_FOCUS from multiple components…
f87334d
chore(deps): upgrade lvgl from v8.3.0-dev to v8.4.0
0905a98
feat: add addToFocusGroup prop to View component in ViewPager for imp…
416d8fa
refactor: update ViewPager styles and enhance scrollbar behavior
1390ac7
fix: compile warnings
189655c
feat: enhance child insertion logic in BasicComponent
cb5499a
refactor: simplify Window component by removing unused code
1b333c4
feat: implement new Page2Info component with enhanced navigation and …
60caf8a
style: add overflow hidden to navigation container for improved layou…
dd1992b
refactor: replace CommonComponentApi with setComponentProps in multip…
46fa7f9
chore(deps): update lvgl subproject to commit 74d0a81
7e19d37
refactor: style.cpp remove duplicate code
ef0daf4
refactor: rename style-transition-time to transition-time for consist…
c4a2f8f
refactor: simplify align logic in common component setters
2ac6b2d
fix: ts warnings
bc46d94
refactor: update setProps method to use UpdatePayload for Button, Tex…
sunnyswag dbf10bc
refactor: update setProps method to use UpdatePayload across multiple…
sunnyswag 127a9ad
refactor: update setProps method to use type assertions for component…
sunnyswag b646680
feat: add gateway demo
f5e93d5
feat: enhance gateway demo with new icons and header updates
cbcbc35
refactor: streamline layout in DeviceStatusPage component
c0af941
feat: enhance device information display in gateway demo
49d0f83
feat: add Japanese language support and enhance localization in gatew…
5f7d864
fix: correct countdown angle calculation and update styles in Countdo…
b30d5eb
refactor: remove background-opacity property and update color styles …
65dd476
refactor: adjust layout and styling in HomePage component
60da914
refactor: replace Record<string, any> with CreateStyle for consistent…
10ece33
refactor: simplify color list animation logic in App component
23fd241
refactor: update padding and border-radius styles across multiple com…
7e3f477
refactor: enhance Header component with navigation functionality and …
76f75ac
fix: reorder the select items
b2ca22c
feat: add pagination navigation to LogDetailPage and update localizat…
40390ee
feat: integrate focus group functionality and enhance LogDetailPage p…
b4cb0ce
refactor: simplify LogDetailPage structure and enhance focus navigation
5d81355
refactor: rename checkIndex to loopIndex and simplify navigation logi…
5022770
update .gitignore
d34d458
chore: translate Chinese comments to English
sunnyswag 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 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 |
|---|---|---|
| @@ -1,22 +1,27 @@ | ||
| BUILD_SIM=build | ||
| BUILD_LIB=build_lib | ||
|
|
||
| .PHONY: setup simulator demo clean | ||
| .PHONY: setup simulator lib demo clean | ||
|
|
||
| setup: | ||
| git submodule update --recursive --init | ||
| npm install | ||
|
|
||
| simulator: | ||
| @mkdir -p $(BUILD_SIM) | ||
| cmake -B "$(BUILD_SIM)" -DCMAKE_BUILD_TYPE=Simulator | ||
| cmake -B "$(BUILD_SIM)" -DCMAKE_BUILD_TYPE=Simulator -DBUILD_STATIC_LIB=OFF | ||
| cmake --build $(BUILD_SIM) -j | ||
|
|
||
| # Set default project argument to 'widgets' if no project is provided | ||
| lib: | ||
| @mkdir -p $(BUILD_LIB) | ||
| cmake -B "$(BUILD_LIB)" -DCMAKE_BUILD_TYPE=Simulator -DBUILD_STATIC_LIB=ON | ||
| cmake --build $(BUILD_LIB) -j | ||
|
|
||
| demo: simulator | ||
| @PROJECT=$${PROJECT:-widgets}; \ | ||
| echo "Running demo with project: $$PROJECT"; \ | ||
| node build.js && \ | ||
| ./${BUILD_SIM}/lvgljs run demo/$$PROJECT/index.js | ||
|
|
||
| clean: | ||
| rm -rf $(BUILD_SIM) | ||
| rm -rf $(BUILD_SIM) $(BUILD_LIB) |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,99 @@ | ||
| import React from "react"; | ||
| import { Button, Text, View, Dimensions, CreateStyle } from "lvgljs-ui"; | ||
|
|
||
| const { width, height } = Dimensions.window; | ||
|
|
||
| interface ConfirmDialogProps { | ||
| title: string; | ||
| onConfirm: () => void; | ||
| onCancel: () => void; | ||
| confirmText?: string; | ||
| cancelText?: string; | ||
| } | ||
|
|
||
| export function ConfirmDialog({ | ||
| title, | ||
| onConfirm, | ||
| onCancel, | ||
| confirmText = "Confirm", | ||
| cancelText = "Cancel", | ||
| }: ConfirmDialogProps) { | ||
| return ( | ||
| <View style={style.overlay} onCancel={onCancel}> | ||
| <View style={style.dialog}> | ||
| <Text style={style.title}>{title}</Text> | ||
| <View style={style.buttons}> | ||
| <Button | ||
| autoFocus | ||
| style={style.button} | ||
| onFocusedStyle={style.buttonFocused} | ||
| onClick={onCancel} | ||
| addToFocusGroup | ||
| > | ||
| <Text style={style.buttonText}>✕</Text> | ||
|
sunnyswag marked this conversation as resolved.
|
||
| </Button> | ||
| <Button | ||
| style={style.button} | ||
| onFocusedStyle={style.buttonFocused} | ||
| onClick={onConfirm} | ||
| addToFocusGroup | ||
| > | ||
| <Text style={style.buttonText}>✓</Text> | ||
| </Button> | ||
| </View> | ||
| </View> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const style = CreateStyle({ | ||
| overlay: { | ||
| position: "absolute", | ||
| width, | ||
| height, | ||
| "background-color": "rgba(0, 0, 0, 0.7)", | ||
| display: "flex", | ||
| "align-items": "center", | ||
| "justify-content": "center", | ||
| zIndex: 1000, | ||
| }, | ||
| dialog: { | ||
| width: width - 80, | ||
| "background-color": "black", | ||
| "border-radius": 12, | ||
| padding: 24, | ||
| display: "flex", | ||
| "flex-direction": "column", | ||
| "align-items": "center", | ||
| }, | ||
| title: { | ||
| "text-color": "white", | ||
| "font-size": 16, | ||
| "text-align": "center", | ||
| "margin-bottom": 24, | ||
| }, | ||
| buttons: { | ||
| display: "flex", | ||
| "flex-direction": "row", | ||
| "justify-content": "space-between", | ||
| width: "100%", | ||
| gap: 16, | ||
| }, | ||
| button: { | ||
| flex: 1, | ||
| height: 44, | ||
| "border-radius": 8, | ||
| "background-color": "0x404040", | ||
| display: "flex", | ||
| "align-items": "center", | ||
| "justify-content": "center", | ||
| }, | ||
| buttonText: { | ||
| "text-color": "white", | ||
| "font-size": 18, | ||
| }, | ||
| buttonFocused: { | ||
| "border-width": 3, | ||
| "border-color": "#4660FF", | ||
| }, | ||
| }); | ||
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,41 @@ | ||
| import React from "react"; | ||
| import { CreateStyle, Image, Text, View } from "lvgljs-ui"; | ||
| import { useNavigate } from "react-router"; | ||
|
|
||
| interface HeaderProps { | ||
| title: string; | ||
| backIcon?: string; | ||
| } | ||
|
|
||
| export function Header({ title, backIcon }: HeaderProps) { | ||
| const navigate = useNavigate(); | ||
| return ( | ||
| <View style={style.header}> | ||
| <Image src="left" style={style.headerIcon} onClick={() => navigate(-1)} /> | ||
| {backIcon && <Image src={backIcon} style={style.headerIcon} />} | ||
| <Text style={style.headerTitle}>{title}</Text> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const style = CreateStyle({ | ||
| header: { | ||
| width: "100%", | ||
| height: 52, | ||
| display: "flex", | ||
| "flex-direction": "row", | ||
| "align-items": "center", | ||
| "background-color": "0x202020", | ||
| padding: "0 16px", | ||
| }, | ||
| headerIcon: { | ||
| width: 'auto', | ||
| height: 'auto', | ||
| "text-color": "white", | ||
| "font-size": 18, | ||
| }, | ||
| headerTitle: { | ||
| "text-color": "white", | ||
| "font-size": 16, | ||
| }, | ||
| }); |
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,94 @@ | ||
| import React from "react"; | ||
| import { CreateStyle, Image, Text, useT, View } from "lvgljs-ui"; | ||
|
|
||
| interface ListItemProps { | ||
| title: string; | ||
| badge?: string; | ||
| badgeColor?: string; | ||
| showArrow?: boolean; | ||
| onClick?: () => void; | ||
| autoFocus?: boolean; | ||
| } | ||
|
|
||
| export function ListItem({ | ||
| title, | ||
| badge, | ||
| badgeColor = "0xFF0000", | ||
| showArrow = true, | ||
| onClick, | ||
| autoFocus = false, | ||
| }: ListItemProps) { | ||
| const t = useT(); | ||
| return ( | ||
| <View | ||
| autoFocus={autoFocus} | ||
| addToFocusGroup | ||
| onFocusedStyle={style.focused} | ||
| style={style.listItem} | ||
| onClick={onClick} | ||
| > | ||
| <View style={style.content}> | ||
| <Text style={style.title}>{t(title)}</Text> | ||
| {badge && ( | ||
| <View style={[style.badge, { "background-color": badgeColor }]}> | ||
| <Text style={style.badgeText}>{badge}</Text> | ||
| </View> | ||
| )} | ||
| </View> | ||
| {showArrow && ( | ||
| <Image src={"right"} style={style.arrow} /> | ||
| )} | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const style = CreateStyle({ | ||
| listItem: { | ||
| width: "100%", | ||
| height: 60, | ||
| "background-color": "0x2a2a2a", | ||
| margin: "0 0 8px 0", | ||
| padding: "0 12px", | ||
| display: "flex", | ||
| "flex-direction": "row", | ||
| "align-items": "center", | ||
| "justify-content": "space-between", | ||
| "scroll-on-focus": 1, | ||
| }, | ||
| content: { | ||
| display: "flex", | ||
| width: 'auto', | ||
| height: 'auto', | ||
| "flex-direction": "row", | ||
| "align-items": "center", | ||
| "flex": 1, | ||
| }, | ||
| title: { | ||
| "text-color": "white", | ||
| "font-size": 16, | ||
| }, | ||
| badge: { | ||
| "border-radius": 12, | ||
| padding: "2px 8px", | ||
| margin: "0 0 0 12px", | ||
| display: "flex", | ||
| "align-items": "center", | ||
| "justify-content": "center", | ||
| "min-width": 24, | ||
| height: 20, | ||
| }, | ||
| badgeText: { | ||
| "text-color": "white", | ||
| "font-size": 12, | ||
| }, | ||
| arrow: { | ||
| "text-color": "white", | ||
| "font-size": 18, | ||
| margin: "0 0 0 12px", | ||
| }, | ||
| focused: { | ||
| padding: "0 12px", | ||
| "border-radius": 12, | ||
| "background-color": "#4660FF", | ||
| }, | ||
| }); |
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.
Uh oh!
There was an error while loading. Please reload this page.