diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ComputeAppListTask.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ComputeAppListTask.java index 1ffab28..0346dd9 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ComputeAppListTask.java +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/ComputeAppListTask.java @@ -22,15 +22,15 @@ class ComputeAppListTask extends AsyncTask databaseManagerRef; private final WeakReference listenerRef; - order userOrderChoice; + List userOrderChoices; ComputeAppListTask(WeakReference packageManagerRef, WeakReference databaseManagerRef, - WeakReference listenerRef, order orderCoice) { + WeakReference listenerRef, List orderChoices) { this.packageManagerRef = packageManagerRef; this.databaseManagerRef = databaseManagerRef; this.listenerRef = listenerRef; - userOrderChoice = orderCoice; + userOrderChoices = orderChoices; } protected List doInBackground(Void... params) { @@ -44,12 +44,19 @@ class ComputeAppListTask extends AsyncTask order(List vms, List orderChoices) { + List applicationViewModels = new ArrayList<>(); + + + return applicationViewModels; + } + public enum order { DEFAULT, MOST_TRACKERS, diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/HomeFragment.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/HomeFragment.java index e660d0e..e1aa175 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/HomeFragment.java +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/HomeFragment.java @@ -77,7 +77,7 @@ public class HomeFragment extends Fragment implements ComputeAppListTask.Listene onAppsComputed(applications); if (applications.isEmpty()) - displayAppListAsync(); + displayAppListAsync(null); if (startRefreshAsked && last_refresh == null) startRefresh(); else if (refreshInProgress) { @@ -127,7 +127,7 @@ public class HomeFragment extends Fragment implements ComputeAppListTask.Listene refreshInProgress = false; homeBinding.layoutProgress.setVisibility(View.GONE); homeBinding.swipeRefresh.setRefreshing(false); - displayAppListAsync(); + displayAppListAsync(null); } public void setNetworkListener(NetworkListener listener) { @@ -180,7 +180,7 @@ public class HomeFragment extends Fragment implements ComputeAppListTask.Listene appListFragment.setFilter(AppListFragment.Type.NAME, filter); } - private void displayAppListAsync() { + private void displayAppListAsync(List orderList) { homeBinding.noAppFound.setVisibility(View.GONE); if (applications.isEmpty()) { homeBinding.retrieveApp.setVisibility(View.VISIBLE); @@ -190,7 +190,7 @@ public class HomeFragment extends Fragment implements ComputeAppListTask.Listene new ComputeAppListTask( new WeakReference<>(packageManager), new WeakReference<>(DatabaseManager.getInstance(getActivity())), - new WeakReference<>(this), ComputeAppListTask.order.DEFAULT + new WeakReference<>(this), orderList ).execute(); } diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/TrackerFragment.java b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/TrackerFragment.java index b45c89a..0f3de17 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/TrackerFragment.java +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/TrackerFragment.java @@ -115,7 +115,7 @@ public class TrackerFragment extends Fragment implements ComputeAppListTask.List new ComputeAppListTask( new WeakReference<>(packageManager), new WeakReference<>(DatabaseManager.getInstance(getActivity())), - new WeakReference<>(this), ComputeAppListTask.order.DEFAULT + new WeakReference<>(this), null ).execute(); }