Skip to content

Commit 0ef5c7f

Browse files
committed
Add some delay before taking screenshot
Displaying the image takes some time once the image is loaded by Glide.
1 parent ce69353 commit 0ef5c7f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/com/klee/sapio/ui/view/EvaluationsActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.klee.sapio.data.Rating
2828
import com.klee.sapio.databinding.ActivityEvaluationsBinding
2929
import com.klee.sapio.ui.viewmodel.AppEvaluationsViewModel
3030
import dagger.hilt.android.AndroidEntryPoint
31+
import kotlinx.coroutines.delay
3132
import kotlinx.coroutines.flow.MutableSharedFlow
3233
import kotlinx.coroutines.flow.combine
3334
import kotlinx.coroutines.flow.launchIn
@@ -53,6 +54,7 @@ class EvaluationsActivity : AppCompatActivity() {
5354
const val EXTRA_PACKAGE_NAME = "packageName"
5455
const val EXTRA_APP_NAME = "appName"
5556
const val EXTRA_SHARE_IMMEDIATELY = "shareImmediately"
57+
const val IMAGE_LOADING_DELAY_IN_MS = 200L
5658
}
5759

5860
@RequiresApi(Build.VERSION_CODES.O)
@@ -193,6 +195,7 @@ class EvaluationsActivity : AppCompatActivity() {
193195
isFirstResource: Boolean
194196
): Boolean {
195197
lifecycleScope.launch {
198+
delay(IMAGE_LOADING_DELAY_IN_MS)
196199
iconReceived.emit(true)
197200
}
198201
return false

0 commit comments

Comments
 (0)