diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt index 52edc08fb..df661e9ce 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt @@ -88,35 +88,35 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter private fun getConfiguration(state: InternalSettingsState): DSLConfiguration { return configure { - sectionHeaderPref(R.string.preferences__internal_account) + sectionHeaderPref(DSLSettingsText.from("Account")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_refresh_attributes), - summary = DSLSettingsText.from(R.string.preferences__internal_refresh_attributes_description), + title = DSLSettingsText.from("Refresh attributes"), + summary = DSLSettingsText.from("Forces a write of capabilities on to the server followed by a read."), onClick = { refreshAttributes() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_refresh_profile), - summary = DSLSettingsText.from(R.string.preferences__internal_refresh_profile_description), + title = DSLSettingsText.from("Refresh profile"), + summary = DSLSettingsText.from("Forces a refresh of your own profile."), onClick = { refreshProfile() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_rotate_profile_key), - summary = DSLSettingsText.from(R.string.preferences__internal_rotate_profile_key_description), + title = DSLSettingsText.from("Rotate profile key"), + summary = DSLSettingsText.from("Creates a new versioned profile, and triggers an update of any GV2 group you belong to."), onClick = { rotateProfileKey() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_refresh_remote_config), - summary = DSLSettingsText.from(R.string.preferences__internal_refresh_remote_config_description), + title = DSLSettingsText.from("Refresh remote config"), + summary = DSLSettingsText.from("Forces a refresh of the remote config locally instead of waiting for the elapsed time."), onClick = { refreshRemoteValues() } @@ -124,11 +124,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_misc) + sectionHeaderPref(DSLSettingsText.from("Miscellaneous")) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_user_details), - summary = DSLSettingsText.from(R.string.preferences__internal_user_details_description), + title = DSLSettingsText.from("'Internal Details' button"), + summary = DSLSettingsText.from("Show a button in conversation settings that lets you see more information about a user."), isChecked = state.seeMoreUserDetails, onClick = { viewModel.setSeeMoreUserDetails(!state.seeMoreUserDetails) @@ -136,8 +136,8 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_shake_to_report), - summary = DSLSettingsText.from(R.string.preferences__internal_shake_to_report_description), + title = DSLSettingsText.from("Shake to Report"), + summary = DSLSettingsText.from("Shake your phone to easily submit and share a debug log."), isChecked = state.shakeToReport, onClick = { viewModel.setShakeToReport(!state.shakeToReport) @@ -145,7 +145,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_keep_longer_logs), + title = DSLSettingsText.from("Clear keep longer logs"), onClick = { clearKeepLongerLogs() } @@ -153,11 +153,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_payments) + sectionHeaderPref(DSLSettingsText.from("Payments")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_payment_copy_data), - summary = DSLSettingsText.from(R.string.preferences__internal_payment_copy_data_description), + title = DSLSettingsText.from("Copy payments data"), + summary = DSLSettingsText.from("Copy all payment records to clipboard."), onClick = { copyPaymentsDataToClipboard() } @@ -165,11 +165,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_storage_service) + sectionHeaderPref(DSLSettingsText.from("Storage Service")) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_disable_storage_service), - summary = DSLSettingsText.from(R.string.preferences__internal_disable_storage_service_description), + title = DSLSettingsText.from("Disable syncing"), + summary = DSLSettingsText.from("Prevent syncing any data to/from storage service."), isChecked = state.disableStorageService, onClick = { viewModel.setDisableStorageService(!state.disableStorageService) @@ -177,16 +177,16 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_sync_now), - summary = DSLSettingsText.from(R.string.preferences__internal_sync_now_description), + title = DSLSettingsText.from("Sync now"), + summary = DSLSettingsText.from("Enqueue a normal storage service sync."), onClick = { enqueueStorageServiceSync() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_force_storage_service_sync), - summary = DSLSettingsText.from(R.string.preferences__internal_force_storage_service_sync_description), + title = DSLSettingsText.from("Overwrite remote data"), + summary = DSLSettingsText.from("Forces remote storage to match the local device state."), onClick = { enqueueStorageServiceForcePush() } @@ -194,11 +194,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_preferences_groups_v2) + sectionHeaderPref(DSLSettingsText.from("Groups V2")) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_force_gv2_invites), - summary = DSLSettingsText.from(R.string.preferences__internal_force_gv2_invites_description), + title = DSLSettingsText.from("Force invites"), + summary = DSLSettingsText.from("Members will not be added directly to a GV2 even if they could be."), isChecked = state.gv2forceInvites, onClick = { viewModel.setGv2ForceInvites(!state.gv2forceInvites) @@ -206,8 +206,8 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_ignore_gv2_server_changes), - summary = DSLSettingsText.from(R.string.preferences__internal_ignore_gv2_server_changes_description), + title = DSLSettingsText.from("Ignore server changes"), + summary = DSLSettingsText.from("Changes in server's response will be ignored, causing passive voice update messages if P2P is also ignored."), isChecked = state.gv2ignoreServerChanges, onClick = { viewModel.setGv2IgnoreServerChanges(!state.gv2ignoreServerChanges) @@ -215,8 +215,8 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_ignore_gv2_p2p_changes), - summary = DSLSettingsText.from(R.string.preferences__internal_ignore_gv2_server_changes_description), + title = DSLSettingsText.from("Ignore P2P changes"), + summary = DSLSettingsText.from("Changes sent P2P will be ignored. In conjunction with ignoring server changes, will cause passive voice."), isChecked = state.gv2ignoreP2PChanges, onClick = { viewModel.setGv2IgnoreP2PChanges(!state.gv2ignoreP2PChanges) @@ -225,7 +225,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_network) + sectionHeaderPref(DSLSettingsText.from("Network")) switchPref( title = DSLSettingsText.from("Force websocket mode"), @@ -247,8 +247,8 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_allow_censorship_toggle), - summary = DSLSettingsText.from(R.string.preferences__internal_allow_censorship_toggle_description), + title = DSLSettingsText.from("Allow censorship circumvention toggle"), + summary = DSLSettingsText.from("Allow changing the censorship circumvention toggle regardless of network connectivity."), isChecked = state.allowCensorshipSetting, onClick = { viewModel.setAllowCensorshipSetting(!state.allowCensorshipSetting) @@ -257,11 +257,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_conversations_and_shortcuts) + sectionHeaderPref(DSLSettingsText.from("Conversations and Shortcuts")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_delete_all_dynamic_shortcuts), - summary = DSLSettingsText.from(R.string.preferences__internal_click_to_delete_all_dynamic_shortcuts), + title = DSLSettingsText.from("Delete all dynamic shortcuts"), + summary = DSLSettingsText.from("Click to delete all dynamic shortcuts"), onClick = { deleteAllDynamicShortcuts() } @@ -269,20 +269,16 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_emoji) + sectionHeaderPref(DSLSettingsText.from("Emoji")) val emojiSummary = if (state.emojiVersion == null) { - getString(R.string.preferences__internal_use_built_in_emoji_set) + "Use built-in emoji set" } else { - getString( - R.string.preferences__internal_current_version_d_at_density_s, - state.emojiVersion.version, - state.emojiVersion.density - ) + "Current version: ${state.emojiVersion.version} at density ${state.emojiVersion.density}" } switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_use_built_in_emoji_set), + title = DSLSettingsText.from("Use built-in emoji set"), summary = DSLSettingsText.from(emojiSummary), isChecked = state.useBuiltInEmojiSet, onClick = { @@ -291,16 +287,16 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_force_emoji_download), - summary = DSLSettingsText.from(R.string.preferences__internal_force_emoji_download_description), + title = DSLSettingsText.from("Force emoji download"), + summary = DSLSettingsText.from("Download the latest emoji set if it\\'s newer than what we have."), onClick = { ApplicationDependencies.getJobManager().add(DownloadLatestEmojiDataJob(true)) } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_force_search_index_download), - summary = DSLSettingsText.from(R.string.preferences__internal_force_search_index_download_description), + title = DSLSettingsText.from("Force search index download"), + summary = DSLSettingsText.from("Download the latest emoji search index if it\\'s newer than what we have."), onClick = { EmojiSearchIndexDownloadJob.scheduleImmediately() } @@ -308,27 +304,27 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_sender_key) + sectionHeaderPref(DSLSettingsText.from("Sender Key")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_all_state), - summary = DSLSettingsText.from(R.string.preferences__internal_click_to_delete_all_sender_key_state), + title = DSLSettingsText.from("Clear all state"), + summary = DSLSettingsText.from("Click to delete all sender key state"), onClick = { clearAllSenderKeyState() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_shared_state), - summary = DSLSettingsText.from(R.string.preferences__internal_click_to_delete_all_sharing_state), + title = DSLSettingsText.from("Clear shared state"), + summary = DSLSettingsText.from("Click to delete all sharing state"), onClick = { clearAllSenderKeySharedState() } ) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_remove_two_person_minimum), - summary = DSLSettingsText.from(R.string.preferences__internal_remove_the_requirement_that_you_need), + title = DSLSettingsText.from("Remove 2 person minimum"), + summary = DSLSettingsText.from("Remove the requirement that you need at least 2 recipients to use sender key."), isChecked = state.removeSenderKeyMinimium, onClick = { viewModel.setRemoveSenderKeyMinimum(!state.removeSenderKeyMinimium) @@ -336,8 +332,8 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_delay_resends), - summary = DSLSettingsText.from(R.string.preferences__internal_delay_resending_messages_in_response_to_retry_receipts), + title = DSLSettingsText.from("Delay resends"), + summary = DSLSettingsText.from("Delay resending messages in response to retry receipts by 10 seconds."), isChecked = state.delayResends, onClick = { viewModel.setDelayResends(!state.delayResends) @@ -346,11 +342,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_local_metrics) + sectionHeaderPref(DSLSettingsText.from("Local Metrics")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_local_metrics), - summary = DSLSettingsText.from(R.string.preferences__internal_click_to_clear_all_local_metrics_state), + title = DSLSettingsText.from("Clear local metrics"), + summary = DSLSettingsText.from("Click to clear all local metrics state."), onClick = { clearAllLocalMetricsState() } @@ -358,10 +354,10 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_calling_server) + sectionHeaderPref(DSLSettingsText.from("Group call server")) radioPref( - title = DSLSettingsText.from(R.string.preferences__internal_calling_server_default), + title = DSLSettingsText.from("Default"), summary = DSLSettingsText.from(BuildConfig.SIGNAL_SFU_URL), isChecked = state.callingServer == BuildConfig.SIGNAL_SFU_URL, onClick = { @@ -372,7 +368,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter BuildConfig.SIGNAL_SFU_INTERNAL_NAMES.zip(BuildConfig.SIGNAL_SFU_INTERNAL_URLS) .forEach { (name, server) -> radioPref( - title = DSLSettingsText.from(requireContext().getString(R.string.preferences__internal_calling_server_s, name)), + title = DSLSettingsText.from("$name server"), summary = DSLSettingsText.from(server), isChecked = state.callingServer == server, onClick = { @@ -381,10 +377,10 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) } - sectionHeaderPref(R.string.preferences__internal_calling) + sectionHeaderPref(DSLSettingsText.from("Calling options")) radioListPref( - title = DSLSettingsText.from(R.string.preferences__internal_calling_audio_processing_method), + title = DSLSettingsText.from("Audio processing method"), listItems = CallManager.AudioProcessingMethod.values().map { it.name }.toTypedArray(), selected = CallManager.AudioProcessingMethod.values().indexOf(state.callingAudioProcessingMethod), onSelected = { @@ -393,7 +389,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) radioListPref( - title = DSLSettingsText.from(R.string.preferences__internal_calling_bandwidth_mode), + title = DSLSettingsText.from("Bandwidth mode"), listItems = CallManager.BandwidthMode.values().map { it.name }.toTypedArray(), selected = CallManager.BandwidthMode.values().indexOf(state.callingBandwidthMode), onSelected = { @@ -402,7 +398,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) switchPref( - title = DSLSettingsText.from(R.string.preferences__internal_calling_disable_telecom), + title = DSLSettingsText.from("Disable Telecom integration"), isChecked = state.callingDisableTelecom, onClick = { viewModel.setInternalCallingDisableTelecom(!state.callingDisableTelecom) @@ -412,24 +408,24 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter if (SignalStore.donationsValues().getSubscriber() != null) { dividerPref() - sectionHeaderPref(R.string.preferences__internal_badges) + sectionHeaderPref(DSLSettingsText.from("Badges")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_badges_enqueue_redemption), + title = DSLSettingsText.from("Enqueue redemption."), onClick = { enqueueSubscriptionRedemption() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_badges_enqueue_keep_alive), + title = DSLSettingsText.from("Enqueue keep-alive."), onClick = { enqueueSubscriptionKeepAlive() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_badges_set_error_state), + title = DSLSettingsText.from("Set error state."), onClick = { findNavController().safeNavigate(InternalSettingsFragmentDirections.actionInternalSettingsFragmentToDonorErrorConfigurationFragment()) } @@ -438,17 +434,17 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_release_channel) + sectionHeaderPref(DSLSettingsText.from("Release channel")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_release_channel_set_last_version), + title = DSLSettingsText.from("Set last version seen back 10 versions"), onClick = { SignalStore.releaseChannelValues().highestVersionNoteReceived = max(SignalStore.releaseChannelValues().highestVersionNoteReceived - 10, 0) } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_reset_donation_megaphone), + title = DSLSettingsText.from("Reset donation megaphone"), onClick = { SignalDatabase.remoteMegaphones.debugRemoveAll() MegaphoneDatabase.getInstance(ApplicationDependencies.getApplication()).let { @@ -461,7 +457,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_fetch_release_channel), + title = DSLSettingsText.from("Fetch release channel"), onClick = { SignalStore.releaseChannelValues().previousManifestMd5 = ByteArray(0) RetrieveRemoteAnnouncementsJob.enqueue(force = true) @@ -469,7 +465,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_add_sample_note), + title = DSLSettingsText.from("Add sample note"), onClick = { viewModel.addSampleReleaseNote() } @@ -477,27 +473,27 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.preferences__internal_cds) + sectionHeaderPref(DSLSettingsText.from("CDS")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_history), - summary = DSLSettingsText.from(R.string.preferences__internal_clear_history_description), + title = DSLSettingsText.from("Clear history"), + summary = DSLSettingsText.from("Clears all CDS history, meaning the next sync will consider all numbers to be new."), onClick = { clearCdsHistory() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_all_service_ids), - summary = DSLSettingsText.from(R.string.preferences__internal_clear_all_service_ids_description), + title = DSLSettingsText.from("Clear all service IDs"), + summary = DSLSettingsText.from("Clears all known service IDs (except your own) for people that have phone numbers. Do not use on your personal device!"), onClick = { clearAllServiceIds() } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_all_profile_keys), - summary = DSLSettingsText.from(R.string.preferences__internal_clear_all_profile_keys_description), + title = DSLSettingsText.from("Clear all profile keys"), + summary = DSLSettingsText.from("Clears all known profile keys (except your own). Do not use on your personal device!"), onClick = { clearAllProfileKeys() } @@ -505,11 +501,11 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter dividerPref() - sectionHeaderPref(R.string.ConversationListTabs__stories) + sectionHeaderPref(DSLSettingsText.from("Stories")) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_clear_onboarding_state), - summary = DSLSettingsText.from(R.string.preferences__internal_clears_onboarding_flag_and_triggers_download_of_onboarding_stories), + title = DSLSettingsText.from("Clear onboarding state"), + summary = DSLSettingsText.from("Clears onboarding flag and triggers download of onboarding stories."), isEnabled = state.canClearOnboardingState, onClick = { viewModel.onClearOnboardingState() @@ -525,7 +521,7 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_stories_dialog_launcher), + title = DSLSettingsText.from("Stories dialog launcher"), onClick = { findNavController().safeNavigate(InternalSettingsFragmentDirections.actionInternalSettingsFragmentToStoryDialogsLauncherFragment()) } diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/StoryDialogLauncherFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalStoryDialogLauncherFragment.kt similarity index 56% rename from app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/StoryDialogLauncherFragment.kt rename to app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalStoryDialogLauncherFragment.kt index f0521b71d..591ae1bfb 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/StoryDialogLauncherFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalStoryDialogLauncherFragment.kt @@ -9,7 +9,7 @@ import org.thoughtcrime.securesms.components.settings.configure import org.thoughtcrime.securesms.stories.dialogs.StoryDialogs import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter -class StoryDialogLauncherFragment : DSLSettingsFragment(titleId = R.string.preferences__internal_stories_dialog_launcher) { +class InternalStoryDialogLauncherFragment : DSLSettingsFragment(titleId = R.string.preferences__internal_stories_dialog_launcher) { override fun bindAdapter(adapter: MappingAdapter) { adapter.submitList(getConfiguration().toMappingModelList()) } @@ -17,25 +17,25 @@ class StoryDialogLauncherFragment : DSLSettingsFragment(titleId = R.string.prefe private fun getConfiguration(): DSLConfiguration { return configure { clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_remove_group_story), + title = DSLSettingsText.from("Remove group story"), onClick = { StoryDialogs.removeGroupStory(requireContext(), "Family") { - Toast.makeText(requireContext(), R.string.preferences__internal_remove_group_story, Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), "Remove group story", Toast.LENGTH_SHORT).show() } } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_retry_send), + title = DSLSettingsText.from("Retry send"), onClick = { StoryDialogs.resendStory(requireContext()) { - Toast.makeText(requireContext(), R.string.preferences__internal_retry_send, Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), "Retry send", Toast.LENGTH_SHORT).show() } } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_story_or_profile_selector), + title = DSLSettingsText.from("Story or profile selector"), onClick = { StoryDialogs.displayStoryOrProfileImage( context = requireContext(), @@ -46,37 +46,37 @@ class StoryDialogLauncherFragment : DSLSettingsFragment(titleId = R.string.prefe ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_hide_story), + title = DSLSettingsText.from("Hide story"), onClick = { StoryDialogs.hideStory(requireContext(), "Spiderman") { - Toast.makeText(requireContext(), R.string.preferences__internal_hide_story, Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), "Hide story", Toast.LENGTH_SHORT).show() } } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_turn_off_stories), + title = DSLSettingsText.from("Turn off stories"), onClick = { StoryDialogs.disableStories(requireContext(), false) { - Toast.makeText(requireContext(), R.string.preferences__internal_turn_off_stories, Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), "Turn off stories", Toast.LENGTH_SHORT).show() } } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_turn_off_stories_with_stories_on_disk), + title = DSLSettingsText.from("Turn off stories (with stories on disk)"), onClick = { StoryDialogs.disableStories(requireContext(), true) { - Toast.makeText(requireContext(), R.string.preferences__internal_turn_off_stories_with_stories_on_disk, Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), "Turn off stories (with stories on disk)", Toast.LENGTH_SHORT).show() } } ) clickPref( - title = DSLSettingsText.from(R.string.preferences__internal_delete_custom_story), + title = DSLSettingsText.from("Delete custom story"), onClick = { StoryDialogs.deleteDistributionList(requireContext(), "Family") { - Toast.makeText(requireContext(), R.string.preferences__internal_delete_custom_story, Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), "Delete custom story", Toast.LENGTH_SHORT).show() } } ) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationFragment.kt similarity index 76% rename from app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationFragment.kt rename to app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationFragment.kt index 1108035f1..3c35af6ed 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationFragment.kt @@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.components.settings.app.internal.donor import androidx.fragment.app.viewModels import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import org.signal.donations.StripeDeclineCode -import org.thoughtcrime.securesms.R import org.thoughtcrime.securesms.components.settings.DSLConfiguration import org.thoughtcrime.securesms.components.settings.DSLSettingsFragment import org.thoughtcrime.securesms.components.settings.DSLSettingsText @@ -12,9 +11,9 @@ import org.thoughtcrime.securesms.components.settings.configure import org.thoughtcrime.securesms.util.LifecycleDisposable import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter -class DonorErrorConfigurationFragment : DSLSettingsFragment() { +class InternalDonorErrorConfigurationFragment : DSLSettingsFragment() { - private val viewModel: DonorErrorConfigurationViewModel by viewModels() + private val viewModel: InternalDonorErrorConfigurationViewModel by viewModels() private val lifecycleDisposable = LifecycleDisposable() override fun bindAdapter(adapter: MappingAdapter) { @@ -23,17 +22,17 @@ class DonorErrorConfigurationFragment : DSLSettingsFragment() { } } - private fun getConfiguration(state: DonorErrorConfigurationState): DSLConfiguration { + private fun getConfiguration(state: InternalDonorErrorConfigurationState): DSLConfiguration { return configure { radioListPref( - title = DSLSettingsText.from(R.string.preferences__internal_donor_error_expired_badge), + title = DSLSettingsText.from("Expired Badge"), selected = state.badges.indexOf(state.selectedBadge), listItems = state.badges.map { it.name }.toTypedArray(), onSelected = { viewModel.setSelectedBadge(it) } ) radioListPref( - title = DSLSettingsText.from(R.string.preferences__internal_donor_error_cancelation_reason), + title = DSLSettingsText.from("Cancellation Reason"), selected = UnexpectedSubscriptionCancellation.values().indexOf(state.selectedUnexpectedSubscriptionCancellation), listItems = UnexpectedSubscriptionCancellation.values().map { it.status }.toTypedArray(), onSelected = { viewModel.setSelectedUnexpectedSubscriptionCancellation(it) }, @@ -41,7 +40,7 @@ class DonorErrorConfigurationFragment : DSLSettingsFragment() { ) radioListPref( - title = DSLSettingsText.from(R.string.preferences__internal_donor_error_charge_failure), + title = DSLSettingsText.from("Charge Failure"), selected = StripeDeclineCode.Code.values().indexOf(state.selectedStripeDeclineCode), listItems = StripeDeclineCode.Code.values().map { it.code }.toTypedArray(), onSelected = { viewModel.setStripeDeclineCode(it) }, @@ -49,14 +48,14 @@ class DonorErrorConfigurationFragment : DSLSettingsFragment() { ) primaryButton( - text = DSLSettingsText.from(R.string.preferences__internal_donor_error_save_and_finish), + text = DSLSettingsText.from("Save and Finish"), onClick = { lifecycleDisposable += viewModel.save().subscribe { requireActivity().finish() } } ) secondaryButtonNoOutline( - text = DSLSettingsText.from(R.string.preferences__internal_donor_error_clear), + text = DSLSettingsText.from("Clear"), onClick = { lifecycleDisposable += viewModel.clearErrorState().subscribe() } diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationState.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationState.kt similarity index 91% rename from app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationState.kt rename to app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationState.kt index 82b72bc9a..7fc46335e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationState.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationState.kt @@ -4,7 +4,7 @@ import org.signal.donations.StripeDeclineCode import org.thoughtcrime.securesms.badges.models.Badge import org.thoughtcrime.securesms.components.settings.app.subscription.errors.UnexpectedSubscriptionCancellation -data class DonorErrorConfigurationState( +data class InternalDonorErrorConfigurationState( val badges: List = emptyList(), val selectedBadge: Badge? = null, val selectedUnexpectedSubscriptionCancellation: UnexpectedSubscriptionCancellation? = null, diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationViewModel.kt similarity index 90% rename from app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationViewModel.kt rename to app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationViewModel.kt index 3a1b20c4f..de44695a2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/DonorErrorConfigurationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/donor/InternalDonorErrorConfigurationViewModel.kt @@ -18,12 +18,12 @@ import org.thoughtcrime.securesms.util.rx.RxStore import org.whispersystems.signalservice.api.subscriptions.ActiveSubscription import java.util.Locale -class DonorErrorConfigurationViewModel : ViewModel() { +class InternalDonorErrorConfigurationViewModel : ViewModel() { - private val store = RxStore(DonorErrorConfigurationState()) + private val store = RxStore(InternalDonorErrorConfigurationState()) private val disposables = CompositeDisposable() - val state: Flowable = store.stateFlowable + val state: Flowable = store.stateFlowable init { val giftBadges: Single> = Single @@ -131,20 +131,20 @@ class DonorErrorConfigurationViewModel : ViewModel() { } } - private fun handleBoostExpiration(state: DonorErrorConfigurationState) { + private fun handleBoostExpiration(state: InternalDonorErrorConfigurationState) { SignalStore.donationsValues().setExpiredBadge(state.selectedBadge) } - private fun handleGiftExpiration(state: DonorErrorConfigurationState) { + private fun handleGiftExpiration(state: InternalDonorErrorConfigurationState) { SignalStore.donationsValues().setExpiredGiftBadge(state.selectedBadge) } - private fun handleSubscriptionExpiration(state: DonorErrorConfigurationState) { + private fun handleSubscriptionExpiration(state: InternalDonorErrorConfigurationState) { SignalStore.donationsValues().setExpiredBadge(state.selectedBadge) handleSubscriptionPaymentFailure(state) } - private fun handleSubscriptionPaymentFailure(state: DonorErrorConfigurationState) { + private fun handleSubscriptionPaymentFailure(state: InternalDonorErrorConfigurationState) { SignalStore.donationsValues().unexpectedSubscriptionCancelationReason = state.selectedUnexpectedSubscriptionCancellation?.status SignalStore.donationsValues().unexpectedSubscriptionCancelationTimestamp = System.currentTimeMillis() SignalStore.donationsValues().setUnexpectedSubscriptionCancelationChargeFailure( diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.kt b/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.kt index a64a7bfdc..4ecea1bbd 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/RecipientDatabase.kt @@ -2279,7 +2279,7 @@ open class RecipientDatabase(context: Context, databaseHelper: SignalDatabase) : db.beginTransaction() try { for ((e164, result) in mapping) { - ids += processPnpTuple(e164, result.pni, result.aci, false).finalId + ids += getAndPossiblyMerge(serviceId = result.aci, pni = result.pni, e164 = e164, pniVerified = false, changeSelf = false) } db.setTransactionSuccessful() diff --git a/app/src/main/res/navigation/app_settings.xml b/app/src/main/res/navigation/app_settings.xml index 06b80bbb7..730c446d5 100644 --- a/app/src/main/res/navigation/app_settings.xml +++ b/app/src/main/res/navigation/app_settings.xml @@ -504,12 +504,12 @@ diff --git a/app/src/main/res/values-af/strings.xml b/app/src/main/res/values-af/strings.xml index 411d03930..4c2321706 100644 --- a/app/src/main/res/values-af/strings.xml +++ b/app/src/main/res/values-af/strings.xml @@ -2875,7 +2875,6 @@ Force Invites Members will not be added directly to a GV2 even if they could be. Ignore server changes - Changes in server\'s response will be ignored, causing passive voice update messages if P2P is also ignored. Ignore P2P changes Changes sent P2P will be ignored. In conjunction with ignoring server changes, will cause passive voice. Payments diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c60f9975c..a99666b73 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2867,107 +2867,9 @@ Customize option - Turn off stories (with stories on disk) - Turn off stories - Delete custom story - Hide story - Story or profile selector - Stories dialog launcher - Retry send - Remove group story - Clear onboarding state - Clears onboarding flag and triggers download of onboarding stories. Internal Preferences - Groups V2 - Force Invites - Members will not be added directly to a GV2 even if they could be. - Ignore server changes - Changes in server\'s response will be ignored, causing passive voice update messages if P2P is also ignored. - Ignore P2P changes - Changes sent P2P will be ignored. In conjunction with ignoring server changes, will cause passive voice. - Payments - Copy payments data - Copy all payment records to clipboard. - Account - Refresh attributes - Forces a write of capabilities on to the server followed by a read. - Refresh profile - Forces a refresh of your own profile. - Rotate profile key - Creates a new versioned profile, and triggers an update of any GV2 group you belong to. - Refresh remote config - Forces a refresh of the remote config locally instead of waiting for the elapsed time. - Miscellaneous - \'Internal Details\' button - Show a button in conversation settings that lets you see more information about a user. - Shake to Report - Shake your phone to easily submit and share a debug log. - Clear keep longer logs - Storage service - Disable syncing - Prevent syncing any data to/from storage service. - Overwrite remote data - Sync now - Enqueue a normal storage service sync. - Forces remote storage to match the local device state. - Network - Allow censorship circumvention toggle - Allow changing the censorship circumvention toggle regardless of network connectivity. - Conversations and Shortcuts - Emoji - Use built-in emoji set - Force emoji download - Download the latest emoji set if it\'s newer than what we have. - Force search index download - Download the latest emoji search index if it\'s newer than what we have. - Current version: Built-In - Current version: %1$d at density %2$s - Delete all dynamic shortcuts - Click to delete all dynamic shortcuts Internal Details - Disable Profile Sharing - Delete Session - Sender Key - Clear all state - Click to delete all sender key state - Clear shared state - Click to delete all sharing state - Remove 2 person minimum - Remove the requirement that you need at least 2 recipients to use sender key. - Delay resends - Delay resending messages in response to retry receipts by 10 seconds. - Local Metrics - Clear local metrics - Click to clear all local metrics state. - Group call server - Default - %1$s server - Calling options - Audio processing method - Bandwidth mode - Disable Telecom integration - Badges - Enqueue redemption. - Enqueue keep-alive. - Set error state. - Release channel - Fetch release channel - Set last version seen back 10 versions - Reset donation megaphone - Add sample note - Disable stories - CDS - Clear history - Clears all CDS history, meaning the next sync will consider all numbers to be new. - Clear all service IDs - Clears all known service IDs (except your own) for people that have phone numbers. Do not use on your personal device! - Clear all profile keys - Clears all known profile keys (except your own). Do not use on your personal device! - Expired Badge - Charge Failure - Cancelation Reason - Save and Finish - Clear + Stories dialog launcher