mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-26 14:09:58 +00:00
Add randomized testing for ConversationItem.
This commit is contained in:
@@ -612,6 +612,13 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
|
||||
}
|
||||
|
||||
dividerPref()
|
||||
clickPref(
|
||||
title = DSLSettingsText.from("Launch ConversationTestFragment"),
|
||||
onClick = {
|
||||
findNavController().safeNavigate(InternalSettingsFragmentDirections.actionInternalSettingsFragmentToInternalConversationTestFragment())
|
||||
}
|
||||
)
|
||||
|
||||
switchPref(
|
||||
title = DSLSettingsText.from("Use V2 ConversationFragment"),
|
||||
isChecked = state.useConversationFragmentV2,
|
||||
|
||||
@@ -32,13 +32,18 @@ import org.whispersystems.signalservice.api.push.ServiceId
|
||||
private typealias ConversationElement = MappingModel<*>
|
||||
|
||||
sealed interface ConversationElementKey {
|
||||
|
||||
fun requireMessageId(): Long = error("Not implemented for this key")
|
||||
|
||||
companion object {
|
||||
fun forMessage(id: Long): ConversationElementKey = MessageBackedKey(id)
|
||||
val threadHeader: ConversationElementKey = ThreadHeaderKey
|
||||
}
|
||||
}
|
||||
|
||||
private data class MessageBackedKey(val id: Long) : ConversationElementKey
|
||||
private data class MessageBackedKey(val id: Long) : ConversationElementKey {
|
||||
override fun requireMessageId(): Long = id
|
||||
}
|
||||
private object ThreadHeaderKey : ConversationElementKey
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user