Skip to content

Commit

Permalink
Add a TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
mahozad committed Nov 11, 2024
1 parent 51f687a commit 39a2cb8
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ir.mahozad.multiplatform.comshot
import android.app.Activity
import android.graphics.Bitmap
import android.graphics.Canvas
import android.os.Handler
import android.os.Looper
import android.view.View
import android.view.ViewGroup
Expand All @@ -11,6 +12,7 @@ import androidx.compose.runtime.*
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
Expand All @@ -35,9 +37,16 @@ fun captureToImage(
activity: Activity,
composable: @Composable () -> Unit
): ImageBitmap {


// TODO: Remove the below check and wrap the code in this block
// Handler(Looper.getMainLooper()).post {
// // Code that runs in main
// }
if (Looper.myLooper() != Looper.getMainLooper()) {
error("This function should be called from the main (UI) thread. See the function documentation.")
}

//////////////////////////////////////////////////
//////////////////////////////////////////////////
//////////////////////////////////////////////////
Expand Down

0 comments on commit 39a2cb8

Please sign in to comment.