kopia lustrzana https://github.com/ryukoposting/Signal-Android
Improve chat list multiselect animation performance.
rodzic
7cac62f3f2
commit
947f59e81b
|
@ -5,6 +5,7 @@ import android.text.TextUtils
|
|||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.util.ThrottledDebouncer
|
||||
import org.whispersystems.libsignal.util.guava.Optional
|
||||
|
||||
open class SimpleEmojiTextView @JvmOverloads constructor(
|
||||
|
@ -14,6 +15,7 @@ open class SimpleEmojiTextView @JvmOverloads constructor(
|
|||
) : AppCompatTextView(context, attrs, defStyleAttr) {
|
||||
|
||||
private var bufferType: BufferType? = null
|
||||
private val sizeChangeDebouncer: ThrottledDebouncer = ThrottledDebouncer(200)
|
||||
|
||||
override fun setText(text: CharSequence?, type: BufferType?) {
|
||||
bufferType = type
|
||||
|
@ -44,8 +46,10 @@ open class SimpleEmojiTextView @JvmOverloads constructor(
|
|||
|
||||
override fun onSizeChanged(width: Int, height: Int, oldWidth: Int, oldHeight: Int) {
|
||||
super.onSizeChanged(width, height, oldWidth, oldHeight)
|
||||
if (width > 0 && oldWidth != width) {
|
||||
setText(text, bufferType ?: BufferType.SPANNABLE)
|
||||
sizeChangeDebouncer.publish {
|
||||
if (width > 0 && oldWidth != width) {
|
||||
setText(text, bufferType ?: BufferType.SPANNABLE)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
android:fontFamily="sans-serif-medium"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/signal_text_primary"
|
||||
app:layout_constraintEnd_toStartOf="@id/conversation_list_item_name_barrier"
|
||||
app:layout_constraintEnd_toStartOf="@id/conversation_list_item_date"
|
||||
app:layout_constraintStart_toEndOf="@id/conversation_list_item_avatar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
|
@ -96,7 +96,7 @@
|
|||
android:lines="2"
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/signal_text_secondary"
|
||||
app:layout_constraintEnd_toStartOf="@id/conversation_list_item_summary_barrier"
|
||||
app:layout_constraintEnd_toStartOf="@id/conversation_list_item_status_container"
|
||||
app:layout_constraintStart_toEndOf="@id/conversation_list_item_alert"
|
||||
app:layout_constraintTop_toBottomOf="@id/conversation_list_item_name"
|
||||
tools:text="I'll send those photos over to the Bugle ASAP." />
|
||||
|
@ -174,22 +174,6 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/conversation_list_item_summary_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:barrierAllowsGoneWidgets="false"
|
||||
app:barrierDirection="start"
|
||||
app:constraint_referenced_ids="conversation_list_item_status_container" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/conversation_list_item_name_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:barrierAllowsGoneWidgets="false"
|
||||
app:barrierDirection="start"
|
||||
app:constraint_referenced_ids="conversation_list_item_date" />
|
||||
|
||||
<org.thoughtcrime.securesms.badges.BadgeImageView
|
||||
android:id="@+id/conversation_list_item_badge"
|
||||
android:layout_width="24dp"
|
||||
|
|
Ładowanie…
Reference in New Issue