mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-23 00:17:34 +00:00
Fix disappearing off icon
This commit is contained in:
parent
a312ef2b25
commit
806cb216ae
@ -31,6 +31,11 @@ class ExpirationTimerView @JvmOverloads constructor(
|
|||||||
)
|
)
|
||||||
|
|
||||||
fun setExpirationTime(startedAt: Long, expiresIn: Long) {
|
fun setExpirationTime(startedAt: Long, expiresIn: Long) {
|
||||||
|
if (expiresIn == 0L) {
|
||||||
|
setImageResource(R.drawable.timer55)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val elapsedTime = nowWithOffset - startedAt
|
val elapsedTime = nowWithOffset - startedAt
|
||||||
val remainingTime = expiresIn - elapsedTime
|
val remainingTime = expiresIn - elapsedTime
|
||||||
val remainingPercent = (remainingTime / expiresIn.toFloat()).coerceIn(0f, 1f)
|
val remainingPercent = (remainingTime / expiresIn.toFloat()).coerceIn(0f, 1f)
|
||||||
|
@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.conversation.v2.messages
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
@ -11,8 +10,6 @@ import androidx.core.view.isVisible
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import network.loki.messenger.databinding.ViewControlMessageBinding
|
import network.loki.messenger.databinding.ViewControlMessageBinding
|
||||||
import org.session.libsession.utilities.getColorFromAttr
|
|
||||||
import org.thoughtcrime.securesms.conversation.v2.components.ExpirationTimerView
|
|
||||||
import org.thoughtcrime.securesms.database.model.MessageRecord
|
import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||||
|
|
||||||
class ControlMessageView : LinearLayout {
|
class ControlMessageView : LinearLayout {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user