mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Remove pref_led_notifications
This commit is contained in:
@@ -25,7 +25,6 @@ import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory.decodeResource
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.Build.VERSION.SDK_INT
|
||||
import android.util.Log
|
||||
@@ -150,9 +149,6 @@ class AndroidNotificationTray
|
||||
if (!disableSound)
|
||||
builder.setSound(ringtoneManager.getURI())
|
||||
|
||||
if (preferences.shouldMakeNotificationsLed())
|
||||
builder.setLights(Color.RED, 1000, 1000)
|
||||
|
||||
if (SDK_INT < Build.VERSION_CODES.S) {
|
||||
val snoozeAction = Action(
|
||||
R.drawable.ic_action_snooze,
|
||||
|
||||
@@ -90,8 +90,6 @@ class SharedPreferencesStorage
|
||||
preferences.isMidnightDelayEnabled = getBoolean(key, false)
|
||||
"pref_sticky_notifications" ->
|
||||
preferences.setNotificationsSticky(getBoolean(key, false))
|
||||
"pref_led_notifications" ->
|
||||
preferences.setNotificationsLed(getBoolean(key, false))
|
||||
"pref_unknown_enabled" -> {
|
||||
preferences.areQuestionMarksEnabled = getBoolean(key, false)
|
||||
}
|
||||
|
||||
@@ -99,13 +99,6 @@
|
||||
android:title="@string/sticky_notifications"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pref_led_notifications"
|
||||
android:summary="@string/led_notifications_description"
|
||||
android:title="@string/led_notifications"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<Preference
|
||||
android:key="reminderCustomize"
|
||||
android:summary="@string/customize_notification_summary"
|
||||
|
||||
@@ -152,19 +152,10 @@ open class Preferences(private val storage: Storage) {
|
||||
for (l in listeners) l.onNotificationsChanged()
|
||||
}
|
||||
|
||||
fun setNotificationsLed(enabled: Boolean) {
|
||||
storage.putBoolean("pref_led_notifications", enabled)
|
||||
for (l in listeners) l.onNotificationsChanged()
|
||||
}
|
||||
|
||||
fun shouldMakeNotificationsSticky(): Boolean {
|
||||
return storage.getBoolean("pref_sticky_notifications", false)
|
||||
}
|
||||
|
||||
fun shouldMakeNotificationsLed(): Boolean {
|
||||
return storage.getBoolean("pref_led_notifications", false)
|
||||
}
|
||||
|
||||
open var isCheckmarkSequenceReversed: Boolean
|
||||
get() {
|
||||
if (shouldReverseCheckmarks == null) shouldReverseCheckmarks =
|
||||
|
||||
@@ -116,9 +116,6 @@ class PreferencesTest : BaseUnitTest() {
|
||||
assertFalse(prefs.shouldMakeNotificationsSticky())
|
||||
prefs.setNotificationsSticky(true)
|
||||
assertTrue(prefs.shouldMakeNotificationsSticky())
|
||||
assertFalse(prefs.shouldMakeNotificationsLed())
|
||||
prefs.setNotificationsLed(true)
|
||||
assertTrue(prefs.shouldMakeNotificationsLed())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user