Commit 313282b8 authored by Mathilde BALLOUHEY's avatar Mathilde BALLOUHEY
Browse files

Ajout chargement favoris

parent 5385b8e3
Pipeline #23367 failed with stages
in 2 minutes and 43 seconds
...@@ -7,6 +7,7 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -7,6 +7,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.AsyncTask; import android.os.AsyncTask;
...@@ -45,6 +46,8 @@ public class HomeActivity extends AppCompatActivity { ...@@ -45,6 +46,8 @@ public class HomeActivity extends AppCompatActivity {
RadioButton rdbtn_home_bySystem, rdbtn_home_byClass; RadioButton rdbtn_home_bySystem, rdbtn_home_byClass;
RecyclerView rclr_home_favourites; RecyclerView rclr_home_favourites;
private ListResultsAdapter m_adapter; private ListResultsAdapter m_adapter;
private static ProgressDialog m_progressDialog;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -187,6 +190,11 @@ public class HomeActivity extends AppCompatActivity { ...@@ -187,6 +190,11 @@ public class HomeActivity extends AppCompatActivity {
@Override @Override
protected void onPreExecute() { protected void onPreExecute() {
super.onPreExecute(); super.onPreExecute();
m_progressDialog = new ProgressDialog(HomeActivity.this);
m_progressDialog.setMessage("Please wait...It is downloading");
m_progressDialog.setIndeterminate(false);
m_progressDialog.setCancelable(false);
m_progressDialog.show();
m_adapter.notifyDataSetChanged(); m_adapter.notifyDataSetChanged();
rclr_home_favourites.setEnabled(false); rclr_home_favourites.setEnabled(false);
} }
...@@ -202,6 +210,7 @@ public class HomeActivity extends AppCompatActivity { ...@@ -202,6 +210,7 @@ public class HomeActivity extends AppCompatActivity {
super.onPostExecute(nullable); super.onPostExecute(nullable);
m_adapter.notifyDataSetChanged(); m_adapter.notifyDataSetChanged();
rclr_home_favourites.setEnabled(true); rclr_home_favourites.setEnabled(true);
m_progressDialog.hide();
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment