https://github.com/eranboudjnah/loaders
Jetpack Compose Loaders
https://github.com/eranboudjnah/loaders
android android-library android-loaders jetpack-compose kotlin kotlin-multiplatform kotlin-multiplatform-library
Last synced: 22 days ago
JSON representation
Jetpack Compose Loaders
- Host: GitHub
- URL: https://github.com/eranboudjnah/loaders
- Owner: EranBoudjnah
- License: mit
- Created: 2024-01-06T15:01:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-09T18:45:55.000Z (23 days ago)
- Last Synced: 2025-04-10T05:07:13.930Z (22 days ago)
- Topics: android, android-library, android-loaders, jetpack-compose, kotlin, kotlin-multiplatform, kotlin-multiplatform-library
- Language: Kotlin
- Homepage:
- Size: 2.85 MB
- Stars: 70
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Loaders
A collection of progress indicators/loaders for Jetpack Compose
[](https://github.com/EranBoudjnah/Loaders/actions/workflows/gradle-checks.yml)


Download
--------
Update the project build.gradle. You can include one or more of the loaders:```gradle
dependencies {
implementation 'com.mitteloupe.loaders:loaders-gears:0.4.0'
implementation 'com.mitteloupe.loaders:loaders-jigsaw:0.2.0'
}
```This project is hosted in mavenCentral().
### Usage
```kotlin
GearsLoader()
JigsawLoader()
```#### Other optional params:
##### Gears
```kotlin
@Composable
fun GearsLoader(
modifier: Modifier = Modifier,
gearConfiguration: GearConfiguration = GearsLoaderDefaults.gearConfiguration,
@FloatRange(from = 0.0, to = 1.0) toothRoundness: Float = GearsLoaderDefaults.TOOTH_ROUNDNESS,
holeRadius: Dp = GearsLoaderDefaults.holeRadius,
rotationTimeMilliseconds: Int = GearsLoaderDefaults.ROTATION_TIME_MILLISECONDS,
color: Color = GearsLoaderDefaults.color,
trackColor: Color = GearsLoaderDefaults.trackColor,
gearType: GearType = GearsLoaderDefaults.gearType,
progressState: ProgressState = ProgressState.Indeterminate,
transitionTimeMilliseconds: Int = DefaultDurationMillis,
rectangleFiller: RectangleFiller = RectangleFiller(GearMesher())
)
```##### Jigsaw
```kotlin
@Composable
fun JigsawLoader(
modifier: Modifier = Modifier,
progressState: ProgressState = Indeterminate(),
horizontalPieces: Int = JigsawLoaderDefaults.horizontalPieces,
verticalPieces: Int = JigsawLoaderDefaults.verticalPieces,
puzzleBrushProvider: BrushProvider =
ColorBrushProvider(JigsawLoaderDefaults.color),
lightBrush: Brush = SolidColor(Color.White.copy(alpha = .4f)),
darkBrush: Brush = SolidColor(Color.Black.copy(alpha = .6f)),
trackColor: Color = JigsawLoaderDefaults.trackColor,
piecePresenceResolver: PiecePresenceResolver = JigsawLoaderDefaults.piecePresenceResolver(
progressState = progressState,
horizontalPieces = horizontalPieces,
verticalPieces = verticalPieces
),
transitionTimeMilliseconds: Int = AnimationConstants.DefaultDurationMillis,
@FloatRange(from = 0.0, to = 1.0) trackSaturation: Float = 1f,
knobInversionEvaluator: (placeX: Int, placeY: Int) -> Boolean =
JigsawLoaderDefaults.knobInversionEvaluator,
knobConfiguration: KnobConfiguration = JigsawLoaderDefaults.knobConfiguration,
overflow: Boolean = false
)
```### Show some ❤ and support
If this project helped you, give it a ⭐️!
### Contributing
Contributions to this project are welcome. Please feel free to report any issues or fork to
make changes and raise a pull request.### License
This project is distributed under the terms of the MIT License. See [LICENSE](LICENSE) for
details.