summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * | Merge "Snapshot display empty state once on creation of HistoryFragment." ↵TreeHugger Robot2017-02-024-46/+31
| | | |\ \ | | | | | | | | | | | | | | | | | | into ub-calculator-euler
| | | | * | Snapshot display empty state once on creation of HistoryFragment.Annie Chin2017-01-314-46/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 34698125 Test: Pasting while dragging history down no longer causes crashes. Remove EvaluatorStateUtils since we now only check the display state once. Change-Id: I22d0f3f0c967abcd8a8f70dd4cc157247bea8bed
| | | * | | Consider error message invalid for ActionMode/ContextMenu operations.Annie Chin2017-02-021-3/+2
| | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: Manually verified that the floating menu never appears in error states. Fixes: 34888339 Change-Id: If240fb25f45d67df6562d3cd164ad5efbdf66842
| | | * | Merge "Change popBackStackImmediate to popBackStack." into ub-calculator-eulerAnnie Chin2017-02-011-2/+1
| | | |\ \
| | | | * | Change popBackStackImmediate to popBackStack.Annie Chin2017-01-311-2/+1
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 34801945 Immediate is no longer necessary since we don't reuse HistoryFragments. Change-Id: Ieb31882df8e9c01b753f27f91aa9f0f70e219019
| | | * / Do not use HISTORY_MAIN_INDEX as clipboard or memory indexHans Boehm2017-02-013-38/+70
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 34697529 We were potentially saving HISTORY_MAIN_INDEX (-1) as the expression index for the clipboard or memory expression, without actually saving expression at that index. Deal with the fact that sharedpreferences or the database may have been corrupted with such spurious -1 values. As part of this, we also make the memory operations much more robust against trying to use an erroneous answer. This seems like a good idea anyway, since there are probably other, also extremely unlikely, cases in which this can occur. (Recall that some expressions evaluate to an error only when the precision is increased sufficiently.) Test: Unit tests pass. Installed old calculator and arranged to corrupt saved location as well as some history entries. The bad history entries show up with an answer of "Bad Expression". Trying th use the "Bad Expression" result no longer crashes for me. Change-Id: I0b1a897ce018353c4b67248f84fccde82fc43e92 (cherry picked from commit 7451da4b6bb1cb40440fb755e8344f90bc38ecb5)
| | | * Merge "Move values-w230dp-h220dp to values/" into ub-calculator-eulerTreeHugger Robot2017-01-315-109/+71
| | | |\
| | | | * Move values-w230dp-h220dp to values/Annie Chin2017-01-315-109/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 34833842 Change-Id: Ie0dcaf000e423995c7c4457456ee86acf9bc0ec1
| | | * | Annotate Evaluator.getInstance as NonNullAnnie Chin2017-01-302-27/+27
| | | |/ | | | | | | | | | | | | Change-Id: If72961d61d4c0ba948288ab77fb50fc9973c2ccd
| | | * Merge "Null-check mEvaluator onDestroy()" into ub-calculator-eulerAnnie Chin2017-01-301-3/+5
| | | |\
| | | | * Null-check mEvaluator onDestroy()Annie Chin2017-01-301-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 34742420 Change-Id: Ia1e99a121855b43fbaec648a0be25e6b40d9b255
| | | * | Add android-support-v7-recyclerview dependencyJustin Klaassen2017-01-274-94/+4
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | - Also removed obsolete testing files. Test: tapas ExactCalculator && make -j8 Change-Id: I87e525e978f76ab0ffbd4d9d13789e82f1693247
| | | * Merge "Fix potential inconsistent DragLayout state" into ub-calculator-eulerTreeHugger Robot2017-01-091-27/+22
| | | |\
| | | | * Fix potential inconsistent DragLayout stateJustin Klaassen2017-01-091-27/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change is was possible for DragLayout to end up in an open state without a visible HistoryFragment. With this change we only enter an open state after a successful view capture. Fixes: 34157451 Test: manually verified on API 21, 23 & 25 device Change-Id: Ia3631692ccc4281d06fd53f9b926e3043a9827f1
| | | * | Merge "Correct Unicode representation of "M-"" into ub-calculator-eulerChristine Franks2017-01-091-1/+1
| | | |\ \ | | | | |/ | | | |/|
| | | | * Correct Unicode representation of "M-"Christine Franks2017-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 34134606 Test: manual - Talkback correctly pronounces "M minus" Change-Id: I1f898fc9a96e685d80ba0c133e3c83fab5d94a71
| | | * | Don't re-use mHistoryFragmentJustin Klaassen2017-01-087-181/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make a new HistoryFragment every time we enter and exit history to work around a bug on older platforms where a Fragment's internal state may not be reset correctly when detached. Also the HistoryFragment open/close transition is now properly animated using a custom Animator returned by DragLayout. Fixes: 33587141 Fixes: 33789131 Fixes: 33789337 Fixes: 34132294 Fixes: 34132998 Fixes: 34134349 Fixes: 34135442 Test: manually verified no crash occurs on API 22, 23, & 24 emulator Change-Id: Iaefbe2bbf4ca186b6396397579887774ed5906d3
| | | * | Merge "Set mIsOpen in DragLayout.setClosed()/Open()" into ub-calculator-eulerAnnie Chin2017-01-061-2/+2
| | | |\ \
| | | | * | Set mIsOpen in DragLayout.setClosed()/Open()Annie Chin2016-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 33747824 Change-Id: I0f41407209e2ffb3dd0b209b3370baf90e820734
| | | * | | Merge "Polish History multiwindow support." into ub-calculator-eulerAnnie Chin2017-01-069-29/+51
| | | |\ \ \
| | | | * | | Polish History multiwindow support.Annie Chin2017-01-059-29/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 34081054 Fixes: 34081005 Fixes: 32987283 -Hide quick result from current expression when we are in one-line display mode. -Adjust bottom padding for history item in one-line mode. -Add font padding when bottom padding for items is 0 to prevent running into the bottom edge of the display. Change-Id: Icf3ddd4951ac0e4ab680124ecff7dd5258ccc05f
| | | * | | | Remove HistoryFragment.onCreateAnimator.Annie Chin2017-01-052-23/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 33587141 Fragment entry animation is there by default, but this removes the exit animation for all platforms. Change-Id: I326bf64c1eae1fe251d7729333eeee8aeea0fa1c
| | | * | | | Directly implement CloseCallback/DragCallback.Annie Chin2017-01-052-74/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: Verify that dragging history open/closed still works properly. Fixes: 34079549 Change-Id: I9a53a6631cfc97e40bbfd0dccfe6e28e03792c09
| | | * | | | Merge "Changes for testing CalculatorFormula" into ub-calculator-eulerJustin Klaassen2017-01-054-44/+64
| | | |\ \ \ \ | | | | |_|_|/ | | | |/| | |
| | | | * | | Changes for testing CalculatorFormulaChristine Franks2017-01-044-44/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33458518 Test: manual - compiles, and can still enter, calculate, and inflate the context menus on API 21 and 25. Change-Id: Ib5f01e89854248c77cb6484bca46086f34be1ca7
| | | * | | | Merge "Import translations. DO NOT MERGE" into ub-calculator-eulerTreeHugger Robot2017-01-051-1/+1
| | | |\ \ \ \ | | | | |/ / / | | | |/| | |
| | | | * | | Import translations. DO NOT MERGEBill Yi2017-01-051-1/+1
| | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If51da04c83df2184e1dc0877b4e57d52f4afe5ec Auto-generated-cl: translation import
| | | * / / Make onSaveInstanceState wait for database writesHans Boehm2017-01-043-0/+54
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 34051652 Add a mechanism to wait for (asynchronous) database writes to complete. Invoke it in Calculator.onSaveInstanceState(). This avoids a potential situation in which the saved instance state bundle includes a reference to an expression that never made it to the database. This may be more likely than it appears, since we run all background tasks on a single thread. A database save operation can get hung up behind a computation. Note that in almost all cases, the wait operation will return immediately, as evidenced by the fact that this very rarely leads to crashes without the wait operation. Change-Id: I7c2bdcd9bf19f6cb4bd653fb9244bca0f6b25435
| | | * | Merge "Change primary color to match spec." into ub-calculator-eulerAnnie Chin2017-01-043-4/+10
| | | |\ \
| | | | * | Change primary color to match spec.Annie Chin2017-01-043-4/+10
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 33752155 Update status bar colors to better match. Change-Id: Ie0872b7371eaf1e85e85a90cf33fcba5b5537d96
| | | * | Include more information for out-of-range DB accessHans Boehm2017-01-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 34051652 Change-Id: I8b504ad4a5b0e12b9ad4496b4a1e2a30e8017971
| | | * | Import translations. DO NOT MERGEBill Yi2016-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I73f25e8bcfd5bfe2ac59b30bb8683144f84bdc8c Auto-generated-cl: translation import
| | | * | Merge "Import translations. DO NOT MERGE" into ub-calculator-eulerTreeHugger Robot2016-12-221-1/+1
| | | |\ \
| | | | * | Import translations. DO NOT MERGEBill Yi2016-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: If175f1b94004d17ec8992326bb8ec193c90fac34 Auto-generated-cl: translation import
| | | * | | Restore cached timestamp correctlyHans Boehm2016-12-212-13/+16
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33751444 When reinitializing the calculator after restarting in RESULT state, we were reconstructing the last history entry from the main expression, without correctly restoring the timestamp. Instead read the expression, together with its timestamp, from the database. Correctly distinguish between result-already-saved and result-not-yet-saved states when evaluation completes. There may be very odd cases in which we generate an error the first time, setting the state to INIT, and successfully evaluate the second time (because we need less precision) that the old logic didn't handle. And testing for INIT_FOR_RESULT is cleaner anyway. (We can still, under very weird conditions, put expressions in the history that generate an error after evaluating correctly the first time. We should be robust against that already.) Add a couple of comments that would have made this easier to track down. Change-Id: I85756cca5d8fb76b2cbeb9ed32a788ae71b6d65e
| | | * | Correctly track Activity in EvaluatorHans Boehm2016-12-193-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33703223 Evaluator was remembering the Activity with which it had been created, not necessarily the current one. This interfered with proper display of things like timeout messages that rely on the remembered Activity. Use the Application rather than Activity context for the DB helper, since it outlives the Activity. Remove unused mActivity from ExpressionDB. Also acouple of trivial cleanups for minor annoyances found while debugging: 1. Add some missing final declarations. 2. Fix a comment. Change-Id: Iefe1fb588f66a1c77c82164680306377917c07af
| | | * | Change history overflow popup to light themeChristine Franks2016-12-161-0/+1
| | | |/ | | | | | | | | | | | | | | | | | | | | Bug: 33461918 Test: manual - tested on API 25 device and API 21 emulator Change-Id: I2e143795c395c4e191f4c7f1f1c1e78f7e011994
| | | * Import translations. DO NOT MERGEBill Yi2016-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I51b8d36cbc9d70add0c82add93922dbca92fafe8 Auto-generated-cl: translation import
| | | * Merge "Fix COPY string computation in exact case" into ub-calculator-eulerHans Boehm2016-12-132-5/+11
| | | |\
| | | | * Fix COPY string computation in exact caseHans Boehm2016-12-122-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 26175989 Bug: 33458621 Fix the determination of whether the currently displayed result is already exact. The old logic failed to deal with the odd corner case in which we force an initial scientific notation display because we don't have room for digit separators. When we recompute the exact result as part of a copy operation, and the exact result is an integer, do not add a trailing decimal point. Change-Id: I3f673fc428cf6982eeaf6aa1037b9f522ea2d6f9
| | | * | Merge "Support accessibility in History." into ub-calculator-eulerAnnie Chin2016-12-133-7/+23
| | | |\ \
| | | | * | Support accessibility in History.Annie Chin2016-12-133-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: 33429660 Toggle accessibility importance of main Calculator elements based on the open state of DragLayout. This is necessary due to the fact that Talkback does not use visibility as a cue for determining accessibility importance in RelativeLayout, which is the base class of DragLayout. Without this workaround, it's possible to traverse to main Calculator elements even when HistoryFragment is open. Change-Id: Iff3d775ec72aa50fe8972c1def32f4999d90a8f9
| | | * | | Merge "Only set erroneous result of "required" evaluations." into ↵Hans Boehm2016-12-131-2/+4
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | ub-calculator-euler
| | | | * | | Only set erroneous result of "required" evaluations.Hans Boehm2016-12-131-2/+4
| | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33555997 Otherwise the history display would see the erroneous result and force reevaluation and error message display, even when the user did not type "=". Change-Id: Id3954abb886ad20cb526131cbe405db4bf5ca16b
| | | * | | Merge "Enable MR when MS after start without a pasteable clip" into ↵Christine Franks2016-12-133-22/+31
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | ub-calculator-euler
| | | | * | | Enable MR when MS after start without a pasteable clipChristine Franks2016-12-093-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33458518 Test: manual - have nothing in the clipboard, open the app, tap 'MS' in the context menu, long-press the formula and the 'MR' button should appear in the context menu. Change-Id: I690906cb8ad57c4f5b45309c0670550f7089cbf6
| | | * | | | Don't call suppressCancelMessage() on wrong classHans Boehm2016-12-131-1/+1
| | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33580318 Evaluator.cancel needs to check that the evaluator is not an AsyncReevaluator before calling suppressCancelMessage. Change-Id: I379fdebcc7e14aff894b2b4d3fcc7553f8dc2fe3
| | | * | | Merge "Reevaluate erroneous current result in history" into ub-calculator-eulerHans Boehm2016-12-131-3/+17
| | | |\ \ \
| | | | * | | Reevaluate erroneous current result in historyHans Boehm2016-12-121-3/+17
| | | | | |/ | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33555997 We were losing the error message by never evaluating for HISTORY_MAIN_INDEX. But in the error case, we need to regenerate the error notification. We now store a special error value in the result string, so that we can distinguish the error case. Change-Id: I1311ce94a214da01d2e975666f6cb927fcd836f1
| | | * | | Increase char limit for clear dialog.Annie Chin2016-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 33533120 Change-Id: I8aebade6689ff6011d2019a9ff8c32f629defb9e