nolanlawson/KeepScore — pull request #74 by daguej (2014-02-20 06:39:49+00:00)
Title: Add calculator functionality to delta popup text field

When you open the delta popup (long-press on +/-), on larger devices like the Nexus 7, the keyboard shows a set of calculator-like buttons:

![screenshot_2014-02-20-01-12-02](https://f.cloud.github.com/assets/354349/2215623/1e3e1842-99f7-11e3-8f7a-d0cfd028d9a2.png)

This PR puts those buttons to work and allows you to do some basic math inside the dialog. For example, you can type `37+3+75+3*2-21` into the edit field, and when you press = (or tap the dialog's OK button), the field is automatically updated with the answer – in this example, 100.

This is especially useful in games where you must add up an arbitrary number of points that range from 1 to 100 to reach the player's score for the round.

The entered expression is evaluated with [exp4j](http://www.objecthunter.net/exp4j/), and things like order of operations and parentheses are properly respected.

I've also made two other tweaks:

- When you start typing in the input field, the other buttons are hidden and the input field is resized to fill available width. This makes it easier to see longer expressions.
- I've wired up the soft keyboard's return button to accept the dialog – I find it's quicker and easier to hit that button than the OK button of the dialog for some reason.