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 { ...@@ -64,7 +64,7 @@ public class TerminalAdapter {
private OnNewInputListener mInputListener; private OnNewInputListener mInputListener;
public TerminalAdapter(TextView terminalView, EditText inputView, TextView prefixView, TextView submitView, SkinManager skinManager, 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) if (terminalView == null || inputView == null || prefixView == null || skinManager == null)
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
...@@ -103,7 +103,9 @@ public class TerminalAdapter { ...@@ -103,7 +103,9 @@ public class TerminalAdapter {
this.mInputView.setOnEditorActionListener(new TextView.OnEditorActionListener() { this.mInputView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override @Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { 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(); onNewInput();
return true; return true;
} else } else
...@@ -185,6 +187,10 @@ public class TerminalAdapter { ...@@ -185,6 +187,10 @@ public class TerminalAdapter {
} }
} }
public void simulateEnter() {
onNewInput();
}
public void setupScroller() { public void setupScroller() {
this.mTerminalView.setMovementMethod(new ScrollingMovementMethod()); 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