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
8bf93c4b
Commit
8bf93c4b
authored
14 years ago
by
Tadashi G. Takaoka
Committed by
Android (Google) Code Review
14 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Introduce timeout for "." shortcut"
parents
7e99a28d
fc20f219
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/res/values/config.xml
+1
-0
1 addition, 0 deletions
java/res/values/config.xml
java/src/com/android/inputmethod/latin/LatinIME.java
+23
-2
23 additions, 2 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
with
24 additions
and
2 deletions
java/res/values/config.xml
+
1
−
0
View file @
8bf93c4b
...
@@ -60,6 +60,7 @@
...
@@ -60,6 +60,7 @@
<integer
name=
"config_long_press_key_timeout"
>
400
</integer>
<integer
name=
"config_long_press_key_timeout"
>
400
</integer>
<integer
name=
"config_long_press_shift_key_timeout"
>
1200
</integer>
<integer
name=
"config_long_press_shift_key_timeout"
>
1200
</integer>
<integer
name=
"config_touch_noise_threshold_millis"
>
40
</integer>
<integer
name=
"config_touch_noise_threshold_millis"
>
40
</integer>
<integer
name=
"config_double_spaces_turn_into_period_timeout"
>
1100
</integer>
<dimen
name=
"config_touch_noise_threshold_distance"
>
2.0mm
</dimen>
<dimen
name=
"config_touch_noise_threshold_distance"
>
2.0mm
</dimen>
<!-- This configuration is the index of the array {@link KeyboardSwitcher.KEYBOARD_THEMES}. -->
<!-- This configuration is the index of the array {@link KeyboardSwitcher.KEYBOARD_THEMES}. -->
<string
name=
"config_default_keyboard_theme_id"
translatable=
"false"
>
4
</string>
<string
name=
"config_default_keyboard_theme_id"
translatable=
"false"
>
4
</string>
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/LatinIME.java
+
23
−
2
View file @
8bf93c4b
...
@@ -181,6 +181,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -181,6 +181,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private
int
mConfigDelayBeforeFadeoutLanguageOnSpacebar
;
private
int
mConfigDelayBeforeFadeoutLanguageOnSpacebar
;
private
int
mConfigDurationOfFadeoutLanguageOnSpacebar
;
private
int
mConfigDurationOfFadeoutLanguageOnSpacebar
;
private
float
mConfigFinalFadeoutFactorOfLanguageOnSpacebar
;
private
float
mConfigFinalFadeoutFactorOfLanguageOnSpacebar
;
private
long
mConfigDoubleSpacesTurnIntoPeriodTimeout
;
private
int
mCorrectionMode
;
private
int
mCorrectionMode
;
private
int
mCommittedLength
;
private
int
mCommittedLength
;
...
@@ -269,6 +270,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -269,6 +270,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private
static
final
int
MSG_VOICE_RESULTS
=
3
;
private
static
final
int
MSG_VOICE_RESULTS
=
3
;
private
static
final
int
MSG_FADEOUT_LANGUAGE_ON_SPACEBAR
=
4
;
private
static
final
int
MSG_FADEOUT_LANGUAGE_ON_SPACEBAR
=
4
;
private
static
final
int
MSG_DISMISS_LANGUAGE_ON_SPACEBAR
=
5
;
private
static
final
int
MSG_DISMISS_LANGUAGE_ON_SPACEBAR
=
5
;
private
static
final
int
MSG_SPACE_TYPED
=
6
;
@Override
@Override
public
void
handleMessage
(
Message
msg
)
{
public
void
handleMessage
(
Message
msg
)
{
...
@@ -357,6 +359,20 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -357,6 +359,20 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
}
}
}
}
public
void
startDoubleSpacesTimer
()
{
removeMessages
(
MSG_SPACE_TYPED
);
sendMessageDelayed
(
obtainMessage
(
MSG_SPACE_TYPED
),
mConfigDoubleSpacesTurnIntoPeriodTimeout
);
}
public
void
cancelDoubleSpacesTimer
()
{
removeMessages
(
MSG_SPACE_TYPED
);
}
public
boolean
isAcceptingDoubleSpaces
()
{
return
hasMessages
(
MSG_SPACE_TYPED
);
}
}
}
@Override
@Override
...
@@ -398,6 +414,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -398,6 +414,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
R
.
integer
.
config_duration_of_fadeout_language_on_spacebar
);
R
.
integer
.
config_duration_of_fadeout_language_on_spacebar
);
mConfigFinalFadeoutFactorOfLanguageOnSpacebar
=
res
.
getInteger
(
mConfigFinalFadeoutFactorOfLanguageOnSpacebar
=
res
.
getInteger
(
R
.
integer
.
config_final_fadeout_percentage_of_language_on_spacebar
)
/
100.0f
;
R
.
integer
.
config_final_fadeout_percentage_of_language_on_spacebar
)
/
100.0f
;
mConfigDoubleSpacesTurnIntoPeriodTimeout
=
res
.
getInteger
(
R
.
integer
.
config_double_spaces_turn_into_period_timeout
);
Utils
.
GCUtils
.
getInstance
().
reset
();
Utils
.
GCUtils
.
getInstance
().
reset
();
boolean
tryGC
=
true
;
boolean
tryGC
=
true
;
...
@@ -1004,7 +1022,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -1004,7 +1022,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
private
void
doubleSpace
()
{
private
void
doubleSpace
()
{
//if (!mAutoPunctuate) return;
if
(
mCorrectionMode
==
Suggest
.
CORRECTION_NONE
)
return
;
if
(
mCorrectionMode
==
Suggest
.
CORRECTION_NONE
)
return
;
final
InputConnection
ic
=
getCurrentInputConnection
();
final
InputConnection
ic
=
getCurrentInputConnection
();
if
(
ic
==
null
)
return
;
if
(
ic
==
null
)
return
;
...
@@ -1012,13 +1029,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
...
@@ -1012,13 +1029,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if
(
lastThree
!=
null
&&
lastThree
.
length
()
==
3
if
(
lastThree
!=
null
&&
lastThree
.
length
()
==
3
&&
Character
.
isLetterOrDigit
(
lastThree
.
charAt
(
0
))
&&
Character
.
isLetterOrDigit
(
lastThree
.
charAt
(
0
))
&&
lastThree
.
charAt
(
1
)
==
Keyboard
.
CODE_SPACE
&&
lastThree
.
charAt
(
1
)
==
Keyboard
.
CODE_SPACE
&&
lastThree
.
charAt
(
2
)
==
Keyboard
.
CODE_SPACE
)
{
&&
lastThree
.
charAt
(
2
)
==
Keyboard
.
CODE_SPACE
&&
mHandler
.
isAcceptingDoubleSpaces
())
{
mHandler
.
cancelDoubleSpacesTimer
();
ic
.
beginBatchEdit
();
ic
.
beginBatchEdit
();
ic
.
deleteSurroundingText
(
2
,
0
);
ic
.
deleteSurroundingText
(
2
,
0
);
ic
.
commitText
(
". "
,
1
);
ic
.
commitText
(
". "
,
1
);
ic
.
endBatchEdit
();
ic
.
endBatchEdit
();
mKeyboardSwitcher
.
updateShiftState
();
mKeyboardSwitcher
.
updateShiftState
();
mJustAddedAutoSpace
=
true
;
mJustAddedAutoSpace
=
true
;
}
else
{
mHandler
.
startDoubleSpacesTimer
();
}
}
}
}
...
...
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