mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-24 18:10:58 +00:00
Fix an issue where codes were not refreshed
Sometimes I get so enthusiastic when refactoring that I accidentally remove too
much. This issue was introduced in 98a38b03e4
This commit is contained in:
parent
ae5502b650
commit
0b83546db7
1 changed files with 20 additions and 0 deletions
|
@ -23,6 +23,8 @@ import com.beemdevelopment.aegis.R;
|
||||||
import com.beemdevelopment.aegis.SortCategory;
|
import com.beemdevelopment.aegis.SortCategory;
|
||||||
import com.beemdevelopment.aegis.ViewMode;
|
import com.beemdevelopment.aegis.ViewMode;
|
||||||
import com.beemdevelopment.aegis.helpers.SimpleItemTouchHelperCallback;
|
import com.beemdevelopment.aegis.helpers.SimpleItemTouchHelperCallback;
|
||||||
|
import com.beemdevelopment.aegis.helpers.UiRefresher;
|
||||||
|
import com.beemdevelopment.aegis.otp.TotpInfo;
|
||||||
import com.beemdevelopment.aegis.vault.VaultEntry;
|
import com.beemdevelopment.aegis.vault.VaultEntry;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.ListPreloader;
|
import com.bumptech.glide.ListPreloader;
|
||||||
|
@ -49,6 +51,8 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
||||||
private ViewMode _viewMode;
|
private ViewMode _viewMode;
|
||||||
private LinearLayout _emptyStateView;
|
private LinearLayout _emptyStateView;
|
||||||
|
|
||||||
|
private UiRefresher _refresher;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -93,6 +97,19 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
||||||
int resId = R.anim.layout_animation_fall_down;
|
int resId = R.anim.layout_animation_fall_down;
|
||||||
LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(getContext(), resId);
|
LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(getContext(), resId);
|
||||||
_recyclerView.setLayoutAnimation(animation);
|
_recyclerView.setLayoutAnimation(animation);
|
||||||
|
|
||||||
|
_refresher = new UiRefresher(new UiRefresher.Listener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
refresh(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getMillisTillNextRefresh() {
|
||||||
|
return TotpInfo.getMillisTillNextRotation(_adapter.getMostFrequentPeriod());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
_emptyStateView = view.findViewById(R.id.vEmptyList);
|
_emptyStateView = view.findViewById(R.id.vEmptyList);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
@ -104,6 +121,7 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
|
_refresher.destroy();
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,9 +228,11 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
||||||
_progressBar.setVisibility(View.VISIBLE);
|
_progressBar.setVisibility(View.VISIBLE);
|
||||||
_progressBar.setPeriod(period);
|
_progressBar.setPeriod(period);
|
||||||
_progressBar.start();
|
_progressBar.start();
|
||||||
|
_refresher.start();
|
||||||
} else {
|
} else {
|
||||||
_progressBar.setVisibility(View.GONE);
|
_progressBar.setVisibility(View.GONE);
|
||||||
_progressBar.stop();
|
_progressBar.stop();
|
||||||
|
_refresher.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue