Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings upgrade #1325

Merged
merged 79 commits into from
Feb 9, 2025
Merged

Settings upgrade #1325

merged 79 commits into from
Feb 9, 2025

Conversation

Helium314
Copy link
Owner

@Helium314 Helium314 commented Jan 25, 2025

A big step towards #1109, and fixes #507 with the search field

This PR is a complete re-write of the settings in compose.
The current Settings based on Android(x) preferences are very unflexible when it comes to tuning the screens, and it's very easy to get into a mess with weird sizes, paddings and whatever. Compose allows for more flexibility and does not require splitting everything in multiple parts (style and pref screen in xml, pref fragment in code).
Compose also has some drawbacks:

  • Performance (mostly loading times) is clearly worse than the old view system. This is especially noticeable in debug builds, but to some extent in release builds too. But loading times are still good enough for normal use, even on my S4 mini.
  • App size is increased by 1.5 MB, which is a considerable chunk. But the more convenient development is worth it in my opinion, plus the users running after Google's latest trends get their beloved Material 3 theme (sorry, but I developed an aversion against all the do-that-because-google issues).
  • Stack traces are ridiculous, 80 lines is quite normal now.

Currently there are only 2 simple settings screens rewritten, but the rest is coming soon.
A core part of this PR is the central part containing all settings (working name AllPrefs). Here each preference can be added in a much more contained way than previously.
The preference screens simply get the individual prefereces from there by the settings key, and only need little additional code such as when to hide specific elements.
A search field (icon in top bar) allows filtering AllPrefs by title and description / summary. The field also allows testing the keyboard everywhere.
The preferences are recomposed on settings changes, so there is no need to keep track of changes in the current screen.

In the current state the old settings are accessible too, for easier comparison and also because not all screens are re-done.

The "only" thing missing is implementing the remaining screens, but that's quite a bit of work considering some specialized element like the SeekBarDialogPreference, the reorderDialog, or the whole language settings.

@Helium314
Copy link
Owner Author

This part is mostly done now, color and language settings will be done separately.

@Helium314 Helium314 marked this pull request as ready for review February 8, 2025 21:29
@Helium314
Copy link
Owner Author

Old settings still exist for comparison, will be removed later.

@Helium314 Helium314 merged commit e845e38 into main Feb 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dummy input field to settings to make trying out your preferences easier
1 participant