From 71012586628598c6f051c3330f5d62805a9c345b Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Sun, 15 Jan 2012 02:35:06 +0400 Subject: [PATCH] refactor --- res/layout-land/main_calculator.xml | 6 +++--- res/layout-land/main_cellphone.xml | 6 +++--- res/layout/calc_copy_button.xml | 2 +- res/layout/calc_division_button.xml | 2 +- res/layout/calc_donate_button.xml | 2 +- res/layout/calc_dot_button.xml | 2 +- res/layout/calc_eight_digit_button.xml | 2 +- res/layout/calc_empty_button.xml | 2 +- res/layout/calc_equals_button.xml | 2 +- res/layout/calc_erase_button.xml | 2 +- res/layout/calc_five_digit_button.xml | 2 +- res/layout/calc_four_digit_button.xml | 2 +- res/layout/calc_functions_button.xml | 2 +- res/layout/calc_history_button.xml | 2 +- res/layout/calc_left_button.xml | 2 +- res/layout/calc_multiplication_button.xml | 2 +- res/layout/calc_nine_digit_button.xml | 2 +- res/layout/calc_one_digit_button.xml | 2 +- res/layout/calc_operators_button.xml | 2 +- res/layout/calc_paste_button.xml | 2 +- res/layout/calc_plus_button.xml | 2 +- res/layout/calc_right_button.xml | 2 +- res/layout/calc_round_brackets_button.xml | 2 +- res/layout/calc_seven_digit_button.xml | 2 +- res/layout/calc_subtraction_button.xml | 2 +- res/layout/calc_three_digit_button.xml | 2 +- res/layout/calc_two_digit_button.xml | 2 +- res/layout/calc_vars_button.xml | 2 +- res/layout/calc_zero_digit_button.xml | 2 +- res/layout/drag_button_calibration.xml | 4 ++-- res/layout/number_picker.xml | 4 ++-- .../android/calculator/CalculatorActivity.java | 7 +++---- .../solovyev/android/calculator/CalculatorDisplay.java | 2 +- .../solovyev/android/calculator/CalculatorModel.java | 5 ++++- .../calculator/CalculatorPreferencesActivity.java | 2 +- .../android/calculator/CursorDragProcessor.java | 10 +++++----- .../android/calculator/DigitButtonDragProcessor.java | 8 ++++---- .../solovyev/android/calculator/EvalDragProcessor.java | 8 ++++---- .../calculator/about/CalculatorAboutTabActivity.java | 2 +- .../calculator/help/CalculatorHelpTabActivity.java | 2 +- .../calculator/history/AbstractHistoryActivity.java | 4 ++-- .../history/CalculatorHistoryTabActivity.java | 2 +- .../calculator/history/HistoryItemMenuItem.java | 2 +- .../math/edit/AbstractMathEntityListActivity.java | 6 +++--- .../math/edit/CalculatorFunctionsActivity.java | 2 +- .../math/edit/CalculatorFunctionsTabActivity.java | 2 +- .../math/edit/CalculatorOperatorsActivity.java | 2 +- .../calculator/math/edit/CalculatorVarsActivity.java | 2 +- .../math/edit/CalculatorVarsTabActivity.java | 2 +- .../android/calculator/view/AngleUnitsButton.java | 2 +- .../android/calculator/view/NumeralBasesButton.java | 2 +- 51 files changed, 75 insertions(+), 73 deletions(-) diff --git a/res/layout-land/main_calculator.xml b/res/layout-land/main_calculator.xml index 267b4d40..d56dee19 100644 --- a/res/layout-land/main_calculator.xml +++ b/res/layout-land/main_calculator.xml @@ -24,7 +24,7 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/res/layout/calc_equals_button.xml b/res/layout/calc_equals_button.xml index 742bda6b..188d3ab8 100644 --- a/res/layout/calc_equals_button.xml +++ b/res/layout/calc_equals_button.xml @@ -5,7 +5,7 @@ ~ For more information, please, contact se.solovyev@gmail.com ~ or visit http://se.solovyev.org --> - - - - - - - - - - - - - - - - - - - - - - - - @@ -23,7 +23,7 @@ android:textSize="30sp" android:background="@drawable/timepicker_input" /> - diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java index 19b97d82..f3998844 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java @@ -31,6 +31,7 @@ import net.robotmedia.billing.IBillingObserver; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.solovyev.android.AndroidUtils; +import org.solovyev.android.FontSizeAdjuster; import org.solovyev.android.ResourceCache; import org.solovyev.android.calculator.about.CalculatorReleaseNotesActivity; import org.solovyev.android.calculator.history.CalculatorHistory; @@ -39,11 +40,9 @@ import org.solovyev.android.calculator.math.MathType; import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.view.AngleUnitsButton; import org.solovyev.android.calculator.view.NumeralBasesButton; -import org.solovyev.android.view.FontSizeAdjuster; import org.solovyev.android.prefs.IntegerPreference; import org.solovyev.android.prefs.Preference; -import org.solovyev.android.view.widgets.*; -import org.solovyev.android.view.widgets.DragEvent; +import org.solovyev.android.view.*; import org.solovyev.common.utils.Announcer; import org.solovyev.common.utils.Point2d; import org.solovyev.common.utils.StringUtils; @@ -344,7 +343,7 @@ public class CalculatorActivity extends Activity implements FontSizeAdjuster, Sh } @Override - public boolean onDrag(@NotNull DragButton dragButton, @NotNull DragEvent event) { + public boolean onDrag(@NotNull DragButton dragButton, @NotNull org.solovyev.android.view.DragEvent event) { boolean result = super.onDrag(dragButton, event); if (result) { diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorDisplay.java b/src/main/java/org/solovyev/android/calculator/CalculatorDisplay.java index b87c79dd..5ad577e3 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorDisplay.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorDisplay.java @@ -20,7 +20,7 @@ import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorParseException; import org.solovyev.android.calculator.model.TextProcessor; import org.solovyev.android.calculator.view.TextHighlighter; -import org.solovyev.android.view.AMenuItem; +import org.solovyev.android.menu.AMenuItem; import org.solovyev.android.view.AutoResizeTextView; import java.util.HashSet; diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorModel.java b/src/main/java/org/solovyev/android/calculator/CalculatorModel.java index e5c4f80b..cf261d69 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorModel.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorModel.java @@ -22,6 +22,8 @@ import jscl.math.function.Constant; import jscl.math.function.IConstant; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.solovyev.android.CursorControl; +import org.solovyev.android.HistoryControl; import org.solovyev.android.calculator.history.CalculatorHistory; import org.solovyev.android.calculator.history.CalculatorHistoryState; import org.solovyev.android.calculator.history.TextViewEditorAdapter; @@ -30,7 +32,8 @@ import org.solovyev.android.calculator.math.MathType; import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.CalculatorEvalException; import org.solovyev.android.calculator.model.CalculatorParseException; -import org.solovyev.android.view.*; +import org.solovyev.android.menu.AMenuBuilder; +import org.solovyev.android.menu.AMenuItem; import org.solovyev.common.msg.Message; import org.solovyev.common.utils.CollectionsUtils; import org.solovyev.common.utils.MutableObject; diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorPreferencesActivity.java b/src/main/java/org/solovyev/android/calculator/CalculatorPreferencesActivity.java index 15567564..eb4e5c22 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorPreferencesActivity.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorPreferencesActivity.java @@ -20,7 +20,7 @@ import net.robotmedia.billing.model.Transaction; import org.solovyev.android.AndroidUtils; import org.solovyev.android.ads.AdsController; import org.solovyev.android.calculator.model.CalculatorEngine; -import org.solovyev.android.view.widgets.VibratorContainer; +import org.solovyev.android.view.VibratorContainer; /** * User: serso diff --git a/src/main/java/org/solovyev/android/calculator/CursorDragProcessor.java b/src/main/java/org/solovyev/android/calculator/CursorDragProcessor.java index 76176793..d25e425b 100644 --- a/src/main/java/org/solovyev/android/calculator/CursorDragProcessor.java +++ b/src/main/java/org/solovyev/android/calculator/CursorDragProcessor.java @@ -7,11 +7,11 @@ package org.solovyev.android.calculator; import android.view.MotionEvent; import org.jetbrains.annotations.NotNull; -import org.solovyev.android.view.*; -import org.solovyev.android.view.widgets.DirectionDragButton; -import org.solovyev.android.view.widgets.DragButton; -import org.solovyev.android.view.widgets.DragDirection; -import org.solovyev.android.view.widgets.SimpleOnDragListener; +import org.solovyev.android.CursorControl; +import org.solovyev.android.view.DirectionDragButton; +import org.solovyev.android.view.DragButton; +import org.solovyev.android.view.DragDirection; +import org.solovyev.android.view.SimpleOnDragListener; import org.solovyev.common.utils.Point2d; /** diff --git a/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java b/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java index 8b267f8d..82fc5b3a 100644 --- a/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java +++ b/src/main/java/org/solovyev/android/calculator/DigitButtonDragProcessor.java @@ -7,10 +7,10 @@ package org.solovyev.android.calculator; import android.view.MotionEvent; import org.jetbrains.annotations.NotNull; -import org.solovyev.android.view.widgets.DirectionDragButton; -import org.solovyev.android.view.widgets.DragButton; -import org.solovyev.android.view.widgets.DragDirection; -import org.solovyev.android.view.widgets.SimpleOnDragListener; +import org.solovyev.android.view.DirectionDragButton; +import org.solovyev.android.view.DragDirection; +import org.solovyev.android.view.DragButton; +import org.solovyev.android.view.SimpleOnDragListener; import org.solovyev.common.utils.Point2d; /** diff --git a/src/main/java/org/solovyev/android/calculator/EvalDragProcessor.java b/src/main/java/org/solovyev/android/calculator/EvalDragProcessor.java index 93ecff85..43c42b58 100644 --- a/src/main/java/org/solovyev/android/calculator/EvalDragProcessor.java +++ b/src/main/java/org/solovyev/android/calculator/EvalDragProcessor.java @@ -8,10 +8,10 @@ package org.solovyev.android.calculator; import android.view.MotionEvent; import org.jetbrains.annotations.NotNull; -import org.solovyev.android.view.widgets.DirectionDragButton; -import org.solovyev.android.view.widgets.DragButton; -import org.solovyev.android.view.widgets.DragDirection; -import org.solovyev.android.view.widgets.SimpleOnDragListener; +import org.solovyev.android.view.DirectionDragButton; +import org.solovyev.android.view.DragButton; +import org.solovyev.android.view.DragDirection; +import org.solovyev.android.view.SimpleOnDragListener; import org.solovyev.common.utils.Point2d; /** diff --git a/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutTabActivity.java b/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutTabActivity.java index 429b75ee..83762c9d 100644 --- a/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutTabActivity.java +++ b/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutTabActivity.java @@ -10,8 +10,8 @@ import android.os.Bundle; import android.widget.TabHost; import org.jetbrains.annotations.Nullable; import org.solovyev.android.AndroidUtils; +import org.solovyev.android.LastTabSaver; import org.solovyev.android.calculator.R; -import org.solovyev.android.view.LastTabSaver; /** * User: serso diff --git a/src/main/java/org/solovyev/android/calculator/help/CalculatorHelpTabActivity.java b/src/main/java/org/solovyev/android/calculator/help/CalculatorHelpTabActivity.java index e23cc57d..2a483261 100644 --- a/src/main/java/org/solovyev/android/calculator/help/CalculatorHelpTabActivity.java +++ b/src/main/java/org/solovyev/android/calculator/help/CalculatorHelpTabActivity.java @@ -14,8 +14,8 @@ import android.widget.TabHost; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.solovyev.android.AndroidUtils; +import org.solovyev.android.LastTabSaver; import org.solovyev.android.calculator.R; -import org.solovyev.android.view.LastTabSaver; /** * User: serso diff --git a/src/main/java/org/solovyev/android/calculator/history/AbstractHistoryActivity.java b/src/main/java/org/solovyev/android/calculator/history/AbstractHistoryActivity.java index 2dbd9d3c..7acdee4c 100644 --- a/src/main/java/org/solovyev/android/calculator/history/AbstractHistoryActivity.java +++ b/src/main/java/org/solovyev/android/calculator/history/AbstractHistoryActivity.java @@ -23,8 +23,8 @@ import org.solovyev.android.ads.AdsController; import org.solovyev.android.calculator.CalculatorModel; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.jscl.JsclOperation; -import org.solovyev.android.view.AMenuBuilder; -import org.solovyev.android.view.MenuImpl; +import org.solovyev.android.menu.AMenuBuilder; +import org.solovyev.android.menu.MenuImpl; import org.solovyev.common.utils.*; import java.util.ArrayList; diff --git a/src/main/java/org/solovyev/android/calculator/history/CalculatorHistoryTabActivity.java b/src/main/java/org/solovyev/android/calculator/history/CalculatorHistoryTabActivity.java index 39e3c2d1..59c6be28 100644 --- a/src/main/java/org/solovyev/android/calculator/history/CalculatorHistoryTabActivity.java +++ b/src/main/java/org/solovyev/android/calculator/history/CalculatorHistoryTabActivity.java @@ -11,8 +11,8 @@ import android.os.Bundle; import android.widget.TabHost; import org.jetbrains.annotations.Nullable; import org.solovyev.android.AndroidUtils; +import org.solovyev.android.LastTabSaver; import org.solovyev.android.calculator.R; -import org.solovyev.android.view.LastTabSaver; /** * User: serso diff --git a/src/main/java/org/solovyev/android/calculator/history/HistoryItemMenuItem.java b/src/main/java/org/solovyev/android/calculator/history/HistoryItemMenuItem.java index cd9304c7..6708cbfd 100644 --- a/src/main/java/org/solovyev/android/calculator/history/HistoryItemMenuItem.java +++ b/src/main/java/org/solovyev/android/calculator/history/HistoryItemMenuItem.java @@ -19,7 +19,7 @@ import android.widget.TextView; import android.widget.Toast; import org.jetbrains.annotations.NotNull; import org.solovyev.android.calculator.R; -import org.solovyev.android.view.AMenuItem; +import org.solovyev.android.menu.AMenuItem; import org.solovyev.common.utils.StringUtils; /** diff --git a/src/main/java/org/solovyev/android/calculator/math/edit/AbstractMathEntityListActivity.java b/src/main/java/org/solovyev/android/calculator/math/edit/AbstractMathEntityListActivity.java index 4cfa2973..4fccd88d 100644 --- a/src/main/java/org/solovyev/android/calculator/math/edit/AbstractMathEntityListActivity.java +++ b/src/main/java/org/solovyev/android/calculator/math/edit/AbstractMathEntityListActivity.java @@ -22,9 +22,9 @@ import org.solovyev.android.ads.AdsController; import org.solovyev.android.calculator.CalculatorModel; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.model.AndroidMathRegistry; -import org.solovyev.android.view.AMenuBuilder; -import org.solovyev.android.view.AMenuItem; -import org.solovyev.android.view.MenuImpl; +import org.solovyev.android.menu.AMenuBuilder; +import org.solovyev.android.menu.AMenuItem; +import org.solovyev.android.menu.MenuImpl; import org.solovyev.common.math.MathEntity; import org.solovyev.common.utils.EqualsTool; import org.solovyev.common.utils.Filter; diff --git a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsActivity.java b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsActivity.java index 24c0c14b..ad958c65 100644 --- a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsActivity.java +++ b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsActivity.java @@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull; import org.solovyev.android.calculator.CalculatorModel; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.model.CalculatorEngine; -import org.solovyev.android.view.AMenuItem; +import org.solovyev.android.menu.AMenuItem; import org.solovyev.common.utils.StringUtils; import java.util.ArrayList; diff --git a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsTabActivity.java b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsTabActivity.java index 05644f8f..94913055 100644 --- a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsTabActivity.java +++ b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorFunctionsTabActivity.java @@ -11,9 +11,9 @@ import android.os.Bundle; import android.widget.TabHost; import org.jetbrains.annotations.Nullable; import org.solovyev.android.AndroidUtils; +import org.solovyev.android.LastTabSaver; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.model.AndroidFunctionsMathRegistry; -import org.solovyev.android.view.LastTabSaver; /** * User: serso diff --git a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorOperatorsActivity.java b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorOperatorsActivity.java index c7539784..a684346e 100644 --- a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorOperatorsActivity.java +++ b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorOperatorsActivity.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.solovyev.android.calculator.CalculatorModel; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.model.CalculatorEngine; -import org.solovyev.android.view.AMenuItem; +import org.solovyev.android.menu.AMenuItem; import org.solovyev.common.utils.StringUtils; import java.util.ArrayList; diff --git a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsActivity.java b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsActivity.java index 1832f96c..384f9ebc 100644 --- a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsActivity.java +++ b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsActivity.java @@ -26,7 +26,7 @@ import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.math.MathType; import org.solovyev.android.calculator.model.CalculatorEngine; import org.solovyev.android.calculator.model.Var; -import org.solovyev.android.view.AMenuItem; +import org.solovyev.android.menu.AMenuItem; import org.solovyev.common.utils.CollectionsUtils; import org.solovyev.common.utils.Finder; import org.solovyev.common.utils.StringUtils; diff --git a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsTabActivity.java b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsTabActivity.java index cc39d9ef..ce36fdc4 100644 --- a/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsTabActivity.java +++ b/src/main/java/org/solovyev/android/calculator/math/edit/CalculatorVarsTabActivity.java @@ -11,9 +11,9 @@ import android.os.Bundle; import android.widget.TabHost; import org.jetbrains.annotations.Nullable; import org.solovyev.android.AndroidUtils; +import org.solovyev.android.LastTabSaver; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.model.VarCategory; -import org.solovyev.android.view.LastTabSaver; /** * User: serso diff --git a/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java b/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java index 24852c4c..ed5f25e3 100644 --- a/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java +++ b/src/main/java/org/solovyev/android/calculator/view/AngleUnitsButton.java @@ -14,7 +14,7 @@ import android.util.AttributeSet; import org.jetbrains.annotations.NotNull; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.model.CalculatorEngine; -import org.solovyev.android.view.widgets.DirectionDragButton; +import org.solovyev.android.view.DirectionDragButton; /** * User: serso diff --git a/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java b/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java index 200bf4f1..8701cff1 100644 --- a/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java +++ b/src/main/java/org/solovyev/android/calculator/view/NumeralBasesButton.java @@ -14,7 +14,7 @@ import android.util.AttributeSet; import org.jetbrains.annotations.NotNull; import org.solovyev.android.calculator.R; import org.solovyev.android.calculator.model.CalculatorEngine; -import org.solovyev.android.view.widgets.DirectionDragButton; +import org.solovyev.android.view.DirectionDragButton; /** * User: serso