Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
013ba3e3
Commit
013ba3e3
authored
13 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Move debug information back to suggestions strip
Change-Id: I8cfad5f780a481a251cc4f752bff3cda5ae3ffbe
parent
7fe084a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/res/layout/candidates_strip.xml
+11
-4
11 additions, 4 deletions
java/res/layout/candidates_strip.xml
java/src/com/android/inputmethod/latin/CandidateView.java
+13
-7
13 additions, 7 deletions
java/src/com/android/inputmethod/latin/CandidateView.java
with
24 additions
and
11 deletions
java/res/layout/candidates_strip.xml
+
11
−
4
View file @
013ba3e3
...
@@ -22,9 +22,16 @@
...
@@ -22,9 +22,16 @@
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:latin=
"http://schemas.android.com/apk/res/com.android.inputmethod.latin"
xmlns:latin=
"http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
>
<
LinearLayout
<
!-- Placer for debug information -->
android:id=
"@+id/candidates_strip"
<RelativeLayout
android:
orientation=
"horizontal
"
android:
id=
"@+id/candidates_placer
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
>
<LinearLayout
android:id=
"@+id/candidates_strip"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</RelativeLayout>
</merge>
</merge>
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/CandidateView.java
+
13
−
7
View file @
013ba3e3
...
@@ -64,6 +64,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -64,6 +64,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
private
static
final
boolean
DBG
=
LatinImeLogger
.
sDBG
;
private
static
final
boolean
DBG
=
LatinImeLogger
.
sDBG
;
private
final
ViewGroup
mCandidatesPlacer
;
private
final
ViewGroup
mCandidatesStrip
;
private
final
ViewGroup
mCandidatesStrip
;
private
ViewGroup
mCandidatesPane
;
private
ViewGroup
mCandidatesPane
;
private
ViewGroup
mCandidatesPaneContainer
;
private
ViewGroup
mCandidatesPaneContainer
;
...
@@ -235,8 +236,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -235,8 +236,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
lastView
=
info
;
lastView
=
info
;
info
.
measure
(
WRAP_CONTENT
,
WRAP_CONTENT
);
info
.
measure
(
WRAP_CONTENT
,
WRAP_CONTENT
);
final
int
infoWidth
=
info
.
getMeasuredWidth
();
final
int
infoWidth
=
info
.
getMeasuredWidth
();
FrameLayoutCompatUtils
.
placeViewAt
(
info
,
x
-
infoWidth
,
y
,
infoWidth
,
FrameLayoutCompatUtils
.
placeViewAt
(
info
.
getMeasuredHeight
());
info
,
x
-
infoWidth
,
y
,
infoWidth
,
info
.
getMeasuredHeight
());
}
}
}
}
if
(
x
!=
0
)
{
if
(
x
!=
0
)
{
...
@@ -388,7 +389,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -388,7 +389,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
return
word
;
return
word
;
}
}
public
int
layout
(
SuggestedWords
suggestions
,
ViewGroup
stripView
,
ViewGroup
p
aneView
,
public
int
layout
(
SuggestedWords
suggestions
,
ViewGroup
stripView
,
ViewGroup
p
lacer
,
int
stripWidth
)
{
int
stripWidth
)
{
if
(
suggestions
.
isPunctuationSuggestions
())
{
if
(
suggestions
.
isPunctuationSuggestions
())
{
return
layoutPunctuationSuggestions
(
suggestions
,
stripView
);
return
layoutPunctuationSuggestions
(
suggestions
,
stripView
);
...
@@ -405,6 +406,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -405,6 +406,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
final
View
divider
=
mDividers
.
get
(
pos
);
final
View
divider
=
mDividers
.
get
(
pos
);
// Add divider if this isn't the left most suggestion in candidate strip.
// Add divider if this isn't the left most suggestion in candidate strip.
stripView
.
addView
(
divider
);
stripView
.
addView
(
divider
);
x
+=
divider
.
getMeasuredWidth
();
}
}
final
CharSequence
styled
=
mTexts
.
get
(
pos
);
final
CharSequence
styled
=
mTexts
.
get
(
pos
);
...
@@ -429,18 +431,19 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -429,18 +431,19 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
word
.
setTextScaleX
(
scaleX
);
word
.
setTextScaleX
(
scaleX
);
stripView
.
addView
(
word
);
stripView
.
addView
(
word
);
setLayoutWeight
(
word
,
getCandidateWeight
(
index
),
MATCH_PARENT
);
setLayoutWeight
(
word
,
getCandidateWeight
(
index
),
MATCH_PARENT
);
x
+=
word
.
getMeasuredWidth
();
if
(
DBG
)
{
if
(
DBG
)
{
final
CharSequence
debugInfo
=
getDebugInfo
(
suggestions
,
pos
);
final
CharSequence
debugInfo
=
getDebugInfo
(
suggestions
,
pos
);
if
(
debugInfo
!=
null
)
{
if
(
debugInfo
!=
null
)
{
final
TextView
info
=
mInfos
.
get
(
pos
);
final
TextView
info
=
mInfos
.
get
(
pos
);
info
.
setText
(
debugInfo
);
info
.
setText
(
debugInfo
);
p
aneView
.
addView
(
info
);
p
lacer
.
addView
(
info
);
info
.
measure
(
WRAP_CONTENT
,
WRAP_CONTENT
);
info
.
measure
(
WRAP_CONTENT
,
WRAP_CONTENT
);
final
int
infoWidth
=
info
.
getMeasuredWidth
();
final
int
infoWidth
=
info
.
getMeasuredWidth
();
final
int
y
=
info
.
getMeasuredHeight
();
final
int
y
=
info
.
getMeasuredHeight
();
FrameLayoutCompatUtils
.
placeViewAt
(
info
,
x
,
0
,
infoWidth
,
y
);
FrameLayoutCompatUtils
.
placeViewAt
(
x
+=
infoWidth
*
2
;
info
,
x
-
infoWidth
,
y
,
infoWidth
,
info
.
getMeasuredHeight
())
;
}
}
}
}
}
}
...
@@ -559,6 +562,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -559,6 +562,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
mPreviewPopup
.
setContentView
(
mPreviewText
);
mPreviewPopup
.
setContentView
(
mPreviewText
);
mPreviewPopup
.
setBackgroundDrawable
(
null
);
mPreviewPopup
.
setBackgroundDrawable
(
null
);
mCandidatesPlacer
=
(
ViewGroup
)
findViewById
(
R
.
id
.
candidates_placer
);
mCandidatesStrip
=
(
ViewGroup
)
findViewById
(
R
.
id
.
candidates_strip
);
mCandidatesStrip
=
(
ViewGroup
)
findViewById
(
R
.
id
.
candidates_strip
);
for
(
int
pos
=
0
;
pos
<
MAX_SUGGESTIONS
;
pos
++)
{
for
(
int
pos
=
0
;
pos
<
MAX_SUGGESTIONS
;
pos
++)
{
final
TextView
word
=
(
TextView
)
inflater
.
inflate
(
R
.
layout
.
candidate_word
,
null
);
final
TextView
word
=
(
TextView
)
inflater
.
inflate
(
R
.
layout
.
candidate_word
,
null
);
...
@@ -612,7 +616,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -612,7 +616,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
final
int
width
=
getWidth
();
final
int
width
=
getWidth
();
final
int
countInStrip
=
mStripParams
.
layout
(
final
int
countInStrip
=
mStripParams
.
layout
(
mSuggestions
,
mCandidatesStrip
,
mCandidatesP
ane
,
width
);
mSuggestions
,
mCandidatesStrip
,
mCandidatesP
lacer
,
width
);
mPaneParams
.
layout
(
mPaneParams
.
layout
(
mSuggestions
,
mCandidatesPane
,
countInStrip
,
mStripParams
.
getTextColor
(),
width
);
mSuggestions
,
mCandidatesPane
,
countInStrip
,
mStripParams
.
getTextColor
(),
width
);
}
}
...
@@ -774,6 +778,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
...
@@ -774,6 +778,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
public
void
clear
()
{
public
void
clear
()
{
mShowingAutoCorrectionInverted
=
false
;
mShowingAutoCorrectionInverted
=
false
;
mCandidatesPlacer
.
removeAllViews
();
mCandidatesPlacer
.
addView
(
mCandidatesStrip
);
mCandidatesStrip
.
removeAllViews
();
mCandidatesStrip
.
removeAllViews
();
mCandidatesPane
.
removeAllViews
();
mCandidatesPane
.
removeAllViews
();
closeCandidatesPane
();
closeCandidatesPane
();
...
...
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