Commit 1b6a5181 by Aleksandr

Display render preview progress

parent 1b5c244f
......@@ -6,6 +6,7 @@ import androidx.activity.compose.BackHandler
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
......@@ -15,6 +16,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.State
......@@ -23,14 +25,20 @@ import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.LottieConstants
import com.airbnb.lottie.compose.rememberLottieComposition
import com.isidroid.c23.R
import com.isidroid.c23.ui._component.TopAppBarComponent
import com.isidroid.c23.ui.screen.render_preview._component.PagerPreviewComponent
......@@ -81,7 +89,35 @@ fun RenderPreviewScreen(
onEventSent(RenderContract.Event.ToBack)
}
if (state.value.rendering) return
if (state.value.rendering) {
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.convert))
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Column {
LottieAnimation(
composition = composition,
iterations = LottieConstants.IterateForever,
modifier = modifier
.fillMaxWidth()
.padding(48.dp)
)
Text(
text = "Please wait until convert is completed",
style = MaterialTheme.typography.labelLarge,
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.Center
)
}
}
return
}
when {
spotHasNoPrintProfiles -> {
......
package com.isidroid.location.repository
import android.content.Context
import androidx.compose.ui.text.intl.Locale
import com.isidroid.location.ext.calculateDistanceBetweenPoints
class LocationRepositoryImpl(context: Context) : LocationRepository {
override fun getCurrentLocation(): Pair<Double, Double> {
TODO("Not yet implemented")
}
override fun findDistance(myLat: Double, myLng: Double, locationLat: Double?, locationLng: Double?): Float? {
if (locationLat == null || locationLng == null) return null
return calculateDistanceBetweenPoints(Locale.current, myLat, myLng, locationLat, locationLng).toFloat()
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment