Avoid duplicate requireResult() calls, add checking

Bug: 33011774

Don't needlessly cancel a previous requireResult() call. In addition to
wasting resources, this results in an onCancelled() call that set
the state back to INPUT, with surprising UI results.

If requireResult() is called before the corresponding CalculatorResult
is measured, crash with a stack trace. That seems to be an easy mistake.

Delete code that used to make things kind of work if we ran without
a correct display size.

Delay requireResult call that used to occur during onCreate().
Arrange to get the right listener invoked when the onLayout
requireResult() call completes.

Change-Id: I5da4855bfdda27fca5abc5871c4b312ef6ebede0
3 files changed