Motion Progress Loader

Additional

Language
Kotlin
Version
1.0.1 (Dec 4, 2022)
Created
Dec 3, 2022
Updated
Dec 6, 2022 (Retired)
Owner
Ayush Shrivastava (ayushmaniac)
Contributors
Ayush Shrivastava (ayushmaniac)
Ayush Shrivastava (theandroidhashira)
2
Activity
Badge
Generate
Download
Source code

MotionProgessLoader

⚡ A powerful & easy to use Progress Dialog for Android ⚡

Gradle Setup

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
  implementation 'com.github.ayushmaniac:MotionProgessLoader:1.3'
  
  //For compose
  implementation 'com.github.ayushmaniac.MotionProgessLoader:motionloadercompose:1.0.1'

}

Implementation

  val motionProgressLoaderView = MotionProgressLoaderView.Builder(this)
            .setStayInLoop(true)
            .build()
    }
    
    // Addition of Custom Lottie
  val motionProgressLoaderView = MotionProgressLoaderView.Builder(requireContext())
            .setLottieAsset(drawableInt) // R.raw.lottieFiles
            .build()
    }
    
    
    //Compose Variant:
    
    @Composable
    fun HomeScreen() {
    val showDialog = remember { mutableStateOf(false) }
    Column(
        modifier = Modifier
            .fillMaxWidth()
            .fillMaxHeight(),
        verticalArrangement = Arrangement.Center,
        horizontalAlignment = Alignment.CenterHorizontally
    ) {
        Button(
            onClick = {
                showDialog.value = !showDialog.value
            }
        )
        {
            Text(text = "Start Motion Loader")
            if (showDialog.value) {
                //customLottieAsset can be null in that case, a default loader will be rendered.
                MotionProgressLoader(customLottieAsset = R.raw.lol, false)
            }
        }
    }

}