mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
Fix: Loading icon is there when coming back to the app
This commit is contained in:
parent
d5c6450989
commit
a9bfb401d5
4 changed files with 13 additions and 3 deletions
|
@ -388,13 +388,20 @@ public class OperationsService extends Service {
|
|||
}
|
||||
}
|
||||
|
||||
public void dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
|
||||
public boolean dispatchResultIfFinished(int operationId, OnRemoteOperationListener listener) {
|
||||
Pair<RemoteOperation, RemoteOperationResult> undispatched =
|
||||
mUndispatchedFinishedOperations.remove(operationId);
|
||||
if (undispatched != null) {
|
||||
listener.onRemoteOperationFinish(undispatched.first, undispatched.second);
|
||||
return true;
|
||||
//Log_OC.wtf(TAG, "Sending callback later");
|
||||
} else {
|
||||
if (!mPendingOperations.isEmpty()) {
|
||||
nextOperation();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
//Log_OC.wtf(TAG, "Not finished yet");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -540,7 +540,10 @@ implements OnRemoteOperationListener, ComponentsGetter {
|
|||
mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler);
|
||||
long waitingForOpId = mFileOperationsHelper.getOpIdWaitingFor();
|
||||
if (waitingForOpId <= Integer.MAX_VALUE) {
|
||||
mOperationsServiceBinder.dispatchResultIfFinished((int)waitingForOpId, this);
|
||||
boolean wait = mOperationsServiceBinder.dispatchResultIfFinished((int)waitingForOpId, this);
|
||||
if (!wait ) {
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -711,6 +711,7 @@ FileFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener
|
|||
mDownloadFinishReceiver = null;
|
||||
}
|
||||
|
||||
|
||||
Log_OC.d(TAG, "onPause() end");
|
||||
super.onPause();
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ import android.widget.TextView;
|
|||
import com.actionbarsherlock.app.SherlockDialogFragment;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
import com.owncloud.android.files.FileOperationsHelper;
|
||||
import com.owncloud.android.ui.activity.ComponentsGetter;
|
||||
import com.owncloud.android.ui.activity.CopyToClipboardActivity;
|
||||
import com.owncloud.android.ui.activity.FileActivity;
|
||||
|
|
Loading…
Reference in a new issue