Skip to content

Commit

Permalink
Remove unused clinometer haptics
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Jan 21, 2024
1 parent 80e08bc commit 077915a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class ClinometerPreferences(private val context: Context) : IClinometerPreferenc
false
)

override val useHaptics = false

override val useAugmentedReality by BooleanPreference(
cache,
context.getString(R.string.pref_clinometer_use_ar),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ interface IClinometerPreferences {
var measureHeightInstructionsSent: Boolean
var measureDistanceInstructionsSent: Boolean
val useAugmentedReality: Boolean
val useHaptics: Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import com.kylecorry.trail_sense.databinding.FragmentClinometerBinding
import com.kylecorry.trail_sense.shared.*
import com.kylecorry.trail_sense.shared.CustomUiUtils.getPrimaryMarkerColor
import com.kylecorry.trail_sense.shared.DistanceUtils.toRelativeDistance
import com.kylecorry.trail_sense.shared.haptics.HapticSubsystem
import com.kylecorry.trail_sense.shared.permissions.alertNoCameraPermission
import com.kylecorry.trail_sense.shared.permissions.requestCamera
import com.kylecorry.trail_sense.shared.sensors.SensorService
Expand All @@ -59,11 +58,7 @@ class ClinometerFragment : BoundFragment<FragmentClinometerBinding>() {
private val prefs by lazy { UserPreferences(requireContext()) }
private val markdown by lazy { MarkdownService(requireContext()) }
private val formatter by lazy { FormatService.getInstance(requireContext()) }
private val feedback by lazy {
HapticSubsystem.getInstance(requireContext()).dial()
}
private val throttle = Throttle(20)
private val hapticsEnabled by lazy { prefs.clinometer.useHaptics }

private lateinit var clinometer: IClinometer

Expand Down Expand Up @@ -290,9 +285,6 @@ class ClinometerFragment : BoundFragment<FragmentClinometerBinding>() {
binding.camera.stop()
binding.arView.stop()
}
if (hapticsEnabled) {
feedback.stop()
}
}

override fun onDestroyView() {
Expand Down Expand Up @@ -342,10 +334,6 @@ class ClinometerFragment : BoundFragment<FragmentClinometerBinding>() {
val incline =
lockedIncline2 ?: (if (!isHolding) lockedIncline1 else null) ?: clinometer.incline

if (hapticsEnabled) {
feedback.angle = angle
}

val avalancheRisk = Geology.getAvalancheRisk(incline)

binding.clinometer.angle = angle
Expand Down

0 comments on commit 077915a

Please sign in to comment.