Cherish: Add Flashlight blink on incoming calls [3/3]

- Thanks to Shripal17 for suggesting list preference
  instead of a toggle
- Add a device specific flashlight check

idoybh edits: The current check is for isRingerAudiable and
not for DND - change var names and strings so it'll not mislead any
future developer or any user

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
PMS22
2018-06-19 20:49:26 +02:00
committed by Hưng Phan
parent 0dbc9b4130
commit 0132f3f7c9
3 changed files with 29 additions and 0 deletions

View File

@@ -334,5 +334,20 @@
<item>6</item>
<item>7</item>
</string-array>
<!-- Blink flashlight for incoming calls -->
<string-array name="flashlight_on_call_entries">
<item>@string/flashlight_on_call_disabled</item>
<item>@string/flashlight_on_call_ringer</item>
<item>@string/flashlight_on_call_silent</item>
<item>@string/flashlight_on_call_always</item>
</string-array>
<string-array name="flashlight_on_call_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
</resources>

View File

@@ -515,4 +515,11 @@
<string name="navigation_bar_layout_summary">Customize the layout of the navigation bar</string>
<string name="navigation_bar_arrow_keys_title">Show arrow keys while typing</string>
<string name="navigation_bar_arrow_keys_summary">Display left and right cursor buttons in navigation bar while typing</string>
<!-- Blink flashlight for incoming calls -->
<string name="flashlight_on_call_title">Blink Flashlight for call</string>
<string name="flashlight_on_call_disabled">Disabled</string>
<string name="flashlight_on_call_ringer">Only in ringer mode</string>
<string name="flashlight_on_call_silent">Only when ringer is silent</string>
<string name="flashlight_on_call_always">Always</string>
</resources>

View File

@@ -42,6 +42,13 @@
</PreferenceCategory>
<com.cherish.settings.preferences.SystemSettingListPreference
android:key="flashlight_on_call"
android:title="@string/flashlight_on_call_title"
android:entries="@array/flashlight_on_call_entries"
android:entryValues="@array/flashlight_on_call_values"
android:defaultValue="0" />
<PreferenceCategory
android:key="notifications_general_category"
android:title="@string/general_category">