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
681184d1
Commit
681184d1
authored
12 years ago
by
Ken Wakasa
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Remove "Key popup dismiss delay" when "Popup on keypress" is suppressed"
parents
30dd5588
9f78eed4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/Settings.java
+28
-23
28 additions, 23 deletions
java/src/com/android/inputmethod/latin/Settings.java
with
28 additions
and
23 deletions
java/src/com/android/inputmethod/latin/Settings.java
+
28
−
23
View file @
681184d1
...
@@ -143,19 +143,39 @@ public class Settings extends InputMethodSettingsFragment
...
@@ -143,19 +143,39 @@ public class Settings extends InputMethodSettingsFragment
generalSettings
.
removePreference
(
mVoicePreference
);
generalSettings
.
removePreference
(
mVoicePreference
);
}
}
final
PreferenceGroup
advancedSettings
=
(
PreferenceGroup
)
findPreference
(
PREF_ADVANCED_SETTINGS
);
if
(!
VibratorUtils
.
getInstance
(
context
).
hasVibrator
())
{
if
(!
VibratorUtils
.
getInstance
(
context
).
hasVibrator
())
{
final
PreferenceGroup
advancedSettings
=
(
PreferenceGroup
)
findPreference
(
PREF_ADVANCED_SETTINGS
);
generalSettings
.
removePreference
(
findPreference
(
PREF_VIBRATE_ON
));
generalSettings
.
removePreference
(
findPreference
(
PREF_VIBRATE_ON
));
if
(
null
!=
advancedSettings
)
{
// Theoretically advancedSettings cannot be null
if
(
null
!=
advancedSettings
)
{
// Theoretically advancedSettings cannot be null
advancedSettings
.
removePreference
(
findPreference
(
PREF_VIBRATION_DURATION_SETTINGS
));
advancedSettings
.
removePreference
(
findPreference
(
PREF_VIBRATION_DURATION_SETTINGS
));
}
}
}
}
final
boolean
showPopupOption
=
res
.
getBoolean
(
final
boolean
show
KeyPreview
PopupOption
=
res
.
getBoolean
(
R
.
bool
.
config_enable_show_popup_on_keypress_option
);
R
.
bool
.
config_enable_show_popup_on_keypress_option
);
if
(!
showPopupOption
)
{
mKeyPreviewPopupDismissDelay
=
(
ListPreference
)
findPreference
(
PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY
);
if
(!
showKeyPreviewPopupOption
)
{
generalSettings
.
removePreference
(
findPreference
(
PREF_POPUP_ON
));
generalSettings
.
removePreference
(
findPreference
(
PREF_POPUP_ON
));
if
(
null
!=
advancedSettings
)
{
// Theoretically advancedSettings cannot be null
advancedSettings
.
removePreference
(
mKeyPreviewPopupDismissDelay
);
}
}
else
{
final
String
[]
entries
=
new
String
[]
{
res
.
getString
(
R
.
string
.
key_preview_popup_dismiss_no_delay
),
res
.
getString
(
R
.
string
.
key_preview_popup_dismiss_default_delay
),
};
final
String
popupDismissDelayDefaultValue
=
Integer
.
toString
(
res
.
getInteger
(
R
.
integer
.
config_key_preview_linger_timeout
));
mKeyPreviewPopupDismissDelay
.
setEntries
(
entries
);
mKeyPreviewPopupDismissDelay
.
setEntryValues
(
new
String
[]
{
"0"
,
popupDismissDelayDefaultValue
});
if
(
null
==
mKeyPreviewPopupDismissDelay
.
getValue
())
{
mKeyPreviewPopupDismissDelay
.
setValue
(
popupDismissDelayDefaultValue
);
}
mKeyPreviewPopupDismissDelay
.
setEnabled
(
SettingsValues
.
isKeyPreviewPopupEnabled
(
prefs
,
res
));
}
}
final
CheckBoxPreference
includeOtherImesInLanguageSwitchList
=
final
CheckBoxPreference
includeOtherImesInLanguageSwitchList
=
...
@@ -163,23 +183,6 @@ public class Settings extends InputMethodSettingsFragment
...
@@ -163,23 +183,6 @@ public class Settings extends InputMethodSettingsFragment
includeOtherImesInLanguageSwitchList
.
setEnabled
(
includeOtherImesInLanguageSwitchList
.
setEnabled
(
!
SettingsValues
.
isLanguageSwitchKeySupressed
(
prefs
));
!
SettingsValues
.
isLanguageSwitchKeySupressed
(
prefs
));
mKeyPreviewPopupDismissDelay
=
(
ListPreference
)
findPreference
(
PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY
);
final
String
[]
entries
=
new
String
[]
{
res
.
getString
(
R
.
string
.
key_preview_popup_dismiss_no_delay
),
res
.
getString
(
R
.
string
.
key_preview_popup_dismiss_default_delay
),
};
final
String
popupDismissDelayDefaultValue
=
Integer
.
toString
(
res
.
getInteger
(
R
.
integer
.
config_key_preview_linger_timeout
));
mKeyPreviewPopupDismissDelay
.
setEntries
(
entries
);
mKeyPreviewPopupDismissDelay
.
setEntryValues
(
new
String
[]
{
"0"
,
popupDismissDelayDefaultValue
});
if
(
null
==
mKeyPreviewPopupDismissDelay
.
getValue
())
{
mKeyPreviewPopupDismissDelay
.
setValue
(
popupDismissDelayDefaultValue
);
}
mKeyPreviewPopupDismissDelay
.
setEnabled
(
SettingsValues
.
isKeyPreviewPopupEnabled
(
prefs
,
res
));
final
PreferenceScreen
dictionaryLink
=
final
PreferenceScreen
dictionaryLink
=
(
PreferenceScreen
)
findPreference
(
PREF_CONFIGURE_DICTIONARIES_KEY
);
(
PreferenceScreen
)
findPreference
(
PREF_CONFIGURE_DICTIONARIES_KEY
);
final
Intent
intent
=
dictionaryLink
.
getIntent
();
final
Intent
intent
=
dictionaryLink
.
getIntent
();
...
@@ -305,13 +308,15 @@ public class Settings extends InputMethodSettingsFragment
...
@@ -305,13 +308,15 @@ public class Settings extends InputMethodSettingsFragment
private
void
updateKeyPreviewPopupDelaySummary
()
{
private
void
updateKeyPreviewPopupDelaySummary
()
{
final
ListPreference
lp
=
mKeyPreviewPopupDismissDelay
;
final
ListPreference
lp
=
mKeyPreviewPopupDismissDelay
;
lp
.
setSummary
(
lp
.
getEntries
()[
lp
.
findIndexOfValue
(
lp
.
getValue
())]);
final
CharSequence
[]
entries
=
lp
.
getEntries
();
if
(
entries
==
null
||
entries
.
length
<=
0
)
return
;
lp
.
setSummary
(
entries
[
lp
.
findIndexOfValue
(
lp
.
getValue
())]);
}
}
private
void
updateVoiceModeSummary
()
{
private
void
updateVoiceModeSummary
()
{
mVoicePreference
.
setSummary
(
mVoicePreference
.
setSummary
(
getResources
().
getStringArray
(
R
.
array
.
voice_input_modes_summary
)
getResources
().
getStringArray
(
R
.
array
.
voice_input_modes_summary
)
[
mVoicePreference
.
findIndexOfValue
(
mVoicePreference
.
getValue
())]);
[
mVoicePreference
.
findIndexOfValue
(
mVoicePreference
.
getValue
())]);
}
}
private
void
refreshEnablingsOfKeypressSoundAndVibrationSettings
(
private
void
refreshEnablingsOfKeypressSoundAndVibrationSettings
(
...
...
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