Skip to content

Feature: Settings persistence with DataStore #7

Description

@Leostrange

Settings are lost on every app restart

Currently ProcessingConfig is created fresh each time. Users lose all preferences (mode, quality, format, bitrate, noise reduction, stereo width) after closing the app.

Tasks

1. Add Jetpack DataStore dependency

In app/build.gradle.kts:

implementation("androidx.datastore:datastore-preferences:1.1.1")

2. Create SettingsRepository

File: app/src/main/java/com/example/vocalremover/data/SettingsRepository.kt

  • fun getConfig(): Flow<ProcessingConfig>
  • suspend fun saveConfig(config: ProcessingConfig)

3. Wire into DI

In DataModule.kt: provide SettingsRepository as @Singleton

4. Update MainViewModel

  • Load saved config on init
  • On settings change → save config automatically

5. Update SettingsSection.kt

  • On any setting change callback → viewModel.updateConfig(...)

Acceptance Criteria

  • Selected mode/quality/format survive app restart
  • Bitrate and noise reduction settings are persisted
  • Default config is used on first launch
  • No ANR on DataStore read (use coroutines)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions