|
|
|
@ -59,6 +59,7 @@ class VisibleMessageView : LinearLayout {
|
|
|
|
|
const val longPressMovementTreshold = 10.0f // dp
|
|
|
|
|
const val longPressDurationThreshold = 250L // ms
|
|
|
|
|
const val maxDoubleTapInterval = 200L
|
|
|
|
|
const val maxTimeBetweenBreaks = 5 * 60 * 1000L // 5 minutes
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// region Lifecycle
|
|
|
|
@ -111,7 +112,7 @@ class VisibleMessageView : LinearLayout {
|
|
|
|
|
senderNameTextView.visibility = View.GONE
|
|
|
|
|
}
|
|
|
|
|
// Date break
|
|
|
|
|
val showDateBreak = (previous == null || !DateUtils.isSameHour(message.timestamp, previous.timestamp))
|
|
|
|
|
val showDateBreak = (previous == null || message.timestamp - previous.timestamp > maxTimeBetweenBreaks)
|
|
|
|
|
dateBreakTextView.isVisible = showDateBreak
|
|
|
|
|
dateBreakTextView.text = if (showDateBreak) DateUtils.getDisplayFormattedTimeSpanString(context, Locale.getDefault(), message.timestamp) else ""
|
|
|
|
|
// Timestamp
|
|
|
|
|