add loading animation

This commit is contained in:
Page Asgardius 2022-09-05 10:30:17 -07:00
parent b763025105
commit a9012cbbcc
4 changed files with 29 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import android.content.Intent;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast; import android.widget.Toast;
import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentials;
@ -48,6 +49,7 @@ public class BucketSelect extends AppCompatActivity {
s3client.setS3ClientOptions(s3ClientOptions); s3client.setS3ClientOptions(s3ClientOptions);
recyclerView = findViewById(R.id.blist); recyclerView = findViewById(R.id.blist);
final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
// layout for vertical orientation // layout for vertical orientation
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext()); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
@ -79,6 +81,7 @@ public class BucketSelect extends AppCompatActivity {
public void run() { public void run() {
// Sending reference and data to Adapter // Sending reference and data to Adapter
Adapter adapter = new Adapter(BucketSelect.this, Img, Name); Adapter adapter = new Adapter(BucketSelect.this, Img, Name);
simpleProgressBar.setVisibility(View.INVISIBLE);
// Setting Adapter to RecyclerView // Setting Adapter to RecyclerView
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);

View file

@ -9,6 +9,7 @@ import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast; import android.widget.Toast;
import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentials;
@ -60,6 +61,7 @@ public class ObjectSelect extends AppCompatActivity {
s3client.setS3ClientOptions(s3ClientOptions); s3client.setS3ClientOptions(s3ClientOptions);
recyclerView = findViewById(R.id.olist); recyclerView = findViewById(R.id.olist);
final ProgressBar simpleProgressBar = (ProgressBar) findViewById(R.id.simpleProgressBar);
// layout for vertical orientation // layout for vertical orientation
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext()); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
@ -146,6 +148,7 @@ public class ObjectSelect extends AppCompatActivity {
public void run() { public void run() {
// Sending reference and data to Adapter // Sending reference and data to Adapter
Adapter adapter = new Adapter(ObjectSelect.this, Img, Name); Adapter adapter = new Adapter(ObjectSelect.this, Img, Name);
simpleProgressBar.setVisibility(View.INVISIBLE);
// Setting Adapter to RecyclerView // Setting Adapter to RecyclerView
recyclerView.setAdapter(adapter); recyclerView.setAdapter(adapter);

View file

@ -14,4 +14,16 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="-27dp" /> tools:layout_editor_absoluteX="-27dp" />
<ProgressBar
android:id="@+id/simpleProgressBar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:max="100"
android:progress="50"
android:background="@color/design_default_color_background"
android:padding="20dp"
tools:ignore="MissingConstraints"
android:indeterminate="true" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -15,4 +15,15 @@
app:layout_constraintVertical_bias="0.0" app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="-27dp" /> tools:layout_editor_absoluteX="-27dp" />
<ProgressBar
android:id="@+id/simpleProgressBar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:max="100"
android:progress="50"
android:background="@color/design_default_color_background"
android:padding="20dp"
tools:ignore="MissingConstraints"
android:indeterminate="true" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>