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
74671cf6
Commit
74671cf6
authored
13 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Resolve TODOs: add members to hold preferences
Change-Id: I34f6c76bf9318e1fbe8eb5ffab6772a98ff824e0
parent
0fe3611b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/SettingsValues.java
+9
-3
9 additions, 3 deletions
java/src/com/android/inputmethod/latin/SettingsValues.java
with
9 additions
and
3 deletions
java/src/com/android/inputmethod/latin/SettingsValues.java
+
9
−
3
View file @
74671cf6
...
...
@@ -59,8 +59,8 @@ public class SettingsValues {
// Prediction: use bigrams to predict the next word when there is no input for it yet
public
final
boolean
mBigramPredictionEnabled
;
public
final
boolean
mEnableSuggestionSpanInsertion
;
// TODO: add a member for the raw "pref_v
ibration
_d
uration
_s
ettings
" setting
// TODO: add a member for the raw "pref_k
eypress
_s
ound
_v
olume
" setting
private
final
int
mV
ibration
D
uration
S
ettings
RawValue
;
private
final
float
mK
eypress
S
ound
V
olume
RawValue
;
// Deduced settings
public
final
int
mKeypressVibrationDuration
;
...
...
@@ -120,7 +120,10 @@ public class SettingsValues {
mBigramPredictionEnabled
=
mBigramSuggestionEnabled
&&
isBigramPredictionEnabled
(
prefs
,
res
);
mEnableSuggestionSpanInsertion
=
prefs
.
getBoolean
(
Settings
.
PREF_KEY_ENABLE_SPAN_INSERT
,
true
);
prefs
.
getBoolean
(
Settings
.
PREF_KEY_ENABLE_SPAN_INSERT
,
true
);
mVibrationDurationSettingsRawValue
=
prefs
.
getInt
(
Settings
.
PREF_VIBRATION_DURATION_SETTINGS
,
-
1
);
mKeypressSoundVolumeRawValue
=
prefs
.
getFloat
(
Settings
.
PREF_KEYPRESS_SOUND_VOLUME
,
-
1.0f
);
// Compute other readable settings
mKeypressVibrationDuration
=
getCurrentVibrationDuration
(
prefs
,
res
);
...
...
@@ -280,6 +283,7 @@ public class SettingsValues {
// Accessed from the settings interface, hence public
public
static
float
getCurrentKeypressSoundVolume
(
final
SharedPreferences
sp
,
final
Resources
res
)
{
// TODO: use mVibrationDurationSettingsRawValue instead of reading it again here
final
float
volume
=
sp
.
getFloat
(
Settings
.
PREF_KEYPRESS_SOUND_VOLUME
,
-
1.0f
);
if
(
volume
>=
0
)
{
return
volume
;
...
...
@@ -298,6 +302,7 @@ public class SettingsValues {
// Likewise
public
static
int
getCurrentVibrationDuration
(
final
SharedPreferences
sp
,
final
Resources
res
)
{
// TODO: use mKeypressVibrationDuration instead of reading it again here
final
int
ms
=
sp
.
getInt
(
Settings
.
PREF_VIBRATION_DURATION_SETTINGS
,
-
1
);
if
(
ms
>=
0
)
{
return
ms
;
...
...
@@ -316,6 +321,7 @@ public class SettingsValues {
// Likewise
public
static
boolean
getUsabilityStudyMode
(
final
SharedPreferences
prefs
,
final
Resources
res
)
{
// TODO: use mUsabilityStudyMode instead of reading it again here
return
prefs
.
getBoolean
(
Settings
.
PREF_USABILITY_STUDY_MODE
,
true
);
}
}
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