라이브 방 - 하트 후원 애니메이션
- 스피커/리스너 변경시 키보드를 숨기고 하트 후원 애니메이션 시작 위치 재계산
This commit is contained in:
parent
96a3ef44f6
commit
577e864b6a
|
@ -153,6 +153,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
|
||||
private var isShowSignatureImage = false
|
||||
private var isAvailableLikeHeart = false
|
||||
private var originalButtonPosition: IntArray? = null
|
||||
|
||||
private val countDownTimer = object : CountDownTimer(remainingNoChattingTime * 1000, 1000) {
|
||||
override fun onTick(millisUntilFinished: Long) {
|
||||
|
@ -531,19 +532,38 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
super.onDestroy()
|
||||
}
|
||||
|
||||
private fun setHeartButtonPosition() {
|
||||
handler.postDelayed(
|
||||
{
|
||||
// 버튼의 위치
|
||||
val button = if (isHost) {
|
||||
binding.flRouletteSettings
|
||||
} else {
|
||||
binding.flLikeHeart
|
||||
}
|
||||
originalButtonPosition = IntArray(2)
|
||||
button.getLocationInWindow(originalButtonPosition)
|
||||
},
|
||||
500
|
||||
)
|
||||
}
|
||||
|
||||
private fun secondToMillis(second: Float): Long {
|
||||
return (second * 1000).toLong()
|
||||
}
|
||||
|
||||
private fun addHeartAnimation() {
|
||||
// 버튼의 위치
|
||||
val button = if (isHost) {
|
||||
binding.flRouletteSettings
|
||||
} else {
|
||||
binding.flLikeHeart
|
||||
}
|
||||
val buttonPosition = IntArray(2)
|
||||
button.getLocationInWindow(buttonPosition)
|
||||
var buttonPosition = originalButtonPosition
|
||||
|
||||
if (buttonPosition == null) {
|
||||
buttonPosition = IntArray(2)
|
||||
button.getLocationInWindow(buttonPosition)
|
||||
}
|
||||
|
||||
// 하트 이미지뷰 생성
|
||||
val heart = ImageView(this).apply {
|
||||
|
@ -1349,6 +1369,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
binding.ivNotiMicrophoneMute.visibility = View.GONE
|
||||
speakerListAdapter.muteSpeakers.remove(SharedPreferenceManager.userId.toInt())
|
||||
}, 100)
|
||||
hideKeyboard { setHeartButtonPosition() }
|
||||
}
|
||||
|
||||
private fun setBroadcaster() {
|
||||
|
@ -1360,6 +1381,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
binding.flMicrophoneMute.visibility = View.VISIBLE
|
||||
binding.ivNotiMicrophoneMute.visibility = View.GONE
|
||||
}, 100)
|
||||
hideKeyboard { setHeartButtonPosition() }
|
||||
}
|
||||
|
||||
private fun changeListenerMessage(peerId: Long, isFromManager: Boolean = false) {
|
||||
|
|
Loading…
Reference in New Issue