mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 16:33:39 +00:00
parent
be0ddb9756
commit
24e6605024
@ -460,11 +460,10 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
||||
View itemView = LayoutInflater.from(context).inflate(R.layout.media_view_page, container, false);
|
||||
MediaView mediaView = itemView.findViewById(R.id.media_view);
|
||||
boolean autoplay = position == autoPlayPosition;
|
||||
int cursorPosition = getCursorPosition(position);
|
||||
|
||||
autoPlayPosition = -1;
|
||||
|
||||
cursor.moveToPosition(cursorPosition);
|
||||
cursor.moveToPosition(position);
|
||||
|
||||
MediaRecord mediaRecord = MediaRecord.from(context, masterSecret, cursor);
|
||||
|
||||
@ -491,7 +490,7 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
||||
}
|
||||
|
||||
public MediaItem getMediaItemFor(int position) {
|
||||
cursor.moveToPosition(getCursorPosition(position));
|
||||
cursor.moveToPosition(position);
|
||||
MediaRecord mediaRecord = MediaRecord.from(context, masterSecret, cursor);
|
||||
Address address = mediaRecord.getAddress();
|
||||
|
||||
@ -509,10 +508,6 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
|
||||
MediaView mediaView = mediaViews.get(position);
|
||||
if (mediaView != null) mediaView.pause();
|
||||
}
|
||||
|
||||
private int getCursorPosition(int position) {
|
||||
return cursor.getCount() - 1 - position;
|
||||
}
|
||||
}
|
||||
|
||||
private static class MediaItem {
|
||||
|
@ -40,7 +40,7 @@ public class PagingMediaLoader extends AsyncLoader<Pair<Cursor, Integer>> {
|
||||
Uri attachmentUri = PartAuthority.getAttachmentDataUri(attachmentId);
|
||||
|
||||
if (attachmentUri.equals(uri)) {
|
||||
return new Pair<>(cursor, cursor.getCount() - 1 - cursor.getPosition());
|
||||
return new Pair<>(cursor, cursor.getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user