Search in sources :

Example 1 with ProgressDialogLoadingControl

use of com.trovebox.android.common.util.ProgressDialogLoadingControl in project mobile-android by photo.

the class PhotoDetailsActivity method onNewIntent.

@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    if (intent != null) {
        if (intent.getData() != null) {
            Uri uri = intent.getData();
            TwitterUtils.verifyOAuthResponse(new ProgressDialogLoadingControl(this, true, false, getString(R.string.share_twitter_verifying_authentication)), this, uri, TwitterUtils.getPhotoDetailsCallbackUrl(this), null);
        }
        getContentFragment().reinitFromIntent(intent);
    }
}
Also used : ProgressDialogLoadingControl(com.trovebox.android.common.util.ProgressDialogLoadingControl) Uri(android.net.Uri)

Example 2 with ProgressDialogLoadingControl

use of com.trovebox.android.common.util.ProgressDialogLoadingControl in project mobile-android by photo.

the class PhotoDetailsEditFragment method updatePhotoDetails.

private void updatePhotoDetails() {
    final ProgressDialogLoadingControl loadingControl = new ProgressDialogLoadingControl(getActivity(), true, false, getString(R.string.updating_photo_message));
    Runnable runOnSuccess = new Runnable() {

        @Override
        public void run() {
            // need to self dismiss on successful editing
            Dialog dialog = PhotoDetailsEditFragment.this.getDialog();
            if (dialog != null && dialog.isShowing()) {
                PhotoDetailsEditFragment.this.dismissAllowingStateLoss();
            }
        }
    };
    PhotoUtils.updatePhoto(photo, titleText.getText().toString(), descriptionText.getText().toString(), TagUtils.getTags(tagsText.getText().toString()), privateSwitch.isChecked(), runOnSuccess, loadingControl);
}
Also used : ProgressDialogLoadingControl(com.trovebox.android.common.util.ProgressDialogLoadingControl) Dialog(org.holoeverywhere.app.Dialog)

Example 3 with ProgressDialogLoadingControl

use of com.trovebox.android.common.util.ProgressDialogLoadingControl in project mobile-android by photo.

the class SyncUploadFragment method uploadSelectedFiles.

void uploadSelectedFiles(final boolean checkTwitter, final boolean checkFacebook) {
    if (checkTwitter && twitterSwitch.isEnabled() && twitterSwitch.isChecked()) {
        Runnable runnable = new Runnable() {

            @Override
            public void run() {
                currentInstance.get().uploadSelectedFiles(false, checkFacebook);
            }
        };
        TwitterUtils.runAfterTwitterAuthentication(new ProgressDialogLoadingControl(getActivity(), true, false, getString(R.string.share_twitter_requesting_authentication)), getSupportActivity(), runnable, runnable);
        return;
    }
    if (checkFacebook && facebookSwitch.isEnabled() && facebookSwitch.isChecked()) {
        Runnable runnable = new Runnable() {

            @Override
            public void run() {
                currentInstance.get().uploadSelectedFiles(checkTwitter, false);
            }
        };
        FacebookUtils.runAfterFacebookAuthentication(getSupportActivity(), MainActivity.AUTHORIZE_ACTIVITY_REQUEST_CODE, runnable, runnable);
        return;
    }
    new UploadInitTask().execute();
}
Also used : ProgressDialogLoadingControl(com.trovebox.android.common.util.ProgressDialogLoadingControl)

Example 4 with ProgressDialogLoadingControl

use of com.trovebox.android.common.util.ProgressDialogLoadingControl in project mobile-android by photo.

the class UploadActivity method onNewIntent.

@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    if (intent != null && intent.getData() != null) {
        Uri uri = intent.getData();
        TwitterUtils.verifyOAuthResponse(new ProgressDialogLoadingControl(this, true, false, getString(R.string.share_twitter_verifying_authentication)), this, uri, TwitterUtils.getUploadActivityCallbackUrl(this), null);
    }
}
Also used : ProgressDialogLoadingControl(com.trovebox.android.common.util.ProgressDialogLoadingControl) Uri(android.net.Uri)

Example 5 with ProgressDialogLoadingControl

use of com.trovebox.android.common.util.ProgressDialogLoadingControl in project mobile-android by photo.

the class AlbumCreateFragment method createAlbum.

private void createAlbum() {
    final ProgressDialogLoadingControl loadingControl = new ProgressDialogLoadingControl(getActivity(), true, false, getString(R.string.creating_album_message));
    Runnable runOnSuccess = new Runnable() {

        @Override
        public void run() {
            // need to self dismiss on successful editing
            Dialog dialog = AlbumCreateFragment.this.getDialog();
            if (dialog != null && dialog.isShowing()) {
                AlbumCreateFragment.this.dismissAllowingStateLoss();
            }
        }
    };
    AlbumUtils.createAlbum(titleText.getText().toString(), runOnSuccess, loadingControl);
}
Also used : ProgressDialogLoadingControl(com.trovebox.android.common.util.ProgressDialogLoadingControl) Dialog(org.holoeverywhere.app.Dialog)

Aggregations

ProgressDialogLoadingControl (com.trovebox.android.common.util.ProgressDialogLoadingControl)6 Uri (android.net.Uri)3 Dialog (org.holoeverywhere.app.Dialog)2 Intent (android.content.Intent)1