Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Calendar
Commits
8bb13b84
Commit
8bb13b84
authored
15 years ago
by
Michael Chan
Browse files
Options
Download
Email Patches
Plain Diff
b/2293262 Add About section to Calendar Settings
Change-Id: I5f797b67bd4887b37949905d151a2409949090fc
parent
d52c59d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
res/values/strings.xml
res/values/strings.xml
+4
-0
res/xml/preferences.xml
res/xml/preferences.xml
+12
-4
src/com/android/calendar/CalendarPreferenceActivity.java
src/com/android/calendar/CalendarPreferenceActivity.java
+12
-1
No files found.
res/values/strings.xml
View file @
8bb13b84
...
...
@@ -369,4 +369,8 @@
<!-- Default value for the number of reminder minutes -->
<string
name=
"preferences_default_reminder_default"
>
10
</string>
<!-- This is the title of a section in the Settings screen for "About" this application -->
<string
name=
"preferences_about_title"
>
About
</string>
<!-- Build version of the application -->
<string
name=
"preferences_build_version"
>
Build version
</string>
</resources>
This diff is collapsed.
Click to expand it.
res/xml/preferences.xml
View file @
8bb13b84
...
...
@@ -21,7 +21,7 @@
android:defaultValue=
"false"
android:title=
"@string/preferences_hide_declined_title"
/>
</PreferenceCategory>
<PreferenceCategory
android:title=
"@string/preferences_alerts_title"
>
<ListPreference
android:key=
"preferences_alerts_type"
...
...
@@ -30,20 +30,20 @@
android:entries=
"@array/preferences_alert_type_labels"
android:entryValues=
"@array/preferences_alert_type_values"
android:dialogTitle=
"@string/preferences_alerts_type_dialog"
/>
<RingtonePreference
android:layout=
"?android:attr/preferenceLayoutChild"
android:key=
"preferences_alerts_ringtone"
android:title=
"@string/preferences_alerts_ringtone_title"
android:ringtoneType=
"notification"
android:defaultValue=
"content://settings/system/notification_sound"
/>
<CheckBoxPreference
android:layout=
"?android:attr/preferenceLayoutChild"
android:key=
"preferences_alerts_vibrate"
android:defaultValue=
"false"
android:title=
"@string/preferences_alerts_vibrate_title"
/>
<ListPreference
android:key=
"preferences_default_reminder"
android:defaultValue=
"@string/preferences_default_reminder_default"
...
...
@@ -52,4 +52,12 @@
android:entryValues=
"@array/preferences_default_reminder_values"
android:dialogTitle=
"@string/preferences_default_reminder_dialog"
/>
</PreferenceCategory>
<PreferenceCategory
android:title=
"@string/preferences_about_title"
>
<Preference
android:key=
"build_version"
android:title=
"@string/preferences_build_version"
/>
</PreferenceCategory>
</PreferenceScreen>
This diff is collapsed.
Click to expand it.
src/com/android/calendar/CalendarPreferenceActivity.java
View file @
8bb13b84
...
...
@@ -19,6 +19,8 @@ package com.android.calendar;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences.OnSharedPreferenceChangeListener
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageManager.NameNotFoundException
;
import
android.os.Bundle
;
import
android.preference.CheckBoxPreference
;
import
android.preference.ListPreference
;
...
...
@@ -28,6 +30,8 @@ import android.preference.PreferenceScreen;
import
android.preference.RingtonePreference
;
public
class
CalendarPreferenceActivity
extends
PreferenceActivity
implements
OnSharedPreferenceChangeListener
{
private
static
final
String
BUILD_VERSION
=
"build_version"
;
// The name of the shared preferences file. This name must be maintained for historical
// reasons, as it's what PreferenceManager assigned the first time the file was created.
private
static
final
String
SHARED_PREFS_NAME
=
"com.android.calendar_preferences"
;
...
...
@@ -75,7 +79,7 @@ public class CalendarPreferenceActivity extends PreferenceActivity implements On
// Make sure to always use the same preferences file regardless of the package name
// we're running under
getPreferenceManager
().
setSharedPreferencesName
(
SHARED_PREFS_NAME
);
// Load the preferences from an XML resource
addPreferencesFromResource
(
R
.
xml
.
preferences
);
...
...
@@ -85,6 +89,13 @@ public class CalendarPreferenceActivity extends PreferenceActivity implements On
mVibrate
=
(
CheckBoxPreference
)
preferenceScreen
.
findPreference
(
KEY_ALERTS_VIBRATE
);
mRingtone
=
(
RingtonePreference
)
preferenceScreen
.
findPreference
(
KEY_ALERTS_RINGTONE
);
try
{
PackageInfo
packageInfo
=
getPackageManager
().
getPackageInfo
(
getPackageName
(),
0
);
findPreference
(
BUILD_VERSION
).
setSummary
(
packageInfo
.
versionName
);
}
catch
(
NameNotFoundException
e
)
{
findPreference
(
BUILD_VERSION
).
setSummary
(
"?"
);
}
updateChildPreferences
();
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment