diff --git a/app/src/main/java/com/sjapps/jsonlist/MainActivity.java b/app/src/main/java/com/sjapps/jsonlist/MainActivity.java index 39a1cae..6d28ad7 100644 --- a/app/src/main/java/com/sjapps/jsonlist/MainActivity.java +++ b/app/src/main/java/com/sjapps/jsonlist/MainActivity.java @@ -308,7 +308,6 @@ void ReadFile(Uri uri){ return; } handler.post(() -> { - loadingFinished(false); LoadData(Data); }); @@ -327,9 +326,11 @@ void loadingStarted(String txt){ progressBar.setIndeterminate(true); text.setText(txt); handler.postDelayed(() -> { - setAnimation(this,progressView,R.anim.scale_in); - text.setVisibility(View.VISIBLE); - progressView.setVisibility(View.VISIBLE); + if (progressView.getVisibility() != View.VISIBLE) { + setAnimation(this, progressView, R.anim.scale_in); + text.setVisibility(View.VISIBLE); + progressView.setVisibility(View.VISIBLE); + } },300); } @@ -341,8 +342,10 @@ public void updateProgress(int val){ void loadingFinished(boolean isFinished){ if (!isFinished){ - setAnimation(this, progressView,R.anim.scale_out); - progressView.setVisibility(View.INVISIBLE); + handler.postDelayed(()-> { + setAnimation(this, progressView,R.anim.scale_out); + progressView.setVisibility(View.INVISIBLE); + },300); return; }