mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-19 04:58:47 -04:00
Minor improvements
This commit is contained in:
@@ -16,13 +16,16 @@ public class RecyclerDataObserver extends RecyclerView.AdapterDataObserver {
|
||||
this.recyclerView = recyclerView;
|
||||
this.emptyView = emptyView;
|
||||
this.progressView = progressView;
|
||||
checkIfLoading();
|
||||
showProgress();
|
||||
}
|
||||
|
||||
public void checkIfLoading() {
|
||||
if (recyclerView.getAdapter() == null) {
|
||||
progressView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void showProgress() {
|
||||
progressView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void hideProgress() {
|
||||
progressView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void checkIfEmpty() {
|
||||
|
||||
@@ -129,6 +129,9 @@ public class SubCategoryFragment extends BaseFragment implements
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (dataObserver != null && !itemAdapter.getAdapterItems().isEmpty()) {
|
||||
dataObserver.hideProgress();
|
||||
}
|
||||
sharedPreferences.registerOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.aurora.store.AuroraApplication;
|
||||
import com.aurora.store.Constants;
|
||||
import com.aurora.store.InstalledDiffCallback;
|
||||
import com.aurora.store.util.diff.InstalledDiffCallback;
|
||||
import com.aurora.store.R;
|
||||
import com.aurora.store.model.App;
|
||||
import com.aurora.store.model.items.InstalledItem;
|
||||
|
||||
@@ -42,7 +42,6 @@ import com.aurora.store.AuroraApplication;
|
||||
import com.aurora.store.Constants;
|
||||
import com.aurora.store.R;
|
||||
import com.aurora.store.RecyclerDataObserver;
|
||||
import com.aurora.store.UpdatesDiffCallback;
|
||||
import com.aurora.store.download.DownloadManager;
|
||||
import com.aurora.store.manager.IgnoreListManager;
|
||||
import com.aurora.store.model.App;
|
||||
@@ -53,6 +52,7 @@ import com.aurora.store.ui.single.fragment.BaseFragment;
|
||||
import com.aurora.store.ui.view.CustomSwipeToRefresh;
|
||||
import com.aurora.store.util.Util;
|
||||
import com.aurora.store.util.ViewUtil;
|
||||
import com.aurora.store.util.diff.UpdatesDiffCallback;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.mikepenz.fastadapter.FastAdapter;
|
||||
import com.mikepenz.fastadapter.adapters.ItemAdapter;
|
||||
@@ -177,6 +177,14 @@ public class UpdatesFragment extends BaseFragment {
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (dataObserver != null && !itemAdapter.getAdapterItems().isEmpty()) {
|
||||
dataObserver.hideProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
swipeToRefresh.setRefreshing(false);
|
||||
@@ -261,7 +269,7 @@ public class UpdatesFragment extends BaseFragment {
|
||||
fastAdapter.addExtension(selectExtension);
|
||||
fastAdapter.addEventHook(new UpdatesItem.CheckBoxClickEvent());
|
||||
|
||||
dataObserver = new RecyclerDataObserver(recyclerView, emptyLayout,progressLayout);
|
||||
dataObserver = new RecyclerDataObserver(recyclerView, emptyLayout, progressLayout);
|
||||
fastAdapter.registerAdapterDataObserver(dataObserver);
|
||||
|
||||
selectExtension.setMultiSelect(true);
|
||||
|
||||
@@ -19,7 +19,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.aurora.store.Constants;
|
||||
import com.aurora.store.R;
|
||||
import com.aurora.store.SuggestionDiffCallback;
|
||||
import com.aurora.store.util.diff.SuggestionDiffCallback;
|
||||
import com.aurora.store.model.items.SearchSuggestionItem;
|
||||
import com.aurora.store.ui.details.DetailsActivity;
|
||||
import com.aurora.store.ui.search.SearchSuggestionModel;
|
||||
|
||||
@@ -128,6 +128,14 @@ public class SearchResultActivity extends BaseActivity implements
|
||||
finishAfterTransition();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (dataObserver != null && !itemAdapter.getAdapterItems().isEmpty()) {
|
||||
dataObserver.hideProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
sharedPreferences.unregisterOnSharedPreferenceChangeListener(this);
|
||||
|
||||
@@ -134,6 +134,14 @@ public class FavouriteFragment extends BaseFragment {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (dataObserver != null && !fastItemAdapter.getAdapterItems().isEmpty()) {
|
||||
dataObserver.hideProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
swipeToRefresh.setRefreshing(false);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.aurora.store;
|
||||
package com.aurora.store.util.diff;
|
||||
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.aurora.store;
|
||||
package com.aurora.store.util.diff;
|
||||
|
||||
import com.aurora.store.model.items.EndlessItem;
|
||||
import com.mikepenz.fastadapter.diff.DiffCallback;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.aurora.store;
|
||||
package com.aurora.store.util.diff;
|
||||
|
||||
import com.aurora.store.model.items.InstalledItem;
|
||||
import com.mikepenz.fastadapter.diff.DiffCallback;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.aurora.store;
|
||||
package com.aurora.store.util.diff;
|
||||
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.aurora.store;
|
||||
package com.aurora.store.util.diff;
|
||||
|
||||
import com.aurora.store.model.items.SearchSuggestionItem;
|
||||
import com.mikepenz.fastadapter.diff.DiffCallback;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.aurora.store;
|
||||
package com.aurora.store.util.diff;
|
||||
|
||||
import com.aurora.store.model.items.UpdatesItem;
|
||||
import com.mikepenz.fastadapter.diff.DiffCallback;
|
||||
Reference in New Issue
Block a user