Ensure text-only entries are cached.

This commit is contained in:
Alex Hart
2023-07-05 09:26:23 -03:00
committed by Greyson Parrelli
parent 4590655dc5
commit 4ef2aba4e2
4 changed files with 12 additions and 10 deletions

View File

@@ -67,7 +67,7 @@ class ConversationElementGenerator {
val messageId = key.requireMessageId()
val now = getNow()
val testMessageWordLength = random.nextInt(40) + 1
val testMessageWordLength = random.nextInt(3) + 1
val testMessage = (0 until testMessageWordLength).map {
wordBank.random()
}.joinToString(" ")
@@ -86,7 +86,7 @@ class ConversationElementGenerator {
1,
testMessage,
SlideDeck(),
if (isIncoming) getIncomingType() else getSentFailedOutgoingType(),
if (isIncoming) getIncomingType() else getSentOutgoingType(),
emptySet(),
emptySet(),
0,

View File

@@ -273,8 +273,8 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
FrameLayout parent = new FrameLayout(context);
parent.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_received_text_only, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_sent_text_only, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_incoming, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_outgoing, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_received_multimedia, parent, 10);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_sent_multimedia, parent, 10);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_update, parent, 5);

View File

@@ -155,6 +155,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-4dp"
android:layout_marginEnd="5dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="@id/conversation_item_body_wrapper"
app:layout_constraintTop_toBottomOf="@id/conversation_item_body_wrapper"

View File

@@ -120,8 +120,8 @@
android:id="@+id/conversation_item_expiration_timer"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
android:layout_marginEnd="4dp"
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
app:layout_constraintBottom_toBottomOf="@id/conversation_item_body_wrapper"
app:layout_constraintEnd_toStartOf="@id/conversation_item_delivery_status" />
@@ -136,10 +136,10 @@
<Space
android:id="@+id/footer_end_pad"
app:layout_constraintBottom_toBottomOf="@id/conversation_item_body_wrapper"
app:layout_constraintEnd_toEndOf="@id/conversation_item_body_wrapper"
android:layout_width="@dimen/message_bubble_horizontal_padding"
android:layout_height="@dimen/message_bubble_horizontal_padding" />
android:layout_height="@dimen/message_bubble_horizontal_padding"
app:layout_constraintBottom_toBottomOf="@id/conversation_item_body_wrapper"
app:layout_constraintEnd_toEndOf="@id/conversation_item_body_wrapper" />
<!-- End Footer -->
@@ -150,9 +150,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-4dp"
android:layout_marginStart="5dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="@id/conversation_item_body_wrapper"
app:layout_constraintStart_toStartOf="@id/conversation_item_body_wrapper"
app:layout_constraintTop_toBottomOf="@id/conversation_item_body_wrapper"
app:rcv_outgoing="false" />
app:rcv_outgoing="true" />
</org.thoughtcrime.securesms.conversation.v2.items.V2ConversationItemLayout>