Skip to content

Commit

Permalink
feat: 修复初始化失败,预览页面黑屏的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wenchen committed Apr 27, 2023
1 parent abe67bd commit 57eebf1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import com.mustly.wellmedia.base.PageRoute
import com.mustly.wellmedia.databinding.FragmentCamera2TakePhotoBinding
import com.mustly.wellmedia.lib.annotation.Route
import com.mustly.wellmedia.lib.commonlib.log.LogUtil
import com.mustly.wellmedia.lib.commonlib.utils.OrientationLiveData
import com.mustly.wellmedia.lib.commonlib.utils.computeExifOrientation
import com.mustly.wellmedia.lib.commonlib.utils.setNoDoubleClickListener
import com.mustly.wellmedia.utils.*
import com.mustly.wellmedia.lib.commonlib.utils.*
import kotlinx.coroutines.CancellableContinuation
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand All @@ -34,7 +31,6 @@ import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.ArrayBlockingQueue
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine

/**
Expand Down Expand Up @@ -424,12 +420,14 @@ class Camera2TakePhotoFragment : BaseFragment<FragmentCamera2TakePhotoBinding>()
) == CameraCharacteristics.LENS_FACING_FRONT
val exifOrientation = computeExifOrientation(rotation, mirrored)

cont.resume(CaptureResultWrapper(
cont.resume(
CaptureResultWrapper(
image,
result,
exifOrientation,
imageReader?.imageFormat ?: ImageFormat.JPEG
))
)
)
}
}
}
Expand Down
1 change: 1 addition & 0 deletions commonlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ dependencies {
implementation 'com.google.android.material:material:1.6.0'
implementation "androidx.startup:startup-runtime:1.1.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
implementation 'androidx.exifinterface:exifinterface:1.3.2'
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mustly.wellmedia.utils
package com.mustly.wellmedia.lib.commonlib.utils

import android.annotation.SuppressLint
import android.graphics.ImageFormat
Expand All @@ -11,7 +11,6 @@ import android.util.Size
import android.view.Display
import android.view.Surface
import com.mustly.wellmedia.lib.commonlib.log.LogUtil
import kotlinx.coroutines.suspendCancellableCoroutine
import java.io.Closeable
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
Expand Down

0 comments on commit 57eebf1

Please sign in to comment.