Skip to content

Commit

Permalink
Snackbar for loading message, use back hint for indicating file empty
Browse files Browse the repository at this point in the history
  • Loading branch information
TranceLove committed Mar 8, 2018
1 parent a02feb4 commit 4c8ed44
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.text.Editable;
import android.text.Spanned;
import android.text.TextWatcher;
Expand Down Expand Up @@ -285,8 +286,7 @@ private void saveFile(final String editTextString) {
* on a worker thread
*/
private void load() {
Toast.makeText(getApplicationContext(), R.string.loading, Toast.LENGTH_SHORT).show();
//mInput.setHint();
Snackbar.make(scrollView, R.string.loading, Snackbar.LENGTH_SHORT).show();

new ReadFileTask(getContentResolver(), mFile, getExternalCacheDir(), (data) -> {
switch (data.error) {
Expand All @@ -297,7 +297,7 @@ private void load() {
try {
mInput.setText(data.fileContents);
if (data.fileContents.isEmpty()) {
Toast.makeText(getApplicationContext(), R.string.file_empty, Toast.LENGTH_SHORT).show();
mInput.setHint(R.string.file_empty);
} else {
mInput.setHint(null);
}
Expand Down

0 comments on commit 4c8ed44

Please sign in to comment.