mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Do not ellipsize content while expanding.
This commit is contained in:
parent
c3a423fdbe
commit
beeb840436
@ -17,6 +17,7 @@
|
|||||||
package im.vector.app.core.epoxy
|
package im.vector.app.core.epoxy
|
||||||
|
|
||||||
import android.animation.ObjectAnimator
|
import android.animation.ObjectAnimator
|
||||||
|
import android.text.TextUtils
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.core.view.doOnPreDraw
|
import androidx.core.view.doOnPreDraw
|
||||||
@ -63,18 +64,20 @@ abstract class ExpandableTextItem : VectorEpoxyModel<ExpandableTextItem.Holder>(
|
|||||||
|
|
||||||
private fun expand(holder: Holder) {
|
private fun expand(holder: Holder) {
|
||||||
ObjectAnimator.ofInt(holder.content, "maxLines", expandedLines)
|
ObjectAnimator.ofInt(holder.content, "maxLines", expandedLines)
|
||||||
.apply { duration = 500 }
|
.apply { duration = 200 }
|
||||||
.also { it.start() }
|
.also { it.start() }
|
||||||
|
|
||||||
|
holder.content.ellipsize = null
|
||||||
holder.arrow.setImageResource(R.drawable.ic_expand_less)
|
holder.arrow.setImageResource(R.drawable.ic_expand_less)
|
||||||
isExpanded = true
|
isExpanded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun collapse(holder: Holder) {
|
private fun collapse(holder: Holder) {
|
||||||
ObjectAnimator.ofInt(holder.content, "maxLines", maxLines)
|
ObjectAnimator.ofInt(holder.content, "maxLines", maxLines)
|
||||||
.apply { duration = 500 }
|
.apply { duration = 200 }
|
||||||
.also { it.start() }
|
.also { it.start() }
|
||||||
|
|
||||||
|
holder.content.ellipsize = TextUtils.TruncateAt.END
|
||||||
holder.arrow.setImageResource(R.drawable.ic_expand_more)
|
holder.arrow.setImageResource(R.drawable.ic_expand_more)
|
||||||
isExpanded = false
|
isExpanded = false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user