From d6f77e2491beb3b4440b1ee4eb2c1740114be84b Mon Sep 17 00:00:00 2001 From: ZetaTom <70907959+ZetaTom@users.noreply.github.com> Date: Wed, 29 Nov 2023 09:15:15 +0100 Subject: [PATCH 1/2] Use custom quota exceeded error message Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com> --- .../main/java/com/owncloud/android/db/UploadResult.java | 7 ++++++- .../com/owncloud/android/ui/adapter/UploadListAdapter.java | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/owncloud/android/db/UploadResult.java b/app/src/main/java/com/owncloud/android/db/UploadResult.java index 34a6d99d02..17533f0413 100644 --- a/app/src/main/java/com/owncloud/android/db/UploadResult.java +++ b/app/src/main/java/com/owncloud/android/db/UploadResult.java @@ -44,7 +44,8 @@ public enum UploadResult { OLD_ANDROID_API(18), SYNC_CONFLICT(19), CANNOT_CREATE_FILE(20), - LOCAL_STORAGE_NOT_COPIED(21); + LOCAL_STORAGE_NOT_COPIED(21), + QUOTA_EXCEEDED(22); private final int value; @@ -104,6 +105,8 @@ public enum UploadResult { return CANNOT_CREATE_FILE; case 21: return LOCAL_STORAGE_NOT_COPIED; + case 22: + return QUOTA_EXCEEDED; } return UNKNOWN; } @@ -162,6 +165,8 @@ public enum UploadResult { return VIRUS_DETECTED; case CANNOT_CREATE_FILE: return CANNOT_CREATE_FILE; + case QUOTA_EXCEEDED: + return QUOTA_EXCEEDED; default: return UNKNOWN; } diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java index 821d44ac3c..9d0f1b74ce 100755 --- a/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/UploadListAdapter.java @@ -711,6 +711,9 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter Date: Wed, 6 Dec 2023 10:22:44 +0100 Subject: [PATCH 2/2] check the right var for null Signed-off-by: Andy Scherzinger --- .../com/owncloud/android/ui/fragment/ExtendedListFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java index c7260043e8..fb825925b3 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -467,7 +467,7 @@ public class ExtendedListFragment extends Fragment implements private void scrollToPosition(int position) { LinearLayoutManager linearLayoutManager = (LinearLayoutManager) mRecyclerView.getLayoutManager(); - if (mRecyclerView != null) { + if (linearLayoutManager != null) { int visibleItemCount = linearLayoutManager.findLastCompletelyVisibleItemPosition() - linearLayoutManager.findFirstCompletelyVisibleItemPosition(); linearLayoutManager.scrollToPositionWithOffset(position, (visibleItemCount / 2) * mHeightCell);