Imported SettingsActivity and related classes

This commit is contained in:
Phillip Hsu
2016-06-06 19:49:39 -07:00
parent c4cd333cf7
commit a4bfce7874
11 changed files with 311 additions and 10 deletions
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.philliphsu.clock2.settings.SettingsActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
<include layout="@layout/content_settings"/>
</merge>
@@ -0,0 +1,6 @@
<fragment android:id="@+id/fragment"
android:name="com.philliphsu.clock2.settings.SettingsFragment"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize" />
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Silence after -->
<string name="key_silence_after">key_silence_after</string>
<string name="title_silence_after">Silence after</string>
<!-- Durations for silence after & snooze duration -->
<string-array name="entries_duration">
<item>1 minute</item>
<item>5 minutes</item>
<item>10 minutes</item>
<item>15 minutes</item>
<item>20 minutes</item>
<item>25 minutes</item>
<item>30 minutes</item>
</string-array>
<string-array name="values_duration">
<item>1</item>
<item>5</item>
<item>10</item>
<item>15</item>
<item>20</item>
<item>25</item>
<item>30</item>
</string-array>
<!-- Alarm volume -->
<string name="key_alarm_volume">key_alarm_volume</string>
<string name="title_alarm_volume">Alarm volume</string>
<!-- Upcoming alarm threshold -->
<string name="key_notify_me_of_upcoming_alarms">key_notify_me_of_upcoming_alarms</string>
<string name="title_notify_me_of_upcoming_alarms">Notify me of upcoming alarms</string>
<string-array name="entries_notify_me_of_upcoming_alarms">
<item>1 hour before</item>
<item>2 hours before</item>
<item>3 hours before</item>
<item>4 hours before</item>
<item>5 hours before</item>
<item>6 hours before</item>
<item>7 hours before</item>
<item>8 hours before</item>
</string-array>
<string-array name="values_notify_me_of_upcoming_alarms">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
</string-array>
</resources>
+35
View File
@@ -49,6 +49,41 @@
<string name="snackbar_undo_item_deleted">Undo</string>
<!-- ======================================================================================= -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<string name="title_activity_settings">Settings</string>
<!-- World Clock -->
<string name="pref_category_world_clock">World Clock</string>
<string name="pref_show_time_offsets_from">Show time offsets from</string>
<string name="pref_show_time_offsets_from_local">Local time</string>
<string name="pref_show_time_offsets_from_gmt">GMT</string>
<string-array name="pref_show_time_offsets_from_array">
<item>@string/pref_show_time_offsets_from_local</item>
<item>@string/pref_show_time_offsets_from_gmt</item>
</string-array>
<!-- Alarms -->
<string name="pref_category_alarms">Alarms</string>
<string name="pref_time_picker_style">Time picker style</string>
<string name="pref_time_picker_style_number_pad">Number pad</string>
<string name="pref_time_picker_style_radial_clock">Radial clock</string>
<string-array name="pref_time_picker_style_array">
<item>@string/pref_time_picker_style_number_pad</item>
<item>@string/pref_time_picker_style_radial_clock</item>
</string-array>
<string name="pref_snooze_duration">Snooze duration</string>
<string name="pref_first_day_of_week">First day of week</string>
<string name="pref_first_day_of_week_saturday">Saturday</string>
<string name="pref_first_day_of_week_sunday">Sunday</string>
<string name="pref_first_day_of_week_monday">Monday</string>
<string-array name="pref_first_day_of_week_array">
<item>@string/pref_first_day_of_week_saturday</item>
<item>@string/pref_first_day_of_week_sunday</item>
<item>@string/pref_first_day_of_week_monday</item>
</string-array>
<!-- Timers -->
<string name="pref_category_timers">Timers</string>
<string name="pref_timer_ringtone">Ringtone</string>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<string name="sun">Sun</string>
<string name="mon">Mon</string>
<string name="tue">Tue</string>
+1 -6
View File
@@ -1,18 +1,13 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory android:title="@string/pref_category_world_clock">
<ListPreference
android:key="pref_show_time_offsets_from"
android:title="@string/pref_show_time_offsets_from"
android:dialogTitle="@string/pref_show_time_offsets_from"
android:entries="@array/pref_show_time_offsets_from_array"
android:entryValues="@array/pref_show_time_offsets_from_array"
android:defaultValue="@string/pref_show_time_offsets_from_local"
android:summary="%s"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_category_alarms">
<ListPreference
android:key="pref_time_picker_style"
android:title="@string/pref_time_picker_style"
android:dialogTitle="@string/pref_time_picker_style"
android:entries="@array/pref_time_picker_style_array"
android:entryValues="@array/pref_time_picker_style_array"
android:defaultValue="@string/pref_time_picker_style_number_pad"
android:summary="%s"/>
<ListPreference
android:key="@string/key_silence_after"
android:title="@string/title_silence_after"
android:dialogTitle="@string/title_silence_after"
android:entries="@array/entries_duration"
android:entryValues="@array/values_duration"
android:defaultValue="1"
android:summary="%s"/>
<ListPreference
android:key="pref_snooze_duration"
android:title="@string/pref_snooze_duration"
android:dialogTitle="@string/pref_snooze_duration"
android:entries="@array/entries_duration"
android:entryValues="@array/values_duration"
android:defaultValue="1"
android:summary="%s"/>
<Preference
android:key="@string/key_alarm_volume"
android:title="@string/title_alarm_volume"/>
<ListPreference
android:key="@string/key_notify_me_of_upcoming_alarms"
android:title="@string/title_notify_me_of_upcoming_alarms"
android:dialogTitle="@string/title_notify_me_of_upcoming_alarms"
android:entries="@array/entries_notify_me_of_upcoming_alarms"
android:entryValues="@array/values_notify_me_of_upcoming_alarms"
android:defaultValue="2"
android:summary="%s"/>
<ListPreference
android:key="pref_first_day_of_week"
android:title="@string/pref_first_day_of_week"
android:dialogTitle="@string/pref_first_day_of_week"
android:entries="@array/pref_first_day_of_week_array"
android:entryValues="@array/pref_first_day_of_week_array"
android:defaultValue="@string/pref_first_day_of_week_sunday"
android:summary="%s"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_category_timers">
<RingtonePreference
android:key="pref_timer_ringtone"
android:title="@string/pref_timer_ringtone"
android:ringtoneType="alarm"
android:defaultValue="content://settings/system/alarm_alert"/>
</PreferenceCategory>
</PreferenceScreen>