mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-02 07:23:38 +00:00
Adjust strings for media and calls.
This commit is contained in:
committed by
Greyson Parrelli
parent
c431ba3f7a
commit
fd1e47888a
@@ -2381,7 +2381,7 @@ class ConversationFragment :
|
||||
|
||||
val attachments = SaveAttachmentUtil.getAttachmentsForRecord(record)
|
||||
|
||||
SaveAttachmentUtil.showWarningDialogIfNecessary(requireContext()) {
|
||||
SaveAttachmentUtil.showWarningDialogIfNecessary(requireContext(), attachments.size) {
|
||||
if (StorageUtil.canWriteToMediaStore()) {
|
||||
performAttachmentSave(attachments)
|
||||
} else {
|
||||
@@ -2482,13 +2482,14 @@ class ConversationFragment :
|
||||
override fun isSwipeAvailable(conversationMessage: ConversationMessage): Boolean {
|
||||
val recipient = viewModel.recipientSnapshot ?: return false
|
||||
|
||||
return actionMode == null && MenuState.canReplyToMessage(
|
||||
recipient,
|
||||
MenuState.isActionMessage(conversationMessage.messageRecord),
|
||||
conversationMessage.messageRecord,
|
||||
viewModel.hasMessageRequestState,
|
||||
conversationGroupViewModel.isNonAdminInAnnouncementGroup()
|
||||
)
|
||||
return actionMode == null &&
|
||||
MenuState.canReplyToMessage(
|
||||
recipient,
|
||||
MenuState.isActionMessage(conversationMessage.messageRecord),
|
||||
conversationMessage.messageRecord,
|
||||
viewModel.hasMessageRequestState,
|
||||
conversationGroupViewModel.isNonAdminInAnnouncementGroup()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3934,7 +3935,10 @@ class ConversationFragment :
|
||||
|
||||
//region Compose + Send Callbacks
|
||||
|
||||
private inner class SendButtonListener : View.OnClickListener, OnEditorActionListener, SendButton.ScheduledSendListener {
|
||||
private inner class SendButtonListener :
|
||||
View.OnClickListener,
|
||||
OnEditorActionListener,
|
||||
SendButton.ScheduledSendListener {
|
||||
override fun onClick(v: View) {
|
||||
sendMessage()
|
||||
}
|
||||
@@ -4262,7 +4266,10 @@ class ConversationFragment :
|
||||
override fun create(): Fragment = KeyboardPagerFragment()
|
||||
}
|
||||
|
||||
private inner class KeyboardEvents : OnBackPressedCallback(false), InputAwareConstraintLayout.Listener, InsetAwareConstraintLayout.KeyboardStateListener {
|
||||
private inner class KeyboardEvents :
|
||||
OnBackPressedCallback(false),
|
||||
InputAwareConstraintLayout.Listener,
|
||||
InsetAwareConstraintLayout.KeyboardStateListener {
|
||||
override fun handleOnBackPressed() {
|
||||
container.hideInput()
|
||||
}
|
||||
|
||||
@@ -93,13 +93,22 @@ public class GroupCallUpdateMessageFactory implements UpdateDescription.Spannabl
|
||||
: context.getString(R.string.MessageRecord_s_is_in_the_call, describe(joinedMembers.get(0)));
|
||||
}
|
||||
case 2:
|
||||
return withTime ? context.getString(R.string.MessageRecord_s_and_s_are_in_the_call_s1,
|
||||
describe(joinedMembers.get(0)),
|
||||
describe(joinedMembers.get(1)),
|
||||
time)
|
||||
: context.getString(R.string.MessageRecord_s_and_s_are_in_the_call,
|
||||
describe(joinedMembers.get(0)),
|
||||
describe(joinedMembers.get(1)));
|
||||
boolean includesSelf = joinedMembers.contains(selfAci);
|
||||
if (includesSelf) {
|
||||
return withTime ? context.getString(R.string.MessageRecord_s_and_you_are_in_the_call_s1,
|
||||
describe(joinedMembers.get(0)),
|
||||
time)
|
||||
: context.getString(R.string.MessageRecord_s_and_you_are_in_the_call,
|
||||
describe(joinedMembers.get(0)));
|
||||
} else {
|
||||
return withTime ? context.getString(R.string.MessageRecord_s_and_s_are_in_the_call_s1,
|
||||
describe(joinedMembers.get(0)),
|
||||
describe(joinedMembers.get(1)),
|
||||
time)
|
||||
: context.getString(R.string.MessageRecord_s_and_s_are_in_the_call,
|
||||
describe(joinedMembers.get(0)),
|
||||
describe(joinedMembers.get(1)));
|
||||
}
|
||||
default:
|
||||
int others = joinedMembers.size() - 2;
|
||||
return withTime ? context.getResources().getQuantityString(R.plurals.MessageRecord_s_s_and_d_others_are_in_the_call_s,
|
||||
|
||||
@@ -44,7 +44,7 @@ final class MediaActions {
|
||||
return;
|
||||
}
|
||||
|
||||
SaveAttachmentTask.showWarningDialogIfNecessary(context, () -> Permissions.with(fragment)
|
||||
SaveAttachmentTask.showWarningDialogIfNecessary(context, mediaRecords.size(), () -> Permissions.with(fragment)
|
||||
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
.ifNecessary()
|
||||
.withPermanentDenialDialog(fragment.getString(R.string.MediaPreviewActivity_signal_needs_the_storage_permission_in_order_to_write_to_external_storage_but_it_has_been_permanently_denied))
|
||||
|
||||
@@ -78,7 +78,9 @@ import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class MediaPreviewV2Fragment : LoggingFragment(R.layout.fragment_media_preview_v2), MediaPreviewFragment.Events {
|
||||
class MediaPreviewV2Fragment :
|
||||
LoggingFragment(R.layout.fragment_media_preview_v2),
|
||||
MediaPreviewFragment.Events {
|
||||
|
||||
private val lifecycleDisposable = LifecycleDisposable()
|
||||
private val binding by ViewBinderDelegate(FragmentMediaPreviewV2Binding::bind)
|
||||
@@ -557,7 +559,7 @@ class MediaPreviewV2Fragment : LoggingFragment(R.layout.fragment_media_preview_v
|
||||
}
|
||||
|
||||
private fun saveToDisk(mediaItem: MediaTable.MediaRecord) {
|
||||
SaveAttachmentTask.showWarningDialogIfNecessary(requireContext()) {
|
||||
SaveAttachmentTask.showWarningDialogIfNecessary(requireContext(), 1) {
|
||||
if (StorageUtil.canWriteToMediaStore()) {
|
||||
performSaveToDisk(mediaItem)
|
||||
return@showWarningDialogIfNecessary
|
||||
|
||||
@@ -653,7 +653,7 @@ public final class ImageEditorFragment extends Fragment implements ImageEditorHu
|
||||
|
||||
@Override
|
||||
public void onSave() {
|
||||
SaveAttachmentTask.showWarningDialogIfNecessary(requireContext(), () -> {
|
||||
SaveAttachmentTask.showWarningDialogIfNecessary(requireContext(), 1, () -> {
|
||||
if (StorageUtil.canWriteToMediaStore()) {
|
||||
performSaveToDisk();
|
||||
return;
|
||||
|
||||
@@ -435,7 +435,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
|
||||
}
|
||||
}
|
||||
|
||||
public static void showWarningDialogIfNecessary(Context context, Runnable onSave) {
|
||||
public static void showWarningDialogIfNecessary(Context context, int count, Runnable onSave) {
|
||||
if (SignalStore.uiHints().hasDismissedSaveStorageWarning()) {
|
||||
onSave.run();
|
||||
} else {
|
||||
@@ -443,7 +443,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
|
||||
.setView(R.layout.dialog_save_attachment)
|
||||
.setTitle(R.string.ConversationFragment__save_to_phone)
|
||||
.setCancelable(true)
|
||||
.setMessage(R.string.ConversationFragment__this_media_will_be_saved)
|
||||
.setMessage(context.getResources().getQuantityString(R.plurals.ConversationFragment__this_media_will_be_saved, count, count))
|
||||
.setPositiveButton(R.string.save, ((dialog, i) -> {
|
||||
CheckBox checkbox = ((AlertDialog) dialog).findViewById(R.id.checkbox);
|
||||
if (checkbox.isChecked()) {
|
||||
|
||||
@@ -54,7 +54,7 @@ object SaveAttachmentUtil {
|
||||
|
||||
private val TAG = Log.tag(SaveAttachmentUtil::class.java)
|
||||
|
||||
fun showWarningDialogIfNecessary(context: Context, onSave: () -> Unit) {
|
||||
fun showWarningDialogIfNecessary(context: Context, count: Int, onSave: () -> Unit) {
|
||||
if (SignalStore.uiHints.hasDismissedSaveStorageWarning()) {
|
||||
onSave()
|
||||
} else {
|
||||
@@ -62,7 +62,7 @@ object SaveAttachmentUtil {
|
||||
.setView(R.layout.dialog_save_attachment)
|
||||
.setTitle(R.string.ConversationFragment__save_to_phone)
|
||||
.setCancelable(true)
|
||||
.setMessage(R.string.ConversationFragment__this_media_will_be_saved)
|
||||
.setMessage(context.resources.getQuantityString(R.plurals.ConversationFragment__this_media_will_be_saved, count, count))
|
||||
.setPositiveButton(R.string.save) { dialog, _ ->
|
||||
val checkbox = (dialog as AlertDialog).findViewById<CheckBox>(R.id.checkbox)!!
|
||||
if (checkbox.isChecked) {
|
||||
|
||||
@@ -589,7 +589,10 @@
|
||||
<!-- Dialog title asking to save media to your phone\'s storage -->
|
||||
<string name="ConversationFragment__save_to_phone">Save to phone?</string>
|
||||
<!-- Dialog message explaining that media will be saved to your phone and can potentially be accessed by other phones. -->
|
||||
<string name="ConversationFragment__this_media_will_be_saved">This media will be saved to your phone\'s storage. Other apps may be able to access it depending on your phone\'s permissions.</string>
|
||||
<plurals name="ConversationFragment__this_media_will_be_saved">
|
||||
<item quantity="one">This media will be saved to your phone\'s storage. Other apps may be able to access it depending on your phone\'s permissions.</item>
|
||||
<item quantity="other">This media will be saved to your phone\'s storage. Other apps may be able to access it depending on your phone\'s permissions.</item>
|
||||
</plurals>
|
||||
<!-- Checkbox shown in dialog to not show the dialog again in future cases -->
|
||||
<string name="ConversationFragment_dont_show_again">Don\'t show again</string>
|
||||
<string name="ConversationFragment_pending">Pending…</string>
|
||||
@@ -1971,12 +1974,16 @@
|
||||
<string name="MessageRecord_s_is_in_the_call_s">%1$s is in the call · %2$s</string>
|
||||
<!-- Chat log text for an ongoing group call only the local user has joined with a placeholder for formatted time -->
|
||||
<string name="MessageRecord_you_are_in_the_call_s1">You are in the call · %1$s</string>
|
||||
<!-- Chat log text for an ongoing group call with you and another participant where %1$s is the short display name of the other user and %2$s is the formatted time -->
|
||||
<string name="MessageRecord_s_and_you_are_in_the_call_s1">%1$s and you are in the call · %2$s</string>
|
||||
<!-- Chat log text for an ongoing group call with two participants with two placeholders for the short display name of the users that joined and a placeholder for formatted time -->
|
||||
<string name="MessageRecord_s_and_s_are_in_the_call_s1">%1$s and %2$s are in the call · %3$s</string>
|
||||
<!-- Chat log text for an ongoing group call that has one participant -->
|
||||
<string name="MessageRecord_s_is_in_the_call">%1$s is in the call</string>
|
||||
<!-- Chat log text for an ongoing group call only the local user has joined -->
|
||||
<string name="MessageRecord_you_are_in_the_call">You are in the call</string>
|
||||
<!-- Chat log text for an ongoing group call with you and another participant where %1$s is the short display name of the other user -->
|
||||
<string name="MessageRecord_s_and_you_are_in_the_call">%1$s and you are in the call</string>
|
||||
<!-- Chat log text for an ongoing group call with two participants with two placeholders, each for the short display name of the users that joined -->
|
||||
<string name="MessageRecord_s_and_s_are_in_the_call">%1$s and %2$s are in the call</string>
|
||||
<!-- Chat log text for a group call that ended within the last 5 minutes -->
|
||||
|
||||
Reference in New Issue
Block a user