diff options
author | Hans Boehm <hboehm@google.com> | 2015-05-18 15:00:12 -0700 |
---|---|---|
committer | Hans Boehm <hboehm@google.com> | 2015-05-18 18:32:09 -0700 |
commit | ffda52845ca6cca5f72795706988a11f6bcf5b03 (patch) | |
tree | 89cbc929c47777a487eb8f3d48fa3bb1d310d7a3 /src/com/android/calculator2/Evaluator.java | |
parent | 957d2d0b436a69a6a48eeb0a1dc0bd14d7da6c15 (diff) | |
download | android_packages_apps_ExactCalculator-ffda52845ca6cca5f72795706988a11f6bcf5b03.tar.gz android_packages_apps_ExactCalculator-ffda52845ca6cca5f72795706988a11f6bcf5b03.tar.bz2 android_packages_apps_ExactCalculator-ffda52845ca6cca5f72795706988a11f6bcf5b03.zip |
Handle placeholder characters during translation
Bug: 21131556
If we fall behind, initially use blanks as placeholder characters.
Convert these to the right character (currently a correctly sized
space) during translation.
This avoids log spam by the translation code with minimal complication.
It also seems a bit cleaner.
Add some missing private qualifiers in the same vicinity.
Change-Id: I9c53d74ce2a234c888cee55ba72575c884f18cae
Diffstat (limited to 'src/com/android/calculator2/Evaluator.java')
-rw-r--r-- | src/com/android/calculator2/Evaluator.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/com/android/calculator2/Evaluator.java b/src/com/android/calculator2/Evaluator.java index ad232db..6f508c4 100644 --- a/src/com/android/calculator2/Evaluator.java +++ b/src/com/android/calculator2/Evaluator.java @@ -131,15 +131,6 @@ class Evaluator { static final BigInteger BIG_MILLION = BigInteger.valueOf(1000000); - /** - * Character used as a placeholder for digits that are currently unknown in a result that is - * being computed. - * <p/> - * Note: the character must correspond closely to the width of a digit, otherwise the UI will - * visibly shift once the computation is finished. - */ - private static final char CHAR_DIGIT_UNKNOWN = '\u2007'; - private static final int EXTRA_DIGITS = 20; // Extra computed digits to minimize probably we will have // to change our minds about digits we already displayed. @@ -583,7 +574,7 @@ class Evaluator { private String getPadding(int n) { StringBuilder padding = new StringBuilder(); for (int i = 0; i < n; ++i) { - padding.append(CHAR_DIGIT_UNKNOWN); + padding.append(' '); // To be replaced during final translation. } return padding.toString(); } |