mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-23 23:39:14 +00:00
Only copy code if not hidden
This commit is contained in:
parent
282f85fb3b
commit
542a8c6f8c
2 changed files with 15 additions and 2 deletions
|
@ -43,6 +43,7 @@ public class EntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
private List<VaultEntry> _selectedEntries;
|
private List<VaultEntry> _selectedEntries;
|
||||||
private Map<UUID, Integer> _usageCounts;
|
private Map<UUID, Integer> _usageCounts;
|
||||||
private VaultEntry _focusedEntry;
|
private VaultEntry _focusedEntry;
|
||||||
|
private VaultEntry _copiedEntry;
|
||||||
private Preferences.CodeGrouping _codeGroupSize;
|
private Preferences.CodeGrouping _codeGroupSize;
|
||||||
private boolean _showAccountName;
|
private boolean _showAccountName;
|
||||||
private boolean _showIcon;
|
private boolean _showIcon;
|
||||||
|
@ -420,18 +421,26 @@ public class EntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
boolean handled = false;
|
boolean handled = false;
|
||||||
|
|
||||||
if (_selectedEntries.isEmpty()) {
|
if (_selectedEntries.isEmpty()) {
|
||||||
if (_copyOnTap) {
|
boolean copiedThisClick = false;
|
||||||
|
|
||||||
|
if (_copyOnTap && !entryHolder.isHidden() && !(entry == _copiedEntry)) {
|
||||||
_view.onEntryCopy(entry);
|
_view.onEntryCopy(entry);
|
||||||
entryHolder.animateCopyText();
|
entryHolder.animateCopyText();
|
||||||
|
_copiedEntry = entry;
|
||||||
|
copiedThisClick = true;
|
||||||
|
handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_highlightEntry || _tempHighlightEntry || _tapToReveal) {
|
if (_highlightEntry || _tempHighlightEntry || _tapToReveal) {
|
||||||
if (_focusedEntry == entry) {
|
if (_focusedEntry == entry && !copiedThisClick) {
|
||||||
resetFocus();
|
resetFocus();
|
||||||
|
_copiedEntry = null;
|
||||||
handled = true;
|
handled = true;
|
||||||
} else {
|
} else {
|
||||||
focusEntry(entry, _tapToRevealTime);
|
focusEntry(entry, _tapToRevealTime);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
_copiedEntry = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
incrementUsageCount(entry);
|
incrementUsageCount(entry);
|
||||||
|
|
|
@ -308,6 +308,10 @@ public class EntryHolder extends RecyclerView.ViewHolder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHidden() {
|
||||||
|
return _hidden;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPaused(boolean paused) {
|
public void setPaused(boolean paused) {
|
||||||
_paused = paused;
|
_paused = paused;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue