package Ġcom . wil low tree . voc able . settings Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġcom . wil low tree . voc able . Base ViewModel Ċ import Ġcom . wil low tree . voc able . presets . Pre sets Repository Ċ import Ġcom . wil low tree . voc able . utils . V oc able SharedPreferences Ċ import Ġkotlinx . coroutines . launch Ċ import Ġorg . k oin . core . component . K oin Component Ċ import Ġorg . k oin . core . component . inject Ċ Ċ class ĠSettings ViewModel Ġ: ĠBase ViewModel (), ĠK oin Component Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġshared Prefs : ĠV oc able SharedPreferences Ġby Ġinject () ĊĠĠĠ Ġprivate Ġval Ġpresets Repository : ĠPre sets Repository Ġby Ġinject () ĊĊĠĠĠ Ġprivate Ġval Ġlive Head Tracking Enabled Ġ= ĠMutable LiveData < Boolean >() ĊĠĠĠ Ġval Ġhead Tracking Enabled : ĠLive Data < Boolean > Ġ= Ġlive Head Tracking Enabled ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġlive Head Tracking Enabled . post Value ( shared Prefs . get Head Tracking Enabled ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Head Tracking Checked ( isChecked : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġshared Prefs . set Head Tracking Enabled ( isChecked ) ĊĠĠĠĠĠĠĠ Ġlive Head Tracking Enabled . post Value ( isChecked ) ĊĠĠĠ Ġ} Ċ Ċ }