hardware keyboard input enabled
This commit is contained in:
parent
7a4d4485de
commit
cd025c3a89
@ -56,6 +56,7 @@
|
|||||||
<item name="android:gravity">left|top</item>
|
<item name="android:gravity">left|top</item>
|
||||||
<item name="android:layout_width">fill_parent</item>
|
<item name="android:layout_width">fill_parent</item>
|
||||||
<item name="android:layout_height">fill_parent</item>
|
<item name="android:layout_height">fill_parent</item>
|
||||||
|
<item name="android:inputType">text</item>
|
||||||
<item name="android:textSize">@dimen/cpp_editor_text_size</item>
|
<item name="android:textSize">@dimen/cpp_editor_text_size</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ package org.solovyev.android.calculator;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@ -65,30 +66,6 @@ public class AndroidCalculatorEditorView extends EditText implements SharedPrefe
|
|||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCheckIsTextEditor() {
|
|
||||||
// NOTE: code below can be used carefully and should not be copied without special intention
|
|
||||||
// The main purpose of code is to disable soft input (virtual keyboard) but leave all the TextEdit functionality, like cursor, scrolling, copy/paste menu etc
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 11) {
|
|
||||||
// fix for missing cursor in android 3 and higher
|
|
||||||
try {
|
|
||||||
// IDEA: return false always except if method was called from TextView.isCursorVisible() method
|
|
||||||
for (StackTraceElement stackTraceElement : CollectionsUtils.asList(Thread.currentThread().getStackTrace())) {
|
|
||||||
if ("isCursorVisible".equals(stackTraceElement.getMethodName())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
// just in case...
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreateContextMenu(ContextMenu menu) {
|
protected void onCreateContextMenu(ContextMenu menu) {
|
||||||
super.onCreateContextMenu(menu);
|
super.onCreateContextMenu(menu);
|
||||||
|
Loading…
Reference in New Issue
Block a user