Skip to content

Migrate settings appearance screen - #13684

Open
Idadelveloper wants to merge 11 commits into
TeamNewPipe:devfrom
Idadelveloper:settings-appearance
Open

Migrate settings appearance screen#13684
Idadelveloper wants to merge 11 commits into
TeamNewPipe:devfrom
Idadelveloper:settings-appearance

Conversation

@Idadelveloper

Copy link
Copy Markdown
Contributor

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Introduces ListPreference and SwitchPreference reusable composables
  • Adds AppearanceSettingsViewModel
  • Centralizes appearance preference keys, values, and defaults in AppearancePreferences so the screen, the view model, and theming all reference the same constants
  • Adds an AppearanceActions platform interface + per-platform implementations (AndroidAppearanceActions, JVMAppearanceActions, IOSAppearanceActions)
  • Updates Theme.kt to resolve colors from the shared AppearancePreferences constants and observe changes via ObservableSettings, so theme edits made on the appearance screen apply live
  • Adds screen/composable tests: AppearanceSettingsScreenTest, ListPreferenceTest, SwitchPreferenceTest.

Before/After Screenshots/Screen Record

  • Before:
  • After:

Fixes the following issue(s)

  • Fixes #

Relies on the following changes

Continuation of #13652

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions Bot added the size/giant PRs with more than 750 changed lines label Jul 15, 2026
@AudricV AudricV added rewrite Issues and PRs related to rewrite settings Relating to NewPipe settings labels Jul 15, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in Rewrite Jul 15, 2026
Comment thread shared/src/commonMain/kotlin/net/newpipe/app/theme/Theme.kt

@Singleton(binds = [AppearanceActions::class])
class IOSAppearanceActions : AppearanceActions {
override fun openCaptionSettings() = Unit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on my research looks like iOS has caption settings (Accessibility > Subtitles & Captioning / Live Captions), but no App-Store-safe way to deep-link in the app unless i have missed something. By default i have just set the new isCaptionSettingsAvailable method to false for the IOSAppearanceActions so the row will stay hidden


@Singleton(binds = [AppearanceActions::class])
class JVMAppearanceActions : AppearanceActions {
override fun openCaptionSettings() = Unit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be available on desktop:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theimpulson I have made some changes on this. Please take a look at my approach

.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
)
} catch (exception: ActivityNotFoundException) {
Logger.e(messageString = "No activity found for captioning settings", throwable = exception)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this isn't supported, we shouldn't be showing it

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

rewrite Issues and PRs related to rewrite settings Relating to NewPipe settings size/giant PRs with more than 750 changed lines

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants