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