mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-15 14:32:49 +00:00
Fix #295
This commit is contained in:
parent
7f1ce1e645
commit
bbea6c2ae4
3 changed files with 15 additions and 7 deletions
|
@ -38,6 +38,7 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
|||
private ViewMode _viewMode;
|
||||
private String _searchFilter;
|
||||
private boolean _isPeriodUniform = true;
|
||||
private int _uniformPeriod = -1;
|
||||
private Handler _dimHandler;
|
||||
|
||||
// keeps track of the viewholders that are currently bound
|
||||
|
@ -380,17 +381,19 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
|||
}
|
||||
|
||||
private void checkPeriodUniformity(boolean force) {
|
||||
int uniformPeriod = getUniformPeriod();
|
||||
boolean uniform = isPeriodUniform();
|
||||
if (!force && uniform == _isPeriodUniform) {
|
||||
if (!force && uniform == _isPeriodUniform && uniformPeriod == _uniformPeriod) {
|
||||
return;
|
||||
}
|
||||
_isPeriodUniform = uniform;
|
||||
_uniformPeriod = uniformPeriod;
|
||||
|
||||
for (EntryHolder holder : _holders) {
|
||||
holder.setShowProgress(!_isPeriodUniform);
|
||||
}
|
||||
|
||||
_view.onPeriodUniformityChanged(_isPeriodUniform);
|
||||
_view.onPeriodUniformityChanged(_isPeriodUniform, _uniformPeriod);
|
||||
}
|
||||
|
||||
public int getUniformPeriod() {
|
||||
|
@ -478,7 +481,11 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
|||
}
|
||||
|
||||
public boolean isPeriodUniform() {
|
||||
return getUniformPeriod() != -1;
|
||||
return isPeriodUniform(getUniformPeriod());
|
||||
}
|
||||
|
||||
private static boolean isPeriodUniform(int period) {
|
||||
return period != -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -492,7 +499,7 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
|||
void onEntryMove(VaultEntry entry1, VaultEntry entry2);
|
||||
void onEntryDrop(VaultEntry entry);
|
||||
void onEntryChange(VaultEntry entry);
|
||||
void onPeriodUniformityChanged(boolean uniform);
|
||||
void onPeriodUniformityChanged(boolean uniform, int period);
|
||||
void onSelect(VaultEntry entry);
|
||||
void onDeselect(VaultEntry entry);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class EntryHolder extends RecyclerView.ViewHolder {
|
|||
_refresher = new UiRefresher(new UiRefresher.Listener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
if (_hidden) {
|
||||
if (!_hidden) {
|
||||
refreshCode();
|
||||
}
|
||||
|
||||
|
|
|
@ -205,11 +205,12 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
|||
public void onDeselect(VaultEntry entry) { _listener.onDeselect(entry); }
|
||||
|
||||
@Override
|
||||
public void onPeriodUniformityChanged(boolean isUniform) {
|
||||
public void onPeriodUniformityChanged(boolean isUniform, int period) {
|
||||
setShowProgress(isUniform);
|
||||
if (_showProgress) {
|
||||
_refresher.stop();
|
||||
_progressBar.setVisibility(View.VISIBLE);
|
||||
_progressBar.setPeriod(_adapter.getUniformPeriod());
|
||||
_progressBar.setPeriod(period);
|
||||
_refresher.start();
|
||||
} else {
|
||||
_progressBar.setVisibility(View.GONE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue