Darkempire78 / OpenCalc

A simple and beautiful calculator for Android
GNU General Public License v3.0
740 stars 83 forks source link

[Refactor] Reduce the code by removing duplication of Calculator Pad Text #86

Closed Hafiz-Waleed-Hussain closed 1 year ago

Hafiz-Waleed-Hussain commented 1 year ago

Improve the Calculator input pad.

Darkempire78 commented 1 year ago

The keyPadMappingToDisplay function won't work for buttons like "cos" or "-", because cos adds " cos(" when clicked and not just "cos", for "-", it's not the same character that is displayed on the button

Darkempire78 commented 1 year ago

I think it should be used only for numbers

Hafiz-Waleed-Hussain commented 1 year ago

Nice catch; I think we should have unit tests for these cases. So we can catch up during the development phase.

Darkempire78 commented 1 year ago

Nice catch; I think we should have unit tests for these cases. So we can catch up during the development phase.

Yes, you are right it can be very useful

Darkempire78 commented 1 year ago

@Hafiz-Waleed-Hussain Do you want to work on this pull request or should I close it?

Hafiz-Waleed-Hussain commented 1 year ago

Ops, I forgot. I will create a new pull request later.