Search in sources :

Example 1 with LoadingDialog

use of com.owncloud.android.ui.dialog.LoadingDialog in project android by owncloud.

the class AuthenticatorActivity method getOAuth2AccessTokenFromCapturedRedirection.

/**
     * Parses the redirection with the response to the GET AUTHORIZATION request to the 
     * oAuth server and requests for the access token (GET ACCESS TOKEN)
     */
private void getOAuth2AccessTokenFromCapturedRedirection() {
    /// Parse data from OAuth redirection
    String queryParameters = mNewCapturedUriFromOAuth2Redirection.getQuery();
    mNewCapturedUriFromOAuth2Redirection = null;
    /// Showing the dialog with instructions for the user.
    LoadingDialog dialog = LoadingDialog.newInstance(R.string.auth_getting_authorization, true);
    dialog.show(getSupportFragmentManager(), WAIT_DIALOG_TAG);
    /// GET ACCESS TOKEN to the oAuth server
    Intent getServerInfoIntent = new Intent();
    getServerInfoIntent.setAction(OperationsService.ACTION_OAUTH2_GET_ACCESS_TOKEN);
    getServerInfoIntent.putExtra(OperationsService.EXTRA_SERVER_URL, mOAuthTokenEndpointText.getText().toString().trim());
    getServerInfoIntent.putExtra(OperationsService.EXTRA_OAUTH2_QUERY_PARAMETERS, queryParameters);
    if (mOperationsServiceBinder != null) {
        //Log_OC.e(TAG, "getting access token..." );
        mWaitingForOpId = mOperationsServiceBinder.queueNewOperation(getServerInfoIntent);
    }
}
Also used : Intent(android.content.Intent) LoadingDialog(com.owncloud.android.ui.dialog.LoadingDialog)

Example 2 with LoadingDialog

use of com.owncloud.android.ui.dialog.LoadingDialog in project android by owncloud.

the class FileActivity method dismissLoadingDialog.

/**
     * Dismiss loading dialog
     */
public void dismissLoadingDialog() {
    Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
    if (frag != null) {
        Log_OC.d(TAG, "dismiss loading dialog");
        LoadingDialog loading = (LoadingDialog) frag;
        loading.dismiss();
    }
}
Also used : LoadingDialog(com.owncloud.android.ui.dialog.LoadingDialog) ConfirmationDialogFragment(com.owncloud.android.ui.dialog.ConfirmationDialogFragment) Fragment(android.support.v4.app.Fragment)

Example 3 with LoadingDialog

use of com.owncloud.android.ui.dialog.LoadingDialog in project android by owncloud.

the class FileActivity method showLoadingDialog.

/**
     * Show loading dialog
     */
public void showLoadingDialog(int messageId) {
    // grant that only one waiting dialog is shown
    dismissLoadingDialog();
    // Construct dialog
    Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
    if (frag == null) {
        Log_OC.d(TAG, "show loading dialog");
        LoadingDialog loading = LoadingDialog.newInstance(messageId, false);
        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        loading.show(ft, DIALOG_WAIT_TAG);
        fm.executePendingTransactions();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) LoadingDialog(com.owncloud.android.ui.dialog.LoadingDialog) ConfirmationDialogFragment(com.owncloud.android.ui.dialog.ConfirmationDialogFragment) Fragment(android.support.v4.app.Fragment)

Example 4 with LoadingDialog

use of com.owncloud.android.ui.dialog.LoadingDialog in project android by owncloud.

the class LogHistoryActivity method showLoadingDialog.

/**
     * Show loading dialog
     */
public void showLoadingDialog() {
    // Construct dialog
    LoadingDialog loading = LoadingDialog.newInstance(R.string.log_progress_dialog_text, false);
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    loading.show(ft, DIALOG_WAIT_TAG);
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) LoadingDialog(com.owncloud.android.ui.dialog.LoadingDialog)

Example 5 with LoadingDialog

use of com.owncloud.android.ui.dialog.LoadingDialog in project android by nextcloud.

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.dismissAllowingStateLoss();
    }
}
Also used : LoadingDialog(com.owncloud.android.ui.dialog.LoadingDialog) Fragment(android.support.v4.app.Fragment)

Aggregations

LoadingDialog (com.owncloud.android.ui.dialog.LoadingDialog)13 Fragment (android.support.v4.app.Fragment)4 Fragment (androidx.fragment.app.Fragment)4 ConfirmationDialogFragment (com.owncloud.android.ui.dialog.ConfirmationDialogFragment)4 FragmentManager (android.support.v4.app.FragmentManager)3 FragmentTransaction (android.support.v4.app.FragmentTransaction)3 DialogFragment (androidx.fragment.app.DialogFragment)2 FragmentManager (androidx.fragment.app.FragmentManager)2 FragmentTransaction (androidx.fragment.app.FragmentTransaction)2 OwnCloudCredentials (com.owncloud.android.lib.common.OwnCloudCredentials)2 FileDetailFragment (com.owncloud.android.ui.fragment.FileDetailFragment)2 FileDetailSharingFragment (com.owncloud.android.ui.fragment.FileDetailSharingFragment)2 Intent (android.content.Intent)1 Map (java.util.Map)1