mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 03:11:10 +01:00
Streamable Video.
This commit is contained in:
committed by
Nicholas Tinsley
parent
099c94c215
commit
64babe2e42
@@ -66,9 +66,7 @@ class MediaPreviewRepository {
|
||||
|
||||
for (i in 0..limit) {
|
||||
val element = MediaTable.MediaRecord.from(cursor)
|
||||
if (element != null) {
|
||||
mediaRecords.add(element)
|
||||
}
|
||||
mediaRecords.add(element)
|
||||
if (!cursor.moveToNext()) {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@ package org.thoughtcrime.securesms.mediapreview
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.attachments.Attachment
|
||||
import org.thoughtcrime.securesms.mediasend.Media
|
||||
import org.thoughtcrime.securesms.util.MediaUtil
|
||||
import org.thoughtcrime.securesms.util.adapter.StableIdGenerator
|
||||
|
||||
class MediaPreviewV2Adapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
|
||||
private val TAG = Log.tag(MediaPreviewV2Adapter::class.java)
|
||||
private var items: List<Attachment> = listOf()
|
||||
private val stableIdGenerator = StableIdGenerator<Attachment>()
|
||||
private val currentIdSet: HashSet<Long> = HashSet()
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -42,6 +43,12 @@ public final class VideoMediaPreviewFragment extends MediaPreviewFragment {
|
||||
View itemView = inflater.inflate(R.layout.media_preview_video_fragment, container, false);
|
||||
Bundle arguments = requireArguments();
|
||||
Uri uri = arguments.getParcelable(DATA_URI);
|
||||
if (uri == null) {
|
||||
Log.w(TAG, "Media URI was null.");
|
||||
Toast.makeText(requireContext(), R.string.MediaPreviewActivity_media_no_longer_available, Toast.LENGTH_LONG).show();
|
||||
requireActivity().finish();
|
||||
return itemView;
|
||||
}
|
||||
String contentType = arguments.getString(DATA_CONTENT_TYPE);
|
||||
long size = arguments.getLong(DATA_SIZE);
|
||||
boolean autoPlay = arguments.getBoolean(AUTO_PLAY);
|
||||
|
||||
Reference in New Issue
Block a user