Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comments loading and screenshot test #12474

Merged
merged 8 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading