HeadsUp: add timeout option (2/2)

Forward ported to marshmallow/nougat By: @BeansTown106
removed the none option as we now have a headsup minimum time of 2seconds
added 5sec option as that is the new default in marshmallow

Signed-off-by: Arghya Chanda <arghyac35@gmail.com>
Change-Id: I6af7fef23f1cdb62390bd4bf8b81b5ca9bdb2a8d
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Lars Greiss
2016-11-03 15:02:19 +08:00
committed by Hưng Phan
parent 20e345c1c1
commit 32b2ed08c0
4 changed files with 75 additions and 1 deletions

View File

@@ -24,4 +24,22 @@
<item>1</item>
<item>2</item>
</string-array>
<!-- Heads up timeout -->
<string-array name="heads_up_time_out_entries" translatable="false">
<item>@string/heads_up_time_out_2sec</item>
<item>@string/heads_up_time_out_4sec</item>
<item>@string/heads_up_time_out_5sec</item>
<item>@string/heads_up_time_out_6sec</item>
<item>@string/heads_up_time_out_8sec</item>
<item>@string/heads_up_time_out_10sec</item>
</string-array>
<string-array name="heads_up_time_out_values" translatable="false">
<item>2000</item>
<item>4000</item>
<item>5000</item>
<item>6000</item>
<item>8000</item>
<item>10000</item>
</string-array>
</resources>

View File

@@ -203,4 +203,14 @@
<string name="dialog_delete_title">Delete</string>
<string name="dialog_delete_message">Remove selected item?</string>
<!-- Heads up timeout -->
<string name="heads_up_time_out_title">Time out</string>
<string name="heads_up_time_out_summary">Peeking notifications will show for <xliff:g id="number">%d</xliff:g> seconds</string>
<string name="heads_up_time_out_2sec">2 seconds</string>
<string name="heads_up_time_out_4sec">4 seconds</string>
<string name="heads_up_time_out_5sec">5 seconds</string>
<string name="heads_up_time_out_6sec">6 seconds</string>
<string name="heads_up_time_out_8sec">8 seconds</string>
<string name="heads_up_time_out_10sec">10 seconds</string>
</resources>

View File

@@ -22,6 +22,13 @@
android:summaryOff="@string/summary_heads_up_disabled"
android:defaultValue="true" />
<ListPreference
android:key="heads_up_time_out"
android:title="@string/heads_up_time_out_title"
android:entries="@array/heads_up_time_out_entries"
android:entryValues="@array/heads_up_time_out_values"
android:persistent="false" />
<PreferenceCategory
android:title="@string/heads_up_stoplist_title"
android:key="stoplist_applications"