Skip to content

Commit

Permalink
loading animation update
Browse files Browse the repository at this point in the history
  • Loading branch information
SlaVcE14 committed Dec 20, 2023
1 parent c2d160d commit 8b663ef
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/src/main/java/com/sjapps/jsonlist/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ void ReadFile(Uri uri){
return;
}
handler.post(() -> {
loadingFinished(false);
LoadData(Data);
});

Expand All @@ -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);

}
Expand All @@ -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;
}

Expand Down

0 comments on commit 8b663ef

Please sign in to comment.