kopia lustrzana https://github.com/ryukoposting/Signal-Android
Localization tweaks for stories and gift badges.
rodzic
bcd2763c34
commit
d49c8d5184
|
@ -8,6 +8,8 @@ import org.junit.runner.RunWith
|
|||
import org.thoughtcrime.securesms.contacts.paged.ContactSearchKey
|
||||
import org.thoughtcrime.securesms.database.IdentityDatabase
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.model.DistributionListId
|
||||
import org.thoughtcrime.securesms.database.model.DistributionListPrivacyMode
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.profiles.ProfileName
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
|
@ -42,25 +44,30 @@ class SafetyNumberChangeDialogPreviewer {
|
|||
|
||||
@Test
|
||||
fun testShowLargeSheet() {
|
||||
SignalDatabase.distributionLists.setPrivacyMode(DistributionListId.MY_STORY, DistributionListPrivacyMode.ONLY_WITH)
|
||||
|
||||
val othersRecipients = harness.others.map { Recipient.resolved(it) }
|
||||
othersRecipients.forEach { other ->
|
||||
SignalDatabase.recipients.setProfileName(other.id, ProfileName.fromParts("My", "Name"))
|
||||
|
||||
harness.setVerified(other, IdentityDatabase.VerifiedStatus.DEFAULT)
|
||||
harness.changeIdentityKey(other)
|
||||
|
||||
SignalDatabase.distributionLists.addMemberToList(DistributionListId.MY_STORY, DistributionListPrivacyMode.ONLY_WITH, other.id)
|
||||
}
|
||||
|
||||
val myStoryRecipientId = SignalDatabase.distributionLists.getRecipientId(DistributionListId.MY_STORY)!!
|
||||
val scenario: ActivityScenario<ConversationActivity> = harness.launchActivity { putExtra("recipient_id", harness.others.first().serialize()) }
|
||||
scenario.onActivity { conversationActivity ->
|
||||
SafetyNumberBottomSheet
|
||||
.forIdentityRecordsAndDestinations(
|
||||
identityRecords = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecords(othersRecipients).identityRecords,
|
||||
destinations = othersRecipients.map { ContactSearchKey.RecipientSearchKey.KnownRecipient(it.id) }
|
||||
destinations = listOf(ContactSearchKey.RecipientSearchKey.Story(myStoryRecipientId))
|
||||
)
|
||||
.show(conversationActivity.supportFragmentManager)
|
||||
}
|
||||
|
||||
// Uncomment to make dialog stay on screen, otherwise will show/dismiss immediately
|
||||
// ThreadUtil.sleep(15000)
|
||||
// ThreadUtil.sleep( 30000)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,9 +55,10 @@ class SafetyNumberReviewConnectionsFragment : DSLSettingsFragment(
|
|||
|
||||
private fun getConfiguration(state: SafetyNumberBottomSheetState): DSLConfiguration {
|
||||
return configure {
|
||||
val recipientCount = state.destinationToRecipientMap.values.flatten().size
|
||||
textPref(
|
||||
title = DSLSettingsText.from(
|
||||
getString(R.string.SafetyNumberReviewConnectionsFragment__d_recipients_may_have, state.destinationToRecipientMap.values.flatten().size),
|
||||
resources.getQuantityString(R.plurals.SafetyNumberReviewConnectionsFragment__d_recipients_may_have, recipientCount, recipientCount),
|
||||
DSLSettingsText.TextAppearanceModifier(R.style.Signal_Text_BodyMedium),
|
||||
DSLSettingsText.ColorModifier(ContextCompat.getColor(requireContext(), R.color.signal_colorOnSurfaceVariant))
|
||||
)
|
||||
|
|
|
@ -4839,7 +4839,7 @@
|
|||
<string name="ExpandModel__view_more">View more</string>
|
||||
<string name="StoriesLinkPopup__visit_link">Visit link</string>
|
||||
|
||||
<!-- Duration and price information -->
|
||||
<!-- Gift price and duration, formatted as: {price} dot {n} day duration -->
|
||||
<plurals name="GiftRowItem_s_dot_d_day_duration">
|
||||
<item quantity="one">%1$s · %2$d day duration</item>
|
||||
<item quantity="other">%1$s · %2$d day duration</item>
|
||||
|
@ -4983,7 +4983,10 @@
|
|||
<!-- Title of safety number review fragment -->
|
||||
<string name="SafetyNumberReviewConnectionsFragment__safety_number_changes">Safety number changes</string>
|
||||
<!-- Message of safety number review fragment -->
|
||||
<string name="SafetyNumberReviewConnectionsFragment__d_recipients_may_have">%1$d recipients may have reinstalled Signal or changed devices. Tap a recipient to confirm the new safety number. This is optional.</string>
|
||||
<plurals name="SafetyNumberReviewConnectionsFragment__d_recipients_may_have">
|
||||
<item quantity="one">%1$d recipient may have reinstalled Signal or changed devices. Tap a recipient to confirm the new safety number. This is optional.</item>
|
||||
<item quantity="other">%1$d recipients may have reinstalled Signal or changed devices. Tap a recipient to confirm the new safety number. This is optional.</item>
|
||||
</plurals>
|
||||
<!-- Section header for 1:1 contacts in review fragment -->
|
||||
<string name="SafetyNumberBucketRowItem__contacts">Contacts</string>
|
||||
<!-- Context menu label for distribution list headers in review fragment -->
|
||||
|
|
Ładowanie…
Reference in New Issue