-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/progress indicator #43
base: main
Are you sure you want to change the base?
Conversation
|
||
return ( | ||
<View style={containerStyle} onLayout={handleLayout}> | ||
<Svg width="100%" height="100%" style={progressStyle}> |
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.
does this work on the mobile?
need to check
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.
DId you check?
… component completely to have different animation
…progressindicator
}, | ||
}; | ||
|
||
export const Circular: ComponentStory<typeof CircularExample> = args => ( |
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.
CircularExample has props
animatedValue
trackColor
- not required for circularvisible
- doesn't do anything
Also, What is the use for indeterminateMaxWidth in Circular indicator?
}, [animationScale, progress, progressAnim]); | ||
|
||
// if it's indeterminate state, we want to use ActivityIndicator instead | ||
if (indeterminate) |
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.
return fast.
If indeterminate.. the rest of the computations can be skipped.
import { default as CircularProgressIndicator } from './Circular'; | ||
|
||
export const ProgressIndicator = Object.assign( | ||
// @component ./Checkbox.tsx |
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.
Rename
new Array(frames), | ||
(_, frameIndex) => frameIndex / (frames - 1), | ||
); | ||
const outputRange = Array.from(new Array(frames), (_, frameIndex) => { |
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.
needs to be broken down into a separate function and be memoized.
You are creating this range over and over again.. every time the component is rendered. or for example color changes..
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.
same for input range
} | ||
|
||
// Animate progress bar | ||
if (indeterminate) { |
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.
could be broken down into a separate component
accessibilityValue: indeterminate ? {} : { min: 0, max: 100, now: progress * 100 }, | ||
containerStyle: container, | ||
animatedContainerStyle: [animatedContainer, { opacity: fade }, restStyle], | ||
progressBarStyle: [ |
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.
can be abstracted into a separate useMemo
No description provided.