Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Terminal user interface- command line
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arjun Sundaram
Terminal user interface- command line
Commits
e0721fe6
Commit
e0721fe6
authored
9 years ago
by
Francesco
Browse files
Options
Downloads
Patches
Plain Diff
improved suggestions
parent
f32cef8b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/ohi/andre/consolelauncher/UIManager.java
+6
-4
6 additions, 4 deletions
app/src/main/java/ohi/andre/consolelauncher/UIManager.java
with
6 additions
and
4 deletions
app/src/main/java/ohi/andre/consolelauncher/UIManager.java
+
6
−
4
View file @
e0721fe6
...
@@ -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
();
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment