From 067d5236db703c2e87db4f51daa54b505c63d758 Mon Sep 17 00:00:00 2001 From: A117870935 Date: Tue, 2 Apr 2024 18:35:03 +0530 Subject: [PATCH] Filtering only folders and showing them as per NMC-2893 Task --- .../java/com/nextcloud/client/media/NextcloudExoPlayer.kt | 4 +++- .../java/com/owncloud/android/media/MediaControlView.java | 8 ++++++-- .../android/ui/activity/ReceiveExternalFilesActivity.java | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/client/media/NextcloudExoPlayer.kt b/app/src/main/java/com/nextcloud/client/media/NextcloudExoPlayer.kt index 02b86ecdc5f0..05ca178f2ba6 100644 --- a/app/src/main/java/com/nextcloud/client/media/NextcloudExoPlayer.kt +++ b/app/src/main/java/com/nextcloud/client/media/NextcloudExoPlayer.kt @@ -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() } } diff --git a/app/src/main/java/com/owncloud/android/media/MediaControlView.java b/app/src/main/java/com/owncloud/android/media/MediaControlView.java index 898b2200b1bf..0ef44d5f9a16 100644 --- a/app/src/main/java/com/owncloud/android/media/MediaControlView.java +++ b/app/src/main/java/com/owncloud/android/media/MediaControlView.java @@ -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; @@ -276,7 +278,8 @@ 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 @@ -284,7 +287,8 @@ public void onClick(View v) { 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 diff --git a/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java index d06709242a5a..355bcc56a09d 100755 --- a/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java @@ -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; @@ -733,6 +734,10 @@ private void populateDirectoryList() { if (mFile != null) { List 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);