Kaljurand/Unitconv — Issue #2: Show history (in addition to ambiguity)
Author: Kaljurand
Created: 2011-10-12 12:17:38+00:00
State: open

Currently the output is a list which shows the ambiguity of the input. But we need history as well.

Solution. Store both the history and ambiguity of the results in a database and populate an ExpandableListView via a cursor adapter. The main list is for the history (the user should be able to clear the list or delete its individual items), and each list item has possibly a sublist that presents the ambiguity (e.g. all the results of linearizing "10 USD in whatever currency").

Bonus points. Since each list item is essentially a number (i.e. an evaluation result of an arithmetical or unit conversion expression) it would also be cool to feed existing numbers into future expressions, e.g. the expression grammar does not allow:

> e to the power of (pi times i)

because it parses everything as left-associative. One could solve this problem by two utterances:

> 1. pi times i
> 2. e to the power of LAST

where `LAST` is linearized into some sort of variable which will be bound to the value found on the top of the history stack. After evaluation the history stack will become:

> 2. -1
> 1. pi * i

;)