Skip to content

Commit

Permalink
Merge pull request #12474 from nextcloud/fix/comments_loading
Browse files Browse the repository at this point in the history
Fix comments loading and screenshot test
  • Loading branch information
AndyScherzinger committed Feb 12, 2024
2 parents 7240b06 + 5a92916 commit 734002e
Show file tree
Hide file tree
Showing 38 changed files with 26 additions and 19 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public void testAccountChooserDialog() throws AccountUtils.AccountNotFoundExcept
accountManager.setUserData(newAccount, AccountUtils.Constants.KEY_USER_ID, "test");
accountManager.setAuthToken(newAccount, AccountTypeUtils.getAuthTokenTypePass(newAccount.type), "password");
User newUser = userAccountManager.getUser(newAccount.name).orElseThrow(RuntimeException::new);
userAccountManager.setCurrentOwnCloudAccount(newAccount.name);

Account newAccount2 = new Account("[email protected]", MainApp.getAccountType(targetContext));
accountManager.addAccountExplicitly(newAccount2, "password", null);
Expand Down
4 changes: 2 additions & 2 deletions app/src/debug/java/com/nextcloud/test/TestActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ class TestActivity :
TODO("Not yet implemented")
}

override fun getFileUploaderHelper(): FileUploadHelper? {
return null
override fun getFileUploaderHelper(): FileUploadHelper {
return FileUploadHelper.instance()
}

override fun getFileDownloadProgressListener(): FileDownloadWorker.FileDownloadProgressListener? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1921,28 +1921,29 @@ public void startSyncFolderOperation(final OCFile folder, final boolean ignoreET
// the execution is slightly delayed to allow the activity get the window focus if it's being started
// or if the method is called from a dialog that is being dismissed
if (TextUtils.isEmpty(searchQuery) && getUser().isPresent()) {
getHandler().postDelayed(new Runnable() {
@Override
public void run() {
if (ignoreFocus || hasWindowFocus()) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
getHandler().postDelayed(() -> {
Optional<User> user = getUser();

// perform folder synchronization
RemoteOperation synchFolderOp = new RefreshFolderOperation(folder, currentSyncTime, false, ignoreETag, getStorageManager(), getUser().orElseThrow(RuntimeException::new), getApplicationContext());
synchFolderOp.execute(getAccount(), MainApp.getAppContext(), FileDisplayActivity.this, null, null);
if (!ignoreFocus && !hasWindowFocus() || !user.isPresent()) {
// do not refresh if the user rotates the device while another window has focus
// or if the current user is no longer valid
return;
}

OCFileListFragment fragment = getListOfFilesFragment();
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;

if (fragment != null && !(fragment instanceof GalleryFragment)) {
fragment.setLoading(true);
}
// perform folder synchronization
RemoteOperation refreshFolderOperation = new RefreshFolderOperation(folder, currentSyncTime, false, ignoreETag, getStorageManager(), user.get(), getApplicationContext());
refreshFolderOperation.execute(getAccount(), MainApp.getAppContext(), FileDisplayActivity.this, null, null);

setBackgroundText();
OCFileListFragment fragment = getListOfFilesFragment();

} // else: NOTHING ; lets' not refresh when the user rotates the device but there is
// another window floating over
if (fragment != null && !(fragment instanceof GalleryFragment)) {
fragment.setLoading(true);
}

setBackgroundText();
}, DELAY_TO_REQUEST_REFRESH_OPERATION_LATER);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
viewThemeUtils.androidx.themeSwipeRefreshLayout(binding.swipeContainingEmpty);
viewThemeUtils.androidx.themeSwipeRefreshLayout(binding.swipeContainingList);

isLoadingActivities = true;
fetchAndSetData(-1);

binding.swipeContainingList.setOnRefreshListener(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@ public void refreshCapabilitiesFromDB() {
* before reading database.
*/
public void refreshSharesFromDB() {
file = fileDataStorageManager.getFileById(file.getFileId());
OCFile newFile = fileDataStorageManager.getFileById(file.getFileId());
if (newFile != null) {
file = newFile;
}

ShareeListAdapter adapter = (ShareeListAdapter) binding.sharesList.getAdapter();

if (adapter == null) {
Expand Down

0 comments on commit 734002e

Please sign in to comment.