use of com.owncloud.android.ui.dialog.LoadingDialog in project android by owncloud.
the class AuthenticatorActivity method onGetOAuthAccessTokenFinish.
/**
* Processes the result of the request for and access token send
* to an OAuth authorization server.
*
* @param result Result of the operation.
*/
private void onGetOAuthAccessTokenFinish(RemoteOperationResult result) {
mWaitingForOpId = Long.MAX_VALUE;
dismissDialog(WAIT_DIALOG_TAG);
if (result.isSuccess()) {
/// be gentle with the user
LoadingDialog dialog = LoadingDialog.newInstance(R.string.auth_trying_to_login, true);
dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);
/// time to test the retrieved access token on the ownCloud server
@SuppressWarnings("unchecked") Map<String, String> tokens = (Map<String, String>) (result.getData().get(0));
mAuthToken = tokens.get(OAuth2Constants.KEY_ACCESS_TOKEN);
Log_OC.d(TAG, "Got ACCESS TOKEN: " + mAuthToken);
/// validate token accessing to root folder / getting session
OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBearerCredentials(mAuthToken);
accessRootFolder(credentials);
} else {
updateAuthStatusIconAndText(result);
showAuthStatus();
Log_OC.d(TAG, "Access failed: " + result.getLogMessage());
}
}
use of com.owncloud.android.ui.dialog.LoadingDialog in project android by owncloud.
the class LogHistoryActivity method dismissLoadingDialog.
/**
* Dismiss loading dialog
*/
public void dismissLoadingDialog() {
Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
if (frag != null) {
LoadingDialog loading = (LoadingDialog) frag;
loading.dismiss();
}
}
Aggregations