@@ -39,14 +39,11 @@ import androidx.compose.material3.ExperimentalMaterial3Api
3939import androidx.compose.material3.MaterialTheme
4040import androidx.compose.material3.Scaffold
4141import androidx.compose.runtime.Composable
42- import androidx.compose.runtime.CompositionLocalProvider
4342import androidx.compose.runtime.LaunchedEffect
4443import androidx.compose.runtime.getValue
4544import androidx.compose.runtime.mutableStateOf
46- import androidx.compose.runtime.rememberCoroutineScope
4745import androidx.compose.runtime.setValue
4846import androidx.compose.ui.Modifier
49- import androidx.compose.ui.graphics.Color
5047import androidx.compose.ui.graphics.graphicsLayer
5148import androidx.compose.ui.hapticfeedback.HapticFeedbackType
5249import androidx.compose.ui.platform.LocalContext
@@ -66,6 +63,11 @@ import kotlinx.coroutines.launch
6663import rikka.shizuku.Shizuku
6764import kotlin.math.absoluteValue
6865import androidx.core.content.edit
66+ import com.better.nothing.music.vizualizer.ui.PrimaryScreens.AudioScreen
67+ import com.better.nothing.music.vizualizer.ui.PrimaryScreens.FlashlightScreen
68+ import com.better.nothing.music.vizualizer.ui.PrimaryScreens.GlyphsScreen
69+ import com.better.nothing.music.vizualizer.ui.PrimaryScreens.HapticsScreen
70+ import com.better.nothing.music.vizualizer.ui.PrimaryScreens.SettingsScreen
6971
7072class MainActivity : ComponentActivity () {
7173 private val viewModel: MainViewModel by viewModels()
@@ -719,7 +721,8 @@ internal fun BetterVizApp(
719721 onLatencyPresetsChanged = { viewModel.updateLatencyPresets(it) },
720722 autoDeviceEnabled = autoDeviceEnabled,
721723 onAutoDeviceToggle = { viewModel.setAutoDeviceMemorize(it) },
722- connectedDeviceName = MainActivity .serviceStatic?.getActiveAudioRouteKey() ? : " Unknown" ,
724+ connectedDeviceName = MainActivity .serviceStatic?.getActiveAudioRouteKey()
725+ ? : " Unknown" ,
723726 fftData = fftData,
724727 captureSource = captureSource,
725728 onCaptureSourceChanged = { viewModel.setCaptureSource(it) },
@@ -737,7 +740,11 @@ internal fun BetterVizApp(
737740
738741 GlyphsScreen (
739742 gammaValue = gammaValue,
740- onGammaChanged = { viewModel.setGammaValue(it); viewModel.persistGamma(it) },
743+ onGammaChanged = {
744+ viewModel.setGammaValue(it); viewModel.persistGamma(
745+ it
746+ )
747+ },
741748 maxBrightness = maxBrightness,
742749 onMaxBrightnessChanged = { viewModel.setMaxBrightness(it) },
743750 presets = presets,
@@ -762,20 +769,33 @@ internal fun BetterVizApp(
762769
763770 HapticsScreen (
764771 hapticMotorEnabled = hapticMotorEnabled,
765- onHapticMotorEnabledChanged = { viewModel.setHapticMotorEnabled(it) },
772+ onHapticMotorEnabledChanged = {
773+ viewModel.setHapticMotorEnabled(
774+ it
775+ )
776+ },
766777 hapticMode = hapticMode,
767778 onHapticModeChanged = { viewModel.setHapticMode(it) },
768779 hapticFreqMin = hapticFreqMin,
769780 hapticFreqMax = hapticFreqMax,
770- onHapticFreqRangeChanged = { min, max -> viewModel.setHapticFreqRange(min, max) },
781+ onHapticFreqRangeChanged = { min, max ->
782+ viewModel.setHapticFreqRange(
783+ min,
784+ max
785+ )
786+ },
771787 hapticMultiplier = hapticMultiplier,
772788 onHapticMultiplierChanged = { viewModel.setHapticMultiplier(it) },
773789 hapticAudioGain = hapticAudioGain,
774790 onHapticAudioGainChanged = { viewModel.setHapticAudioGain(it) },
775791 hapticGamma = hapticGamma,
776792 onHapticGammaChanged = { viewModel.setHapticGamma(it) },
777793 hapticBeatSensitivity = hapticBeatSensitivity,
778- onHapticBeatSensitivityChanged = { viewModel.setHapticBeatSensitivity(it) },
794+ onHapticBeatSensitivityChanged = {
795+ viewModel.setHapticBeatSensitivity(
796+ it
797+ )
798+ },
779799 hapticBeatGamma = hapticBeatGamma,
780800 onHapticBeatGammaChanged = { viewModel.setHapticBeatGamma(it) },
781801 hapticAmplitudeProvider = { viewModel.hapticAmplitude.value },
@@ -800,13 +820,26 @@ internal fun BetterVizApp(
800820 onFlashlightModeChanged = { viewModel.setFlashlightMode(it) },
801821 flashlightFreqMin = flashlightFreqMin,
802822 flashlightFreqMax = flashlightFreqMax,
803- onFlashlightFreqRangeChanged = { min, max -> viewModel.setFlashlightFreqRange(min, max) },
823+ onFlashlightFreqRangeChanged = { min, max ->
824+ viewModel.setFlashlightFreqRange(
825+ min,
826+ max
827+ )
828+ },
804829 flashlightThreshold = flashlightThreshold,
805- onFlashlightThresholdChanged = { viewModel.setFlashlightThreshold(it) },
830+ onFlashlightThresholdChanged = {
831+ viewModel.setFlashlightThreshold(
832+ it
833+ )
834+ },
806835 flashlightSpeedMs = flashlightSpeedMs,
807836 onFlashlightSpeedMsChanged = { viewModel.setFlashlightSpeedMs(it) },
808837 flashlightBeatSensitivity = flashlightBeatSensitivity,
809- onFlashlightBeatSensitivityChanged = { viewModel.setFlashlightBeatSensitivity(it) },
838+ onFlashlightBeatSensitivityChanged = {
839+ viewModel.setFlashlightBeatSensitivity(
840+ it
841+ )
842+ },
810843 flashlightIntensityLevels = flashlightIntensityLevels,
811844 flashlightAmplitudeProvider = { viewModel.flashlightAmplitude.value },
812845 isBeatDetectedProvider = { isFlashlightBeatDetected }
@@ -823,15 +856,27 @@ internal fun BetterVizApp(
823856 SettingsScreen (
824857 viewModel = viewModel,
825858 idleBreathingEnabled = idleBreathingEnabled,
826- onIdleBreathingEnabledChanged = { viewModel.setIdleBreathingEnabled(it) },
859+ onIdleBreathingEnabledChanged = {
860+ viewModel.setIdleBreathingEnabled(
861+ it
862+ )
863+ },
827864 idlePattern = idlePattern,
828865 onIdlePatternChanged = { viewModel.setIdlePattern(it) },
829866 notificationFlashEnabled = notificationFlashEnabled,
830- onNotificationFlashEnabledChanged = { viewModel.setNotificationFlashEnabled(it) },
867+ onNotificationFlashEnabledChanged = {
868+ viewModel.setNotificationFlashEnabled(
869+ it
870+ )
871+ },
831872 strobeEnabled = strobeEnabled,
832873 onStrobeEnabledChanged = { viewModel.setStrobeEnabled(it) },
833874 disableGlyphsWhenSilent = disableGlyphsWhenSilent,
834- onDisableGlyphsWhenSilentChanged = { viewModel.setDisableGlyphsWhenSilent(it) },
875+ onDisableGlyphsWhenSilentChanged = {
876+ viewModel.setDisableGlyphsWhenSilent(
877+ it
878+ )
879+ },
835880 overlayEnabled = overlayEnabled,
836881 onOverlayEnabledChanged = { enabled ->
837882 if (enabled && ! Settings .canDrawOverlays(context)) {
0 commit comments