-
-
Notifications
You must be signed in to change notification settings - Fork 430
Add haptic feedback toggle for code refresh #1599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add haptic feedback toggle for code refresh #1599
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! I like this more than I thought I would. I have a couple of comments.
app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/beemdevelopment/aegis/helpers/VibrationHelper.java
Outdated
Show resolved
Hide resolved
42ea9df
to
79c6fdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the fix for the animation-related crash for entries that have a period of 7 is not included here. Do you want to create a separate PR for that?
@@ -144,12 +147,26 @@ public int getSpanSize(int position) { | |||
@Override | |||
public void onRefresh() { | |||
refresh(false); | |||
|
|||
if (_recyclerView.isShown()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this check now that we stop the refresher when the activity is not visible?
_refresher.stop(); | ||
} | ||
|
||
public void onRefreshStart() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're now unconditionally starting the refresher from MainActivity, I think we need to check whether _adapter.getMostFrequentPeriod()
returns -1
here and if so not start the refresher. Otherwise, this causes a tight loop in the refresher in case there are no entries in the vault yet. This is also the reason why the instrumented tests are failing.
Improve haptic feedback logic
79c6fdc
to
63d2666
Compare
This PR adds the ability to enable/disable haptic feedback when the codes are about to expire or when they refresh.