From a7ea67e1d6e5478d7d9d30ddacd9dd6e70323d0b Mon Sep 17 00:00:00 2001 From: serso Date: Thu, 13 Oct 2011 01:46:44 +0400 Subject: [PATCH] changes, changes, changes --- res/layout-port/main.xml | 4 +- res/layout/calc_clear_button.xml | 12 +- res/layout/calc_copy_button.xml | 7 +- res/layout/calc_donate_button.xml | 3 +- res/layout/calc_erase_button.xml | 12 +- res/layout/calc_paste_button.xml | 7 +- res/layout/calc_round_brackets_button.xml | 3 +- res/layout/calc_square_brackets_button.xml | 3 +- res/layout/calc_vars_button.xml | 2 +- res/layout/vars.xml | 29 ++++ res/values-ru/strings.xml | 7 +- res/values/strings.xml | 9 +- res/values/styles.xml | 70 +++++----- .../android/calculator/CalculatorEditor.java | 114 ++------------- .../calculator/CalculatorVarsActivity.java | 8 ++ .../android/calculator/CalculatorView.java | 2 +- .../android/calculator/TextHighlighter.java | 132 ++++++++++++++++++ .../android/calculator/math/Functions.java | 1 + .../android/calculator/math/MathType.java | 5 +- .../model/FromJsclTextProcessor.java | 7 +- .../calculator/model/VarsRegisterImpl.java | 8 +- .../android/view/widgets/ColorButton.java | 70 +++++++--- .../view/widgets/DirectionDragButton.java | 7 +- .../calculator/TextHighlighterTest.java | 45 ++++++ 24 files changed, 375 insertions(+), 192 deletions(-) create mode 100644 res/layout/vars.xml create mode 100644 src/main/java/org/solovyev/android/calculator/TextHighlighter.java create mode 100644 src/test/java/org/solovyev/android/calculator/TextHighlighterTest.java diff --git a/res/layout-port/main.xml b/res/layout-port/main.xml index c08453ae..47c6a53d 100644 --- a/res/layout-port/main.xml +++ b/res/layout-port/main.xml @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + diff --git a/res/layout/calc_clear_button.xml b/res/layout/calc_clear_button.xml index b23a7d5a..da1af738 100644 --- a/res/layout/calc_clear_button.xml +++ b/res/layout/calc_clear_button.xml @@ -6,9 +6,9 @@ ~ or visit http://se.solovyev.org --> - \ No newline at end of file + \ No newline at end of file diff --git a/res/layout/calc_copy_button.xml b/res/layout/calc_copy_button.xml index 4ed715d9..f355567c 100644 --- a/res/layout/calc_copy_button.xml +++ b/res/layout/calc_copy_button.xml @@ -6,10 +6,9 @@ ~ or visit http://se.solovyev.org --> - \ No newline at end of file diff --git a/res/layout/calc_donate_button.xml b/res/layout/calc_donate_button.xml index f365af31..dd1f0f2e 100644 --- a/res/layout/calc_donate_button.xml +++ b/res/layout/calc_donate_button.xml @@ -10,6 +10,5 @@ xmlns:calc="http://schemas.android.com/apk/res/org.solovyev.android.calculator" a:id="@+id/pasteButton" a:src="@drawable/heart" - style="@style/control_button_style" - a:padding="6dp" + style="@style/control_image_button_style" a:onClick="donateButtonClickHandler"/> \ No newline at end of file diff --git a/res/layout/calc_erase_button.xml b/res/layout/calc_erase_button.xml index 13d49758..bf6c7057 100644 --- a/res/layout/calc_erase_button.xml +++ b/res/layout/calc_erase_button.xml @@ -6,9 +6,9 @@ ~ or visit http://se.solovyev.org --> - \ No newline at end of file + \ No newline at end of file diff --git a/res/layout/calc_paste_button.xml b/res/layout/calc_paste_button.xml index e2d73b8c..d592b9f8 100644 --- a/res/layout/calc_paste_button.xml +++ b/res/layout/calc_paste_button.xml @@ -6,10 +6,9 @@ ~ or visit http://se.solovyev.org --> - \ No newline at end of file diff --git a/res/layout/calc_round_brackets_button.xml b/res/layout/calc_round_brackets_button.xml index e721bedc..b1f780ed 100644 --- a/res/layout/calc_round_brackets_button.xml +++ b/res/layout/calc_round_brackets_button.xml @@ -10,5 +10,6 @@ xmlns:calc="http://schemas.android.com/apk/res/org.solovyev.android.calculator" a:id="@+id/roundBracketsButton" a:text="()" calc:textUp="(" - calc:textDown=")" style="@style/digit_button_style" + calc:textDown=")" + style="@style/digit_button_style" a:onClick="digitButtonClickHandler"/> \ No newline at end of file diff --git a/res/layout/calc_square_brackets_button.xml b/res/layout/calc_square_brackets_button.xml index 360d83aa..f23abd5c 100644 --- a/res/layout/calc_square_brackets_button.xml +++ b/res/layout/calc_square_brackets_button.xml @@ -10,5 +10,6 @@ xmlns:calc="http://schemas.android.com/apk/res/org.solovyev.android.calculator" a:id="@+id/squareBracketsButton" a:text="[]" calc:textUp="[" - calc:textDown="]" style="@style/digit_button_style" + calc:textDown="]" + style="@style/digit_button_style" a:onClick="digitButtonClickHandler"/> \ No newline at end of file diff --git a/res/layout/calc_vars_button.xml b/res/layout/calc_vars_button.xml index 78efa2b0..ec814a4d 100644 --- a/res/layout/calc_vars_button.xml +++ b/res/layout/calc_vars_button.xml @@ -8,7 +8,7 @@ \ No newline at end of file diff --git a/res/layout/vars.xml b/res/layout/vars.xml new file mode 100644 index 00000000..1e66cacb --- /dev/null +++ b/res/layout/vars.xml @@ -0,0 +1,29 @@ + + + + + + + + +