This commit is contained in:
Sergey Solovyev 2012-01-28 01:26:45 +04:00
parent 164ed250fa
commit 3a3117210e
2 changed files with 3 additions and 11 deletions

View File

@ -14,7 +14,8 @@
<org.solovyev.android.calculator.CalculatorEditor
a:id="@+id/calculatorEditor"
style="@style/editor_style"
a:inputType="textMultiLine"
a:editable="false"
a:singleLine="false"
a:scrollbars="vertical"
a:hint ="@string/c_calc_editor_hint"/>

View File

@ -19,7 +19,6 @@ 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.common.utils.CollectionsUtils;
/**
* User: serso
@ -52,17 +51,9 @@ public class CalculatorEditor extends EditText implements SharedPreferences.OnSh
public boolean onCheckIsTextEditor() {
// Main goal of this implementation is to hide android soft keyboard from appearing when working with text input
// todo serso: refactor
// NOTE: do not copy or reuse code below, it's completely SHIT!!!
if ( Build.VERSION.SDK_INT >= 11 ) {
// fix for missing cursor in android 3 and higher
for (StackTraceElement stackTraceElement : CollectionsUtils.asList(Thread.currentThread().getStackTrace())) {
if ( "isCursorVisible".equals(stackTraceElement.getMethodName()) ) {
return true;
}
}
return false;
} else {
return false;
}