Merge pull request #12212 from nextcloud/fix/quota_exceeded_message_uploadlist

Use custom quota exceeded error message in UploadList
This commit is contained in:
Andy Scherzinger 2023-12-06 15:46:23 +01:00 committed by GitHub
commit 6acd893ee1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -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;
}

View file

@ -711,6 +711,9 @@ public class UploadListAdapter extends SectionedRecyclerViewAdapter<SectionedVie
case LOCAL_STORAGE_NOT_COPIED:
status = parentActivity.getString(R.string.upload_local_storage_not_copied);
break;
case QUOTA_EXCEEDED:
status = parentActivity.getString(R.string.upload_quota_exceeded);
break;
default:
status = parentActivity.getString(R.string.upload_unknown_error);
break;

View file

@ -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);