|
@@ -1,5 +1,7 @@
|
|
|
package com.fastest.pass.di
|
|
|
|
|
|
+import androidx.compose.foundation.layout.Box
|
|
|
+import androidx.compose.foundation.layout.fillMaxSize
|
|
|
import androidx.compose.foundation.layout.size
|
|
|
import androidx.compose.material3.CircularProgressIndicator
|
|
|
import androidx.compose.runtime.Composable
|
|
@@ -8,6 +10,7 @@ import androidx.compose.runtime.getValue
|
|
|
import androidx.compose.runtime.mutableFloatStateOf
|
|
|
import androidx.compose.runtime.remember
|
|
|
import androidx.compose.runtime.setValue
|
|
|
+import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.res.colorResource
|
|
|
import androidx.compose.ui.unit.dp
|
|
@@ -17,6 +20,7 @@ import kotlinx.coroutines.delay
|
|
|
@Composable
|
|
|
fun GenericLoader(loader: Boolean) {
|
|
|
if (loader) {
|
|
|
+
|
|
|
var progress by remember { mutableFloatStateOf(0.1F) }
|
|
|
|
|
|
LaunchedEffect(key1 = Unit) {
|
|
@@ -29,12 +33,18 @@ fun GenericLoader(loader: Boolean) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- CircularProgressIndicator(
|
|
|
- progress = { progress },
|
|
|
- modifier = Modifier
|
|
|
- .size(50.dp),
|
|
|
- color = colorResource(id = R.color.yellow_text),
|
|
|
- strokeWidth = 5.dp,
|
|
|
- )
|
|
|
+ Box(modifier = Modifier.fillMaxSize(),
|
|
|
+ contentAlignment = Alignment.Center){
|
|
|
+ CircularProgressIndicator(
|
|
|
+ progress = { progress },
|
|
|
+ modifier = Modifier
|
|
|
+ .size(50.dp)
|
|
|
+ .align(Alignment.Center),
|
|
|
+ color = colorResource(id = R.color.yellow_text),
|
|
|
+ strokeWidth = 5.dp,
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|