Skip to content

Commit

Permalink
Fixed issue Swati4star#351
Browse files Browse the repository at this point in the history
reset everything to initial stage after pdf creation.
  • Loading branch information
vyankatesh24 committed Aug 7, 2018
1 parent beed200 commit 3a4c98f
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,20 @@ public void onItemClick(String path) {

}

/**
* resets fragment to initial stage
*/
private void reset() {
firstFilePath = "";
secondFilePath = "";
addFileOne.setText(R.string.file_one);
addFileTwo.setText(R.string.file_two);
addFileTwo.setBackgroundColor(getResources().getColor(R.color.colorGray));
addFileOne.setBackgroundColor(getResources().getColor(R.color.colorGray));
mMorphButtonUtility.morphToGrey(mergeBtn, mMorphButtonUtility.integer());
mergeBtn.setEnabled(false);
}

@SuppressLint("StaticFieldLeak")
private class MergePdf extends AsyncTask<String, Void, Void> {

Expand Down Expand Up @@ -402,6 +416,7 @@ protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
mAnimationView.cancelAnimation();
mMaterialDialog.dismiss();
reset();
Snackbar.make(Objects.requireNonNull(mActivity).findViewById(android.R.id.content),
R.string.pdf_merged, Snackbar.LENGTH_LONG).setAction(R.string.snackbar_viewAction, v -> {
FileUtils fileUtils = new FileUtils(mActivity);
Expand Down

0 comments on commit 3a4c98f

Please sign in to comment.