From 964b2215c85eff7338ecf1d0c8f9662edc01102c Mon Sep 17 00:00:00 2001 From: alperozturk Date: Wed, 21 Feb 2024 11:23:02 +0100 Subject: [PATCH 01/12] Remove previousSortGroupState usage Signed-off-by: alperozturk --- .../ui/activity/FileDisplayActivity.java | 39 +++---------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java index 3e55bbdea3..d2f18f02d2 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -240,7 +240,6 @@ public class FileDisplayActivity extends FileActivity private PlayerServiceConnection mPlayerConnection; private Optional lastDisplayedUser = Optional.empty(); private int menuItemId = -1; - private Stack previousSortGroupState; @Inject AppPreferences preferences; @Inject AppInfo appInfo; @@ -293,14 +292,12 @@ public class FileDisplayActivity extends FileActivity @SuppressWarnings("unchecked") private void loadSavedInstanceState(Bundle savedInstanceState) { if (savedInstanceState != null) { - previousSortGroupState = BundleExtensionsKt.getSerializableArgument(savedInstanceState, KEY_SORT_GROUP_STATE, Stack.class); mWaitingToPreview = BundleExtensionsKt.getParcelableArgument(savedInstanceState, KEY_WAITING_TO_PREVIEW, OCFile.class); mSyncInProgress = savedInstanceState.getBoolean(KEY_SYNC_IN_PROGRESS); mWaitingToSend = BundleExtensionsKt.getParcelableArgument(savedInstanceState, KEY_WAITING_TO_SEND, OCFile.class); searchQuery = savedInstanceState.getString(KEY_SEARCH_QUERY); searchOpen = savedInstanceState.getBoolean(FileDisplayActivity.KEY_IS_SEARCH_OPEN, false); } else { - previousSortGroupState = new Stack<>(); mWaitingToPreview = null; mSyncInProgress = false; mWaitingToSend = null; @@ -613,7 +610,7 @@ public class FileDisplayActivity extends FileActivity //clear the subtitle while navigating to any other screen from Media screen clearToolbarSubtitle(); - setSortListGroup(sortListGroupVisibility(), showSortListGroup); + showSortListGroup(showSortListGroup); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.addToBackStack(null); @@ -1030,7 +1027,7 @@ public class FileDisplayActivity extends FileActivity setDrawerIndicatorEnabled(isDrawerIndicatorAvailable()); } if (leftFragment instanceof UnifiedSearchFragment) { - popSortListGroupVisibility(); + showSortListGroup(false); super.onBackPressed(); } } @@ -1039,13 +1036,12 @@ public class FileDisplayActivity extends FileActivity /** * Use this method when want to pop the fragment on back press. It resets Scrolling (See * {@link #resetScrolling(boolean) with true} and pop the visibility for sortListGroup (See - * {@link #setSortListGroup(boolean, boolean)}. At last call to super.onBackPressed() + * {@link #showSortListGroup(boolean) with false}. At last call to super.onBackPressed() */ private void popBack() { - // pop back fragment binding.fabMain.setImageResource(R.drawable.ic_plus); resetScrolling(true); - popSortListGroupVisibility(); + showSortListGroup(false); super.onBackPressed(); } @@ -1057,14 +1053,13 @@ public class FileDisplayActivity extends FileActivity super.onSaveInstanceState(outState); outState.putParcelable(FileDisplayActivity.KEY_WAITING_TO_PREVIEW, mWaitingToPreview); outState.putBoolean(FileDisplayActivity.KEY_SYNC_IN_PROGRESS, mSyncInProgress); - //outState.putBoolean(FileDisplayActivity.KEY_REFRESH_SHARES_IN_PROGRESS, + // outState.putBoolean(FileDisplayActivity.KEY_REFRESH_SHARES_IN_PROGRESS, // mRefreshSharesInProgress); outState.putParcelable(FileDisplayActivity.KEY_WAITING_TO_SEND, mWaitingToSend); if (searchView != null) { outState.putBoolean(KEY_IS_SEARCH_OPEN, !searchView.isIconified()); } outState.putString(KEY_SEARCH_QUERY, searchQuery); - outState.putSerializable(KEY_SORT_GROUP_STATE, previousSortGroupState); outState.putBoolean(KEY_IS_SORT_GROUP_VISIBLE, sortListGroupVisibility()); Log_OC.v(TAG, "onSaveInstanceState() end"); } @@ -2470,28 +2465,4 @@ public class FileDisplayActivity extends FileActivity listOfFiles.onItemClicked(selectedFile); } } - - /** - * Use this method to set the visibility of SortListGroup while going to another fragment/view (which needs - * different visibility) It internally sets the visibility as well as save the previous one in the stack so that on - * going back it pops out the correct visibility. Also see {@link #popSortListGroupVisibility()} - */ - private void setSortListGroup(boolean currentListGroupVisibility, boolean show) { - previousSortGroupState.push(currentListGroupVisibility); - showSortListGroup(show); - } - - /** - * Use this method to set the visibility of SortListGroup when coming back from a view/fragment (which changed the - * visibility earlier using {@link #setSortListGroup(boolean, boolean)} - */ - private void popSortListGroupVisibility() { - showSortListGroup(false); - - if (previousSortGroupState.isEmpty()) { - return; - } - - previousSortGroupState.pop(); - } } From c3c8c3b5dde0a5a03b36459dd732b3e7f65c204a Mon Sep 17 00:00:00 2001 From: alperozturk Date: Wed, 21 Feb 2024 11:26:00 +0100 Subject: [PATCH 02/12] Remove previousSortGroupState usage Signed-off-by: alperozturk --- .../com/owncloud/android/ui/activity/FileDisplayActivity.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java index d2f18f02d2..4f72a9387b 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -183,7 +183,6 @@ public class FileDisplayActivity extends FileActivity public static final int SINGLE_USER_SIZE = 1; public static final String OPEN_FILE = "NC_OPEN_FILE"; - private FilesBinding binding; private SyncBroadcastReceiver mSyncBroadcastReceiver; @@ -197,10 +196,8 @@ public class FileDisplayActivity extends FileActivity public static final String KEY_FILE_ID = "KEY_FILE_ID"; public static final String KEY_FILE_PATH = "KEY_FILE_PATH"; public static final String KEY_ACCOUNT = "KEY_ACCOUNT"; - public static final String KEY_SORT_GROUP_STATE = "KEY_SORT_GROUP_STATE"; public static final String KEY_IS_SORT_GROUP_VISIBLE = "KEY_IS_SORT_GROUP_VISIBLE"; - private static final String KEY_WAITING_TO_PREVIEW = "WAITING_TO_PREVIEW"; private static final String KEY_SYNC_IN_PROGRESS = "SYNC_IN_PROGRESS"; private static final String KEY_WAITING_TO_SEND = "WAITING_TO_SEND"; From afd6205b0d1cdd580319541714ac17a6878e695b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 Feb 2024 15:12:47 +0000 Subject: [PATCH 03/12] Update dependency me.zhanghai.android.fastscroll:library to v1.3.0 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 8b4e5956d5..5cde6b5d52 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -314,7 +314,7 @@ dependencies { implementation "androidx.media3:media3-exoplayer:1.2.1" implementation "androidx.media3:media3-datasource-okhttp:1.2.1" - implementation 'me.zhanghai.android.fastscroll:library:1.2.0' + implementation 'me.zhanghai.android.fastscroll:library:1.3.0' // Shimmer animation implementation 'io.github.elye:loaderviewlibrary:3.0.0' From 2165ffda6bfb1129596a9e7bb79ce23ff609e37c Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Sun, 4 Feb 2024 17:15:14 +0100 Subject: [PATCH 04/12] Add dependency meta data Signed-off-by: Andy Scherzinger --- gradle/verification-metadata.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 4a545a2a43..97a128f4f9 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -32,7 +32,10 @@ - + + + + @@ -1924,6 +1927,14 @@ + + + + + + + + From caaa27b4664d1f932f46681fd65a1a42e5072d2e Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 23 Feb 2024 08:44:22 +0100 Subject: [PATCH 05/12] changes for new lib Signed-off-by: tobiasKaminsky --- .../java/com/owncloud/android/ui/adapter/GalleryAdapter.kt | 3 ++- .../com/owncloud/android/ui/adapter/OCFileListAdapter.java | 2 +- .../android/ui/fragment/util/GalleryFastScrollViewHelper.kt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/GalleryAdapter.kt b/app/src/main/java/com/owncloud/android/ui/adapter/GalleryAdapter.kt index 3260c6cc7c..64c04aea35 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/GalleryAdapter.kt +++ b/app/src/main/java/com/owncloud/android/ui/adapter/GalleryAdapter.kt @@ -29,6 +29,7 @@ import android.content.Context import android.os.Handler import android.os.Looper import android.view.LayoutInflater +import android.view.View import android.view.ViewGroup import androidx.annotation.VisibleForTesting import com.afollestad.sectionedrecyclerview.SectionedRecyclerViewAdapter @@ -130,7 +131,7 @@ class GalleryAdapter( return files.size } - override fun getPopupText(position: Int): String { + override fun getPopupText(p0: View, position: Int): CharSequence { return DisplayUtils.getDateByPattern( files[getRelativePosition(position).section()].date, context, diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java index a7165f3cf8..235d363f31 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java @@ -1111,7 +1111,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter Date: Sun, 25 Feb 2024 09:57:39 +0000 Subject: [PATCH 06/12] Update dependency io.coil-kt:coil to v2.6.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 8b4e5956d5..f9a6ae7427 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -399,7 +399,7 @@ dependencies { ksp "androidx.room:room-compiler:$roomVersion" androidTestImplementation "androidx.room:room-testing:$roomVersion" - implementation "io.coil-kt:coil:2.5.0" + implementation "io.coil-kt:coil:2.6.0" // splash screen dependency ref: https://developer.android.com/develop/ui/views/launch/splash-screen/migrate implementation 'androidx.core:core-splashscreen:1.0.1' From 5d3b01cba2722e3c9663a12baaae4ae24a81b75d Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 26 Feb 2024 12:05:53 +0100 Subject: [PATCH 07/12] Update to latest library commit Signed-off-by: tobiasKaminsky --- scripts/updateLibraryHash.sh | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 scripts/updateLibraryHash.sh diff --git a/scripts/updateLibraryHash.sh b/scripts/updateLibraryHash.sh new file mode 100644 index 0000000000..c382ceca15 --- /dev/null +++ b/scripts/updateLibraryHash.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Nextcloud Android client application +# +# @author Tobias Kaminsky +# Copyright (C) 2024 Tobias Kaminsky +# Copyright (C) 2024 Nextcloud GmbH +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +latestCommit=$(curl -s https://api.github.com/repos/nextcloud/android-library/commits/master | jq .sha | sed s'/\"//g') +currentCommit=$(grep "androidLibraryVersion" build.gradle | cut -f2 -d'"') + +[[ $latestCommit == "$currentCommit" ]] && exit # nothing to do + +git fetch +git checkout -B update-library-"$(date +%F)" origin/master + +sed -i s"#androidLibraryVersion\ =.*#androidLibraryVersion =\"$latestCommit\"#" build.gradle +./gradlew --console=plain --dependency-verification lenient -q --write-verification-metadata sha256,pgp help + +git add build.gradle +git add gradle/verification-metadata.xml +git commit -m "Update library" +gh pr create --title "Update library $(date +%F)" --body "Update library to latest commit" From d61bfbe43290b1067be4a5ec29ce4e000c9696a7 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 26 Feb 2024 13:55:57 +0100 Subject: [PATCH 08/12] always pull Signed-off-by: tobiasKaminsky --- scripts/updateLibraryHash.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/updateLibraryHash.sh b/scripts/updateLibraryHash.sh index c382ceca15..8d69426f6e 100644 --- a/scripts/updateLibraryHash.sh +++ b/scripts/updateLibraryHash.sh @@ -23,6 +23,10 @@ latestCommit=$(curl -s https://api.github.com/repos/nextcloud/android-library/commits/master | jq .sha | sed s'/\"//g') currentCommit=$(grep "androidLibraryVersion" build.gradle | cut -f2 -d'"') +git fetch +git checkout master +git pull + [[ $latestCommit == "$currentCommit" ]] && exit # nothing to do git fetch From cf53f49d1dd55d0c60b66eecb4b72b968426472c Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 26 Feb 2024 15:51:15 +0100 Subject: [PATCH 09/12] chmod Signed-off-by: tobiasKaminsky --- scripts/updateLibraryHash.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/updateLibraryHash.sh diff --git a/scripts/updateLibraryHash.sh b/scripts/updateLibraryHash.sh old mode 100644 new mode 100755 From 06f42fdd72e0ef8afcf21e734206620918f3726a Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 26 Feb 2024 15:54:37 +0100 Subject: [PATCH 10/12] signoff Signed-off-by: tobiasKaminsky --- scripts/updateLibraryHash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/updateLibraryHash.sh b/scripts/updateLibraryHash.sh index 8d69426f6e..b96b01dad9 100755 --- a/scripts/updateLibraryHash.sh +++ b/scripts/updateLibraryHash.sh @@ -37,5 +37,5 @@ sed -i s"#androidLibraryVersion\ =.*#androidLibraryVersion =\"$latestCommit\"#" git add build.gradle git add gradle/verification-metadata.xml -git commit -m "Update library" +git commit -s -m "Update library" gh pr create --title "Update library $(date +%F)" --body "Update library to latest commit" From ef5c6dce1761d7fb8a35f62e963299e0dd680404 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:16:07 +0000 Subject: [PATCH 11/12] Update dependency com.h3xstream.findsecbugs:findsecbugs-plugin to v1.13.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index c865300c87..fe7221fd6b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -299,7 +299,7 @@ dependencies { huaweiImplementation project(':appscan') qaImplementation project(':appscan') - spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0' + spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.13.0' spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.4' implementation "com.google.dagger:dagger:$daggerVersion" From 0694bbb52d212954ade24063ff36fe7812a3ab81 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:14:16 +0000 Subject: [PATCH 12/12] Update dependency com.github.nextcloud.android-common:ui to v0.16.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- app/build.gradle | 2 +- gradle/verification-metadata.xml | 57 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index fe7221fd6b..9926d12296 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -393,7 +393,7 @@ dependencies { gplayImplementation "com.google.firebase:firebase-messaging:23.4.1" gplayImplementation 'com.google.android.play:review-ktx:2.0.1' - implementation 'com.github.nextcloud.android-common:ui:0.15.0' + implementation 'com.github.nextcloud.android-common:ui:0.16.0' implementation "androidx.room:room-runtime:$roomVersion" ksp "androidx.room:room-compiler:$roomVersion" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 97a128f4f9..74336f5356 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -170,6 +170,7 @@ + @@ -1866,6 +1867,14 @@ + + + + + + + + @@ -2052,6 +2061,14 @@ + + + + + + + + @@ -2370,6 +2387,14 @@ + + + + + + + + @@ -2439,6 +2464,14 @@ + + + + + + + + @@ -3361,6 +3394,14 @@ + + + + + + + + @@ -3385,6 +3426,14 @@ + + + + + + + + @@ -3409,6 +3458,14 @@ + + + + + + + +