Skip to content
Snippets Groups Projects
Commit 6308e87e authored by Francesco Andreuzzi's avatar Francesco Andreuzzi
Browse files

physicalEnter

parent 0e21ec90
Branches
Tags
No related merge requests found
......@@ -64,7 +64,7 @@ public class TerminalAdapter {
private OnNewInputListener mInputListener;
public TerminalAdapter(TextView terminalView, EditText inputView, TextView prefixView, TextView submitView, SkinManager skinManager,
String hint) {
String hint, final boolean physicalEnter) {
if (terminalView == null || inputView == null || prefixView == null || skinManager == null)
throw new UnsupportedOperationException();
......@@ -103,7 +103,9 @@ public class TerminalAdapter {
this.mInputView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE) {
if (actionId == EditorInfo.IME_ACTION_GO || actionId == EditorInfo.IME_ACTION_DONE
|| (physicalEnter && actionId == EditorInfo.IME_ACTION_UNSPECIFIED)) {
onNewInput();
return true;
} else
......@@ -185,6 +187,10 @@ public class TerminalAdapter {
}
}
public void simulateEnter() {
onNewInput();
}
public void setupScroller() {
this.mTerminalView.setMovementMethod(new ScrollingMovementMethod());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment