Skip to content

Commit 2b0a003

Browse files
Showing dialog on Apk generation
1 parent f8d3b66 commit 2b0a003

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/TemplateEditor.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,28 @@ public void onClick(DialogInterface dialog, int id) {
336336
mApkGenerationDialog = new MaterialDialog.Builder(TemplateEditor.this)
337337
.title(R.string.apk_progress_dialog)
338338
.content(R.string.apk_msg)
339+
.cancelable(false)
339340
.progress(true, 0)
340341
.show();
341342

342343
signer.setSignerThreadListener(new SignerThread.OnSignComplete() {
343344
@Override
344-
public void onSuccess() {
345+
public void onSuccess(final String path) {
345346
Log.d(TAG, "APK generated");
346347
mApkGenerationDialog.dismiss();
347348

349+
runOnUiThread(new Runnable() {
350+
@Override
351+
public void run() {
352+
mApkGenerationDialog = new MaterialDialog.Builder(TemplateEditor.this)
353+
.title("Apk Generated")
354+
.content("Apk file saved at " + path)
355+
.positiveText("okay")
356+
.show();
357+
}
358+
});
359+
360+
348361
}
349362

350363
@Override

source-code/app/src/main/java/org/buildmlearn/toolkit/utilities/SignerThread.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void run() {
133133
Toast.makeText(toolkit, "APK file not generated", Toast.LENGTH_SHORT).show();
134134
} else {
135135
Log.d(TAG, "Signing Complete");
136-
listener.onSuccess();
136+
listener.onSuccess(finalApk);
137137

138138
if (toolkit.isExternalStorageAvailable()) {
139139
showNotification("APK file saved in Downloads folder");
@@ -176,7 +176,7 @@ private void showNotification(String description) {
176176
}
177177

178178
public interface OnSignComplete {
179-
void onSuccess();
179+
void onSuccess(String path);
180180

181181
void onFail(Exception e);
182182
}

0 commit comments

Comments
 (0)