라이브 방 - 시그니처 이미지
- 로딩이 완료된 시점부터 이미지 표시 시간을 계산하여 최대한 오차가 없도록 조정
This commit is contained in:
parent
790e42035f
commit
b59172d608
|
@ -4,10 +4,10 @@
|
|||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2024-09-23T12:14:10.678819Z">
|
||||
<DropdownSelection timestamp="2024-09-30T12:57:26.128603Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=2cec640c34017ece" />
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/klaus/.android/avd/Pixel_8_Pro_API_34.avd" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.content.ClipboardManager
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
@ -31,6 +32,10 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.transform.CircleCropTransformation
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.DataSource
|
||||
import com.bumptech.glide.load.engine.GlideException
|
||||
import com.bumptech.glide.request.RequestListener
|
||||
import com.bumptech.glide.request.target.Target
|
||||
import com.github.dhaval2404.imagepicker.ImagePicker
|
||||
import com.google.gson.Gson
|
||||
import com.orhanobut.logger.Logger
|
||||
|
@ -1917,44 +1922,86 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
|
||||
private fun showSignatureImage() {
|
||||
if (signature != null) {
|
||||
if (viewModel.isSignatureOn.value!!) {
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signature!!.imageUrl)
|
||||
.into(binding.ivSignature)
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signature!!.imageUrl)
|
||||
.listener(object : RequestListener<Drawable> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
model: Any?,
|
||||
target: Target<Drawable>?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
}
|
||||
override fun onResourceReady(
|
||||
resource: Drawable?,
|
||||
model: Any?,
|
||||
target: Target<Drawable>?,
|
||||
dataSource: DataSource?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
if (viewModel.isSignatureOn.value!!) {
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
handler.postDelayed({
|
||||
if (signatureList.isNotEmpty()) {
|
||||
signature = signatureList.removeAt(0)
|
||||
} else {
|
||||
signature = null
|
||||
isShowSignatureImage = false
|
||||
binding.ivSignature.setImageDrawable(null)
|
||||
binding.ivSignature.visibility = View.GONE
|
||||
}
|
||||
}, signature!!.time * 1000L)
|
||||
handler.postDelayed({
|
||||
if (signatureList.isNotEmpty()) {
|
||||
signature = signatureList.removeAt(0)
|
||||
} else {
|
||||
signature = null
|
||||
isShowSignatureImage = false
|
||||
binding.ivSignature.setImageDrawable(null)
|
||||
binding.ivSignature.visibility = View.GONE
|
||||
}
|
||||
}, signature!!.time * 1000L)
|
||||
|
||||
return false
|
||||
}
|
||||
})
|
||||
.into(binding.ivSignature)
|
||||
} else if (signatureImageUrl.isNotBlank()) {
|
||||
if (viewModel.isSignatureOn.value!!) {
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signatureImageUrl)
|
||||
.into(binding.ivSignature)
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signatureImageUrl)
|
||||
.listener(object : RequestListener<Drawable> {
|
||||
override fun onLoadFailed(
|
||||
e: GlideException?,
|
||||
model: Any?,
|
||||
target: Target<Drawable>?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
}
|
||||
handler.postDelayed({
|
||||
if (signatureImageUrlList.isNotEmpty()) {
|
||||
signatureImageUrl = signatureImageUrlList.removeAt(0)
|
||||
} else {
|
||||
signatureImageUrl = ""
|
||||
isShowSignatureImage = false
|
||||
binding.ivSignature.setImageDrawable(null)
|
||||
binding.ivSignature.visibility = View.GONE
|
||||
}
|
||||
}, 7000)
|
||||
override fun onResourceReady(
|
||||
resource: Drawable?,
|
||||
model: Any?,
|
||||
target: Target<Drawable>?,
|
||||
dataSource: DataSource?,
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
if (viewModel.isSignatureOn.value!!) {
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
handler.postDelayed({
|
||||
if (signatureImageUrlList.isNotEmpty()) {
|
||||
signatureImageUrl = signatureImageUrlList.removeAt(0)
|
||||
} else {
|
||||
signatureImageUrl = ""
|
||||
isShowSignatureImage = false
|
||||
binding.ivSignature.setImageDrawable(null)
|
||||
binding.ivSignature.visibility = View.GONE
|
||||
}
|
||||
}, 7000)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
})
|
||||
.into(binding.ivSignature)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue