Skip to content
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

Show when codes are about to expire #1494

Conversation

michaelschattgen
Copy link
Member

This PR adds a toggle under Settings -> Appearance to show when codes are about to expire. We will fade the color of the codes to a bright red when they're expiring in 7 seconds. Then when 3 seconds are left the codes will start to 'blink' as shown in the video below.

Fixes #411

20240918-1658-14.9308167.mp4

@michaelschattgen michaelschattgen force-pushed the feature/show-code-expiration branch 2 times, most recently from d7a7956 to e8baa5e Compare September 18, 2024 18:09
Copy link
Member

@alexbakker alexbakker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this looks good to me, but there are still some glitches here that I think will be hard to fix with the current approach. Scrolling through the list of entries seems to cause the state animations to get out of sync, you'll see the color switch from blue to red as new entries are loaded in and sometimes the expired state seems to get lost altogether.

I think it might be simpler to group the animations together in an AnimationSet and then seek to the right point in time inside the animation based on how many milliseconds are left until the code is refreshed. I've played around with this approach a little bit based on your branch: alexbakker@35ac51d. It seems to work well (though there might be some minor issues that I've missed). The downside is that setCurrentPlayTime is only available starting with API 26, but perhaps having this feature available for 95% of users is good enough.

app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@michaelschattgen michaelschattgen force-pushed the feature/show-code-expiration branch 3 times, most recently from e254074 to c8a37e7 Compare September 24, 2024 18:12
Co-authored-by: Alexander Bakker <ab@alexbakker.me>
@alexbakker alexbakker merged commit 92de13b into beemdevelopment:master Sep 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change color of code before it expires.
2 participants