mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-18 04:50:08 +03:00
Fix bubble min-width in forced timestamp case
Change-Id: I4d486fa2576e9728cda854c61d5e29b177cc3bcd
This commit is contained in:
parent
e81a7211b2
commit
4d2ad801da
1 changed files with 11 additions and 3 deletions
|
@ -211,11 +211,19 @@ abstract class AbsMessageItem<H : AbsMessageItem.Holder> : AbsBaseMessageItem<H>
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun getViewStubMinimumWidth(holder: H, contentInBubble: Boolean, showInformation: Boolean): Int {
|
open fun getViewStubMinimumWidth(holder: H, contentInBubble: Boolean, showInformation: Boolean): Int {
|
||||||
return if (contentInBubble && attributes.informationData.showInformation) {
|
return if (contentInBubble && (attributes.informationData.showInformation || attributes.informationData.forceShowTimestamp)) {
|
||||||
// Guess text width for name and time
|
// Guess text width for name and time
|
||||||
val text = holder.bubbleMemberNameView.text.toString() + " " + holder.bubbleTimeView.text.toString()
|
val text = if (attributes.informationData.showInformation) {
|
||||||
|
holder.bubbleMemberNameView.text.toString() + " " + holder.bubbleTimeView.text.toString()
|
||||||
|
} else {
|
||||||
|
holder.bubbleTimeView.text.toString()
|
||||||
|
}
|
||||||
val paint = Paint()
|
val paint = Paint()
|
||||||
paint.textSize = max(holder.bubbleMemberNameView.textSize, holder.bubbleTimeView.textSize)
|
paint.textSize = if (attributes.informationData.showInformation) {
|
||||||
|
max(holder.bubbleMemberNameView.textSize, holder.bubbleTimeView.textSize)
|
||||||
|
} else {
|
||||||
|
holder.bubbleTimeView.textSize
|
||||||
|
}
|
||||||
round(paint.measureText(text)).toInt()
|
round(paint.measureText(text)).toInt()
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
|
|
Loading…
Add table
Reference in a new issue