From bce653318c8488926972420cee865b800d4e4b4d Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 10 Oct 2011 23:02:42 +0400 Subject: [PATCH] soft keyboard disabled --- .../android/calculator/CalculatorEditor.java | 16 ++++++ .../android/calculator/CalculatorView.java | 2 - .../view/widgets/SoftKeyboardDisabler.java | 50 ------------------- 3 files changed, 16 insertions(+), 52 deletions(-) delete mode 100644 src/main/java/org/solovyev/android/view/widgets/SoftKeyboardDisabler.java diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorEditor.java b/src/main/java/org/solovyev/android/calculator/CalculatorEditor.java index 17b63185..25c9edab 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorEditor.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorEditor.java @@ -10,6 +10,7 @@ import android.graphics.Color; import android.text.Html; import android.util.AttributeSet; import android.util.Log; +import android.view.ContextMenu; import android.widget.EditText; import org.jetbrains.annotations.NotNull; import org.solovyev.android.calculator.math.MathType; @@ -40,6 +41,21 @@ public class CalculatorEditor extends EditText { super(context, attrs, defStyle); } + @Override + public boolean onCheckIsTextEditor() { + return false; + } + + @Override + protected void onCreateContextMenu(ContextMenu menu) { + super.onCreateContextMenu(menu); + + menu.removeItem(android.R.id.selectAll); + menu.removeItem(android.R.id.startSelectingText); + } + + + public void redraw() { String text = getText().toString(); diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorView.java b/src/main/java/org/solovyev/android/calculator/CalculatorView.java index fd597233..a1443792 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorView.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorView.java @@ -22,7 +22,6 @@ import org.solovyev.android.calculator.model.CalculatorModel; import org.solovyev.android.calculator.model.ParseException; import org.solovyev.android.view.CursorControl; import org.solovyev.android.view.HistoryControl; -import org.solovyev.android.view.widgets.SoftKeyboardDisabler; import org.solovyev.common.utils.MutableObject; import org.solovyev.common.utils.StringUtils; import org.solovyev.common.utils.history.HistoryAction; @@ -50,7 +49,6 @@ public class CalculatorView implements CursorControl, HistoryControl