mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Avoid opening Media preview for not sent media.
This commit is contained in:
@@ -69,6 +69,7 @@ import org.thoughtcrime.securesms.components.settings.conversation.preferences.S
|
||||
import org.thoughtcrime.securesms.components.settings.conversation.preferences.Utils.formatMutedUntil
|
||||
import org.thoughtcrime.securesms.contacts.ContactSelectionDisplayMode
|
||||
import org.thoughtcrime.securesms.conversation.ConversationIntents
|
||||
import org.thoughtcrime.securesms.database.AttachmentTable
|
||||
import org.thoughtcrime.securesms.groups.ParcelableGroupId
|
||||
import org.thoughtcrime.securesms.groups.ui.GroupErrors
|
||||
import org.thoughtcrime.securesms.groups.ui.GroupLimitDialog
|
||||
@@ -629,6 +630,10 @@ class ConversationSettingsFragment : DSLSettingsFragment(
|
||||
mediaRecords = state.sharedMedia,
|
||||
mediaIds = state.sharedMediaIds,
|
||||
onMediaRecordClick = { view, mediaRecord, isLtr ->
|
||||
if (mediaRecord.attachment?.transferState != AttachmentTable.TRANSFER_PROGRESS_DONE) {
|
||||
Toast.makeText(context, R.string.ConversationSettingsFragment__this_media_is_not_sent_yet, Toast.LENGTH_LONG).show()
|
||||
return@Model
|
||||
}
|
||||
view.transitionName = "thumb"
|
||||
val options = ActivityOptions.makeSceneTransitionAnimation(requireActivity(), view, "thumb")
|
||||
startActivityForResult(
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.thoughtcrime.securesms.components.menu.ActionItem;
|
||||
import org.thoughtcrime.securesms.components.menu.SignalBottomActionBar;
|
||||
import org.thoughtcrime.securesms.components.voice.VoiceNoteMediaController;
|
||||
import org.thoughtcrime.securesms.components.voice.VoiceNotePlaybackState;
|
||||
import org.thoughtcrime.securesms.database.AttachmentTable;
|
||||
import org.thoughtcrime.securesms.database.MediaTable;
|
||||
import org.thoughtcrime.securesms.database.loaders.GroupedThreadMediaLoader;
|
||||
import org.thoughtcrime.securesms.database.loaders.MediaLoader;
|
||||
@@ -252,6 +253,10 @@ public final class MediaOverviewPageFragment extends LoggingFragment
|
||||
DatabaseAttachment attachment = mediaRecord.getAttachment();
|
||||
|
||||
if (MediaUtil.isVideo(attachment) || MediaUtil.isImage(attachment)) {
|
||||
if (mediaRecord.getAttachment().transferState != AttachmentTable.TRANSFER_PROGRESS_DONE) {
|
||||
Toast.makeText(context, R.string.MediaOverviewActivity_this_media_is_not_sent_yet, Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
MediaIntentFactory.MediaPreviewArgs args = new MediaIntentFactory.MediaPreviewArgs(
|
||||
threadId,
|
||||
mediaRecord.getDate(),
|
||||
|
||||
@@ -1719,6 +1719,8 @@
|
||||
<string name="MediaOverviewActivity_sent_by_you">Sent by you</string>
|
||||
<string name="MediaOverviewActivity_sent_by_s_to_s">Sent by %1$s to %2$s</string>
|
||||
<string name="MediaOverviewActivity_sent_by_you_to_s">Sent by you to %1$s</string>
|
||||
<!-- Error message shown when the user is trying to open a media that is not sent yet. -->
|
||||
<string name="MediaOverviewActivity_this_media_is_not_sent_yet">This media is not sent yet.</string>
|
||||
|
||||
<!-- Megaphones -->
|
||||
<string name="Megaphones_remind_me_later">Remind me later</string>
|
||||
@@ -5738,6 +5740,8 @@
|
||||
<string name="ConversationSettingsFragment__copied_phone_number_to_clipboard">Copied phone number to clipboard.</string>
|
||||
<string name="ConversationSettingsFragment__phone_number">Phone number</string>
|
||||
<string name="ConversationSettingsFragment__get_badges">Get badges for your profile by supporting Signal. Tap on a badge to learn more.</string>
|
||||
<!-- Error message shown when the user is trying to open a media that is not sent yet. -->
|
||||
<string name="ConversationSettingsFragment__this_media_is_not_sent_yet">This media is not sent yet.</string>
|
||||
|
||||
<!-- PermissionsSettingsFragment -->
|
||||
<string name="PermissionsSettingsFragment__add_members">Add members</string>
|
||||
|
||||
Reference in New Issue
Block a user