Skip to content
Snippets Groups Projects
Commit e0721fe6 authored by Francesco's avatar Francesco
Browse files

improved suggestions

parent f32cef8b
No related branches found
No related tags found
No related merge requests found
...@@ -74,11 +74,10 @@ public class UIManager implements OnTouchListener { ...@@ -74,11 +74,10 @@ public class UIManager implements OnTouchListener {
} }
}; };
// suggestions stuff
private SuggestionViewDecorer suggestionViewDecorer; private SuggestionViewDecorer suggestionViewDecorer;
private LinearLayout.LayoutParams suggestionViewParams; private LinearLayout.LayoutParams suggestionViewParams;
private Thread lastSuggestionThread; private Thread lastSuggestionThread;
// input looker for suggestions
protected TextWatcher textWatcher = new TextWatcher() { protected TextWatcher textWatcher = new TextWatcher() {
@Override @Override
...@@ -90,8 +89,10 @@ public class UIManager implements OnTouchListener { ...@@ -90,8 +89,10 @@ public class UIManager implements OnTouchListener {
if (suggestionsView == null) if (suggestionsView == null)
return; return;
if (s.length() == 0) if (s.length() == 0) {
suggestionsView.removeAllViews();
return; return;
}
String text = s.toString(); String text = s.toString();
int lastSpace = text.lastIndexOf(" "); int lastSpace = text.lastIndexOf(" ");
...@@ -106,7 +107,7 @@ public class UIManager implements OnTouchListener { ...@@ -106,7 +107,7 @@ public class UIManager implements OnTouchListener {
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
} }
}; };
// clicklistener for suggestions
private View.OnClickListener clickListener = new View.OnClickListener() { private View.OnClickListener clickListener = new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -256,6 +257,7 @@ public class UIManager implements OnTouchListener { ...@@ -256,6 +257,7 @@ public class UIManager implements OnTouchListener {
@Override @Override
public void onNewInput(String input) { public void onNewInput(String input) {
trigger.exec(input, mTerminalAdapter.getCurrentOutputId()); trigger.exec(input, mTerminalAdapter.getCurrentOutputId());
suggestionsView.removeAllViews();
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment