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