-
-
Notifications
You must be signed in to change notification settings - Fork 41
Implement negative temperature conversion (#44) #49
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
Conversation
|
I've tested and found two issues:
There are also two issues that I'm not sure whether we should address them in this PR:
|
- Fixed crash when deleting negative values
- Added support for entering negative sign first
- Implemented temperature limits validation during input:
* Block negative values for Kelvin and Rankine (minimum 0)
* Enforce absolute zero limits:
- Celsius: minimum -273.15
- Fahrenheit: minimum -459.67
- Added validation during digit entry to avoid going below absolute 0 and also after sign toggle
|
I fixed the crash issue (deleting negative value resets to 0) and added the possibility to use the - before entering a number. Concerning the other remarks, I made sure to enforce temperature limits during input by automatically adjusting values that exceed absolute zero for each unit type: Celsius cannot go below -273.15, Fahrenheit below -459.67, and Kelvin/Rankine are blocked entirely from being negative (minimum 0) |
|
Hello @Aga-C |
|
Hi! @Lionheart-Y2J I'll do a final review and merge this soon. Thanks. |
app/src/main/kotlin/org/fossify/math/activities/UnitConverterActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/fossify/math/activities/UnitConverterActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/fossify/math/activities/UnitConverterActivity.kt
Outdated
Show resolved
Hide resolved
|
The functionality itself seems to work. Left some comments and nitpicks regarding the code. |
naveensingh
left a comment
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.
Made those changes myself to not delay this anymore.
Thank you!
Forgot to add it after commiting #49 (comment)
* fix: add btnPlusMinus to `getButtonIds()` Forgot to add it after commiting #49 (comment) * style: format code
What is it?
Description of the changes in your PR
toggleNegative()method inConverterViewto handle sign changesBefore/After Screenshots/Screen Record
Fixes the following issue(s)
Relies on the following changes
plus_minus_layout)numpadClickedAcknowledgement