-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Loading Animation] New app #4089
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
RKBoss6
wants to merge
9
commits into
espruino:master
Choose a base branch
from
RKBoss6:loadAnim
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.
+66
−0
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7d65d66
Add animation for expanding circle on boot
RKBoss6 141a561
Add README for Loading Animation app
RKBoss6 7fdeb17
Add metadata.json for loading animation app
RKBoss6 deca8ba
Add files via upload
RKBoss6 540ed04
Add initial ChangeLog for loadanim app
RKBoss6 7b81ac3
Fix syntax error in boot.js
RKBoss6 39ae158
Update apps/loadanim/boot.js
RKBoss6 e681ec6
Update apps/loadanim/README.md
RKBoss6 4e9a880
Update README.md
RKBoss6 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0.01: New test app |
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,19 @@ | ||
| # Loading Animation (beta) | ||
| This is a test to make the UI feel more responsive and fluid, by adding an animation when loading from the clock to a launcher. This app is still in beta, and is in regards to [this discussion](https://github.com/orgs/espruino/discussions/7871). | ||
|
|
||
| This modifies the boot code for `Bangle.load()` function, and first shows a 0.3 second animation of an expanding circle, transitioning smoothly between current and the next loaded app. This takes up minimal battery and processing power. | ||
|
|
||
| Give it a try, and tag `@RKBoss6` with any improvements or ideas! | ||
|
|
||
| You should see an animation: | ||
| * If you have a clock that supports fast-loading | ||
| * From a launcher that also supports fast-loading or calls Bangle.load | ||
|
|
||
| If you don't see an animation, try using a clock with fast loading, or install fastload utils and see if that works. | ||
|
|
||
| ## Known bugs | ||
| * Memory can run out slightly faster | ||
| * A hang will result in a blank screen until the user long-presses the button | ||
| ## Creator | ||
| RKBoss6 | ||
|
|
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,30 @@ | ||
| function animateExpandCircle(x, y, startR, endR, duration,color) { | ||
| var r=startR; | ||
| var fps=15 | ||
| var rChangeRate=(endR-startR)/(duration*fps) | ||
| var interval; | ||
| var time=0; | ||
| interval=setInterval(function(){ | ||
| time+=1/fps | ||
| r+=rChangeRate; | ||
| g.setColor(color); | ||
|
|
||
| g.fillEllipse(x-r,y-r,x+r,y+r) | ||
| if(Math.round(r)==Math.round(endR)||time>duration){ | ||
| clearInterval(interval) | ||
| } | ||
| },1000/fps) | ||
|
|
||
| } | ||
|
|
||
| Bangle.load=(function(name) { | ||
| if (Bangle.uiRemove) { | ||
| var animTime=0.3; //seconds | ||
| animateExpandCircle(g.getWidth()/2,g.getHeight()/2,0,150,animTime,g.theme.bg) | ||
| Bangle.setUI(); // remove all existing UI (and call Bangle.uiRemove) | ||
| __FILE__=name; | ||
| if (!name) name = ".bootcde"; | ||
| setTimeout(eval,animTime*1000,require("Storage").read(name)); // Load app without a reboot | ||
| } else load((name!=".bootcde")?name:undefined); | ||
| }); | ||
|
|
||
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,16 @@ | ||
| { | ||
| "id": "loadanim", | ||
| "name": "Loading Animation", | ||
| "shortName":"Load Anim", | ||
| "icon": "icon.png", | ||
| "version":"0.01", | ||
| "description": "Shows an animation to transition into the next loaded app (beta)", | ||
| "type":"bootloader", | ||
| "tags": "tool,system", | ||
| "author":"RKBoss6", | ||
| "supports": ["BANGLEJS2"], | ||
| "readme":"README.md", | ||
| "storage": [ | ||
| {"name":"loadanim.boot.js","url":"boot.js"} | ||
| ] | ||
| } |
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.