Skip to content

Commit

Permalink
🔥 remove unused preferences & Services
Browse files Browse the repository at this point in the history
  • Loading branch information
Szzrain committed Jun 7, 2023
1 parent 9c4c040 commit ef5750f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 37 deletions.
19 changes: 0 additions & 19 deletions app/src/main/java/com/sealdice/dice/DimWakeLockService.kt

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/java/com/sealdice/dice/FirstFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,6 @@ class FirstFragment : Fragment() {
context.startService(intentWakelock)
executed = true
}
if (sharedPreferences.getBoolean("alive_heartbeat", false)) {
sharedPreferences.edit(commit = true) { putBoolean("alive_heartbeat", false) }
}
// if (sharedPreferences.getBoolean("alive_heartbeat", false)) {
// val intentHeartbeat = Intent(context, HeartbeatService::class.java)
// context.startService(intentHeartbeat)
// executed = true
// }
if (sharedPreferences.getBoolean("alive_floatwindow", false)) {
context.startService(Intent(context, FloatWindowService::class.java))
this.activity?.let {
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/java/com/sealdice/dice/SettingsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ package com.sealdice.dice

import android.content.SharedPreferences
import android.os.Bundle
import android.widget.SeekBar
import android.widget.SeekBar.OnSeekBarChangeListener
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SeekBarPreference
import androidx.preference.SwitchPreferenceCompat


class SettingsFragment : PreferenceFragmentCompat() {
private lateinit var sharedPreferences: SharedPreferences
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.prefrences, rootKey)
setPreferencesFromResource(R.xml.preferences, rootKey)
sharedPreferences = preferenceScreen.sharedPreferences!!
val mySeekBarPreference : SeekBarPreference? = findPreference<SeekBarPreference>("launch_waiting_time")
// val switchPreference: SwitchPreferenceCompat = findPreference("my_switch_preference")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
android:title="保活策略:悬浮窗"
android:summary="添加一个悬浮窗进行保活,第一次使用会跳转到权限设置"
android:defaultValue="false" />
<androidx.preference.SwitchPreferenceCompat
android:key="alive_heartbeat"
android:title="保活策略:心跳"
android:summary="通过定时发送心跳包保持存活\n根据反馈此策略效果不佳,将在后续版本移除"
android:enabled="false"
android:defaultValue="false" />
<androidx.preference.SwitchPreferenceCompat
android:key="alive_media"
android:title="保活策略:无声音频"
Expand Down

0 comments on commit ef5750f

Please sign in to comment.