mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
Added a 1 second kludge to the mute for subtitle so that it initially shows 1 hour not 59 minutes etc.
This commit is contained in:
parent
d568a86649
commit
d3177f9f1a
@ -11,6 +11,7 @@ import org.session.libsignal.utilities.Log
|
|||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.time.Duration.Companion.milliseconds
|
import kotlin.time.Duration.Companion.milliseconds
|
||||||
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
fun showMuteDialog(
|
fun showMuteDialog(
|
||||||
context: Context,
|
context: Context,
|
||||||
@ -31,7 +32,12 @@ fun showMuteDialog(
|
|||||||
}.toTypedArray()) {
|
}.toTypedArray()) {
|
||||||
// Note: We add the current timestamp to the mute duration to get the un-mute timestamp
|
// Note: We add the current timestamp to the mute duration to get the un-mute timestamp
|
||||||
// that gets stored in the database via ConversationMenuHelper.mute().
|
// that gets stored in the database via ConversationMenuHelper.mute().
|
||||||
onMuteDuration(Option.entries[it].getTime() + System.currentTimeMillis())
|
// Also: This is a kludge, but we ADD one second to the mute duration because otherwise by
|
||||||
|
// the time the view for how long the conversation is muted for gets set then it's actually
|
||||||
|
// less than the entire duration - so 1 hour becomes 59 minutes, 1 day becomes 23 hours etc.
|
||||||
|
// As we really want to see the actual set time (1 hour / 1 day etc.) then we'll bump it by
|
||||||
|
// 1 second which is neither here nor there in the grand scheme of things.
|
||||||
|
onMuteDuration(Option.entries[it].getTime() + System.currentTimeMillis() + 1.seconds.inWholeMilliseconds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user