Skip to content

Commit

Permalink
Show dialog saving
Browse files Browse the repository at this point in the history
  • Loading branch information
tranleduy2000 committed Jun 5, 2018
1 parent f1f9073 commit ee152e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.duy.ide.core;

import android.Manifest;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
Expand Down Expand Up @@ -523,15 +524,22 @@ protected String[] getSupportedFileExtensions() {
}

public void saveAll(final int requestCode) {
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle(R.string.saving);
dialog.setCanceledOnTouchOutside(false);
dialog.setCancelable(false);
dialog.show();
SaveAllTask saveAllTask = new SaveAllTask(this, new SaveListener() {
@Override
public void onSavedSuccess() {
onSaveComplete(requestCode);
dialog.cancel();
}

@Override
public void onSaveFailed(Exception e) {
UIUtils.alert(SimpleEditorActivity.this, e.getMessage());
dialog.cancel();
}
});
saveAllTask.execute();
Expand Down
1 change: 1 addition & 0 deletions libeditor/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -231,5 +231,6 @@
<string name="format_source">Format source</string>
<string name="formated_source">Source is formatted</string>
<string name="select">Select</string>
<string name="saving">Saving</string>

</resources>

0 comments on commit ee152e9

Please sign in to comment.