Thursday, July 30, 2015

Calculator V


Github


I made some UI changes, bigger button's and text sizes basically. I thought that I'd be able to somehow expand my button sizes relative to my gridlayout, but apparently that's not possible(I think.) So I ended up moving to a Linear Layout rootview, with the screen textview and five more horizontal linear layouts that house all my buttons. This allowed me to easily fill the screen with my views.

I also notices an issue with my equal button. If I pressed it before an operator was pressed or in the middle of an operation, the app crashed. This happened because I set up a condition in the equal method:

if (!operator.equals("") && !screenString.equals(""))
This was mean to stop the method from executing if the necessary values did do exist. The problem arose because I did not initialize the operator variable, and in some instances when I expected it to equal "", it's value was actually null. I initialized that value and the problem appears to be solved.


TODO:


I noticed another issue with very large numbers. When they get big enough, numbers that should be in scientific notation just appear as a decimal; I think the scientific notation part just gets cut off. I need to update the formatting of my screen output. This will probably also allow me to display integers without a ".0" appended to them.

I still want to include another display field to show operators. And I want to do something else, not sure what, to spruce up the UI.

No comments:

Post a Comment