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
ba76e6ff
Commit
ba76e6ff
authored
13 years ago
by
satok
Browse files
Options
Downloads
Patches
Plain Diff
Show the duration of vibration in settings
bug: 5345401 Change-Id: I666d48d8ddf6c14540eb401129c20ce93972d9cf
parent
9ee8c9c4
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
+15
-3
15 additions, 3 deletions
java/src/com/android/inputmethod/latin/Settings.java
with
15 additions
and
3 deletions
java/src/com/android/inputmethod/latin/Settings.java
+
15
−
3
View file @
ba76e6ff
...
...
@@ -328,6 +328,7 @@ public class Settings extends InputMethodSettingsActivity
}
private
PreferenceScreen
mInputLanguageSelection
;
private
PreferenceScreen
mVibrationDurationSettingsPref
;
private
ListPreference
mVoicePreference
;
private
CheckBoxPreference
mShowSettingsKeyPreference
;
private
ListPreference
mShowCorrectionSuggestionsPreference
;
...
...
@@ -483,10 +484,10 @@ public class Settings extends InputMethodSettingsActivity
}
}
final
PreferenceScreen
vib
rationSettingsPref
=
mVibrationDu
rationSettingsPref
=
(
PreferenceScreen
)
findPreference
(
PREF_VIBRATION_DURATION_SETTINGS
);
if
(
vib
rationSettingsPref
!=
null
)
{
vib
rationSettingsPref
.
setOnPreferenceClickListener
(
if
(
mVibrationDu
rationSettingsPref
!=
null
)
{
mVibrationDu
rationSettingsPref
.
setOnPreferenceClickListener
(
new
OnPreferenceClickListener
()
{
@Override
public
boolean
onPreferenceClick
(
Preference
arg0
)
{
...
...
@@ -494,6 +495,7 @@ public class Settings extends InputMethodSettingsActivity
return
true
;
}
});
updateVibrationDurationSettingsSummary
(
prefs
,
res
);
}
}
...
...
@@ -642,9 +644,18 @@ public class Settings extends InputMethodSettingsActivity
}
}
private
void
updateVibrationDurationSettingsSummary
(
SharedPreferences
sp
,
Resources
res
)
{
if
(
mVibrationDurationSettingsPref
!=
null
)
{
mVibrationDurationSettingsPref
.
setSummary
(
Utils
.
getCurrentVibrationDuration
(
sp
,
res
)
+
res
.
getString
(
R
.
string
.
settings_ms
));
}
}
private
void
showVibrationSettingsDialog
()
{
final
SharedPreferences
sp
=
getPreferenceManager
().
getSharedPreferences
();
final
Activity
context
=
getActivityInternal
();
final
Resources
res
=
context
.
getResources
();
final
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
context
);
builder
.
setTitle
(
R
.
string
.
prefs_vibration_duration_settings
);
builder
.
setPositiveButton
(
android
.
R
.
string
.
ok
,
new
DialogInterface
.
OnClickListener
()
{
...
...
@@ -652,6 +663,7 @@ public class Settings extends InputMethodSettingsActivity
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
final
int
ms
=
Integer
.
valueOf
(
mVibrationSettingsTextView
.
getText
().
toString
());
sp
.
edit
().
putInt
(
Settings
.
PREF_VIBRATION_DURATION_SETTINGS
,
ms
).
apply
();
updateVibrationDurationSettingsSummary
(
sp
,
res
);
}
});
builder
.
setNegativeButton
(
android
.
R
.
string
.
cancel
,
new
DialogInterface
.
OnClickListener
()
{
...
...
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