Skip to content

Commit

Permalink
Filtering only folders and showing them as per NMC-2893 Task
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder-tsys committed Aug 8, 2024
1 parent 34fa843 commit dac3932
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ object NextcloudExoPlayer {
.setMediaSourceFactory(mediaSourceFactory)
.setAudioAttributes(AudioAttributes.DEFAULT, true)
.setHandleAudioBecomingNoisy(true)
.setSeekForwardIncrementMs(FIVE_SECONDS_IN_MILLIS)
// NMC-3192 Fix
.setSeekBackIncrementMs(2 * FIVE_SECONDS_IN_MILLIS)
.setSeekForwardIncrementMs(2 * FIVE_SECONDS_IN_MILLIS)
.build()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
public class MediaControlView extends LinearLayout implements OnClickListener, OnSeekBarChangeListener {
private static final String TAG = MediaControlView.class.getSimpleName();
private static final int SHOW_PROGRESS = 1;
// NMC-3192 Fix
private static final int FIVE_SECONDS_IN_MILLIS = 5000;

private MediaPlayerControl playerControl;
private final MediaControlBinding binding;
Expand Down Expand Up @@ -276,15 +278,17 @@ public void onClick(View v) {
doPauseResume();
} else if (id == R.id.rewindBtn) {
pos = playerControl.getCurrentPosition();
pos -= 5000;
// NMC-3192 Fix
pos += 2 * FIVE_SECONDS_IN_MILLIS;
playerControl.seekTo(pos);
if (!playing) {
playerControl.pause(); // necessary in some 2.3.x devices
}
setProgress();
} else if (id == R.id.forwardBtn) {
pos = playerControl.getCurrentPosition();
pos += 15000;
// NMC-3192 Fix
pos += 2 * FIVE_SECONDS_IN_MILLIS;
playerControl.seekTo(pos);
if (!playing) {
playerControl.pause(); // necessary in some 2.3.x devices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
import java.util.Calendar;
import java.util.List;
import java.util.Stack;
import java.util.stream.Collectors;

import javax.inject.Inject;

Expand Down Expand Up @@ -733,6 +734,10 @@ private void populateDirectoryList() {
if (mFile != null) {
List<OCFile> files = getStorageManager().getFolderContent(mFile, false);

// NMC-2893 Task
// Filtering and showing only files which are folder
files = files.stream().filter(OCFile::isFolder).collect(Collectors.toList());

if (files.isEmpty()) {
setMessageForEmptyList(R.string.file_list_empty_headline, R.string.empty,
R.drawable.uploads);
Expand Down

0 comments on commit dac3932

Please sign in to comment.