Conversation
Long lists are hard to navigate by scrolling alone. MultiSelectListPreference now accepts optional parameters, all off by default: - searchable shows a search field above the list. - searchFilter decides which values match the query, given the value and its text. The default is a case-insensitive substring match on the text. - searchPlaceholder, searchLeadingIcon and searchEmptyResult are slots for the field placeholder, the field icon, and the content shown when nothing matches. They are slots rather than built-in strings and icons so that no untranslated resources are added. - pinSelectedValues duplicates the values selected when the dialog opens at the top of the list, above a divider. They stay pinned when unchecked until the dialog is reopened. The sample app gets a searchable preference demonstrating all options.
Author
|
Sample app preview: Screen_recording_tiny.mp4 |
3 tasks
Author
|
Related: dessalines/thumb-key#2020 |
Toldry
marked this pull request as ready for review
September 26, 2026 20:56
Owner
|
First of all, thank you for sending a PR! However, this isn't how the standard list preference works (as in androidx.preference), and different apps may have slightly different opinions on how it should be done (e.g. should unselected items immediately disappear, and should newly selected item immediately appear on top or not), so I think it should remain in the app that needs it instead of being upstreamed. |
Toldry
added a commit
to Toldry/thumb-key
that referenced
this pull request
Sep 27, 2026
The layouts list has over a hundred entries and could only be scrolled. The layouts dialog now uses the search and pinning options added to MultiSelectListPreference in zhanghai/ComposePreference#46: a search box that filters layouts by title, ignoring case and accents, and the layouts selected when the dialog opens pinned at the top. Temporary: settings.gradle builds ComposePreference from a sibling checkout until that PR is merged and released.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Made this PR due to this comment.
Long
MultiSelectListPreferencelists (for example, 100+ keyboard layouts in Thumb-Key) are hard to navigate by scrolling alone. This PR adds optional parameters, all off by default, to all four overloads:searchable: shows a search field above the list.searchFilter: decides which values match. Default: case-insensitive substring match.searchPlaceholder,searchLeadingIcon,searchEmptyResult: composable slots for the field placeholder, the field icon, and the content shown when nothing matches. They are slots so the library adds no untranslated strings and bundles no icon.pinSelectedValues: repeats the values selected when the dialog opened at the top of the list, above a divider. They stay pinned when unchecked until the dialog is reopened.With the defaults the dialog is unchanged. The new parameters come before
item, so trailing-lambda callers still compile; binaries built against the old signatures need recompiling.preference/api/jvm/preference.apiis updated accordingly.The sample app gets a searchable preference demonstrating all options.
apiCheckpasses, and the library and sample compile. Tested manually in the Android sample on an emulator and in Thumb-Key)