Skip to content

Conversation

@Ryan1202
Copy link
Contributor

This pull request refactors the OtherComponent and ProgressIndicator implementations, improving composability, performance, and code clarity. Key changes include dividing the single LazyItem in OtherComponent into multiple, optimizing animation logic in ProgressIndicator, and removing redundant code.

Refactoring OtherComponent:

  • Converted OtherComponent from a @Composable function to a LazyListScope extension, enabling dynamic item creation and better integration with LazyColumn.
  • Added FocusManager as a parameter to otherComponent, removing reliance on LocalFocusManager for better dependency injection. [1] [2]

Enhancements in ProgressIndicator:

  • Simplified LinearProgressIndicator logic by removing conditional checks for progressValue == 0f, reducing unnecessary calculations.
  • Refactored CircularProgressIndicator to use rememberInfiniteTransition for managing animations, replacing manual Animatable instances and improving readability.

Code Cleanup:

  • Removed unused imports and redundant variables in OtherComponent, streamlining the codebase. [1] [2]
  • Improved formatting for HEX color generation in ColorPicker, enhancing readability.

Ryan1202 added 4 commits May 30, 2025 15:35
This commit refactors the animation of the indeterminate `CircularProgressIndicator` components.

- For linear indeterminate progress indicators, the calculation of `progressWidth` is simplified.
- For circular indeterminate progress indicators, `rememberInfiniteTransition` and `animateFloat` are now used for smoother and more efficient animations of `rotationAnim` and `sweepAnim`. The `keyframes` animation spec is used for `sweepAnim` to create a more distinct visual effect.
- The drawing of end caps for both types of circular progress indicators is simplified by using `StrokeCap.Round`.
# Conflicts:
#	example/src/commonMain/kotlin/MainPage.kt
@YuKongA YuKongA merged commit 04adb66 into compose-miuix-ui:main May 30, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants