Add single-column layout toggle for adaptive feed list#1
Merged
Conversation
…Access in WebViewLayout (ReadYouApp#1277)
Currently translated at 52.8% (198 of 375 strings) Translated using Weblate (Arabic) Currently translated at 100.0% (375 of 375 strings) Translated using Weblate (Galician) Currently translated at 99.4% (373 of 375 strings) Translated using Weblate (Turkish) Currently translated at 97.3% (365 of 375 strings) Translated using Weblate (Korean) Currently translated at 49.8% (187 of 375 strings) Translated using Weblate (German) Currently translated at 100.0% (375 of 375 strings) Translated using Weblate (Swedish) Currently translated at 100.0% (375 of 375 strings) Translated using Weblate (Arabic) Currently translated at 100.0% (375 of 375 strings) Co-authored-by: Daniel Wiik <d.wiik@outlook.com> Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: Kachelkaiser <kachelkaiser@htpst.de> Co-authored-by: ODK <vekilince@proton.me> Co-authored-by: Yago Raña Gayoso <yago.rana.gayoso@gmail.com> Co-authored-by: clearstripe <sakurasan000510@gmail.com> Co-authored-by: jonnysemon <jonnysemon@users.noreply.hosted.weblate.org> Co-authored-by: ℂ𝕠𝕠𝕠𝕝 (𝕘𝕚𝕥𝕙𝕦𝕓.𝕔𝕠𝕞/ℂ𝕠𝕠𝕠𝕝) <coool@mail.lv> Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/ar/ Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/de/ Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/gl/ Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/ko/ Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/lv/ Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/sv/ Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/tr/ Translation: ReadYou/Android strings
…id-strings Translations update from Hosted Weblate
Adds a user preference to force single-column mode on tablets/large screens. When enabled, the 2-pane adaptive layout collapses to a single column where tapping an article takes over the full screen and back returns to the article list. Default is off (adaptive behavior unchanged). - FlowSingleColumnPreference: new boolean preference (ON/OFF) - DataStoreExt: register key "flowSingleColumn" in both PreferencesKey and legacy DataStoreKey - Settings/Preference/SettingsProvider: wire preference through the settings system - AppEntry: override scaffold directive with maxHorizontalPartitions=1 when enabled - FeedsPageStylePage: add "Layout" section with toggle switch - strings.xml: add single_column_layout and layout string resources https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
The navigator's scaffoldValue only recomputes on navigation events, not when scaffoldDirective alone changes. Without a navigation event, isTwoPane stays stale after toggling, requiring a rotation or app restart to take effect. Add a LaunchedEffect that watches forceSingleColumn via snapshotFlow and navigates to the List pane on every change (after initial composition), triggering the navigator to recompute scaffoldValue with the updated directive. https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
Covers build setup, architecture overview, preferences system pattern, adaptive layout notes (including the single-column toggle behavior), key libraries, and branch naming convention. https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
When the single-column preference is enabled, only force maxHorizontalPartitions=1 in portrait. In landscape (screenWidthDp > screenHeightDp) the adaptive directive is used as-is, so a tablet rotated sideways naturally shows the two-pane view. https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
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.
Summary
Adds a user-configurable preference to force single-column layout in the feed list, enabling better control over the adaptive two-pane layout on tablets. This is particularly useful for users who prefer a single-column view even on larger screens.
Key Changes
FlowSingleColumnPreferencesealed class with ON/OFF states, following the existing preference pattern with DataStore integrationflowSingleColumnfield toSettingsdata class and registered the DataStore key inDataStoreExt.ktFeedsPageStylePageunder a new "Layout" section to allow users to enable/disable single-column modeAppEntry.ktto:snapshotFlowscaffoldDirectivewithmaxHorizontalPartitions = 1when single-column is enabled (portrait only)LocalFlowSingleColumnfor access throughout the compose treeImplementation Details
The single-column preference only applies in portrait orientation (
screenWidthDp <= screenHeightDp). In landscape, the adaptive layout operates normally, allowing two panes on tablets. ALaunchedEffectinAppEntry.ktwatches the preference and callsnavigator.navigateTo(List)when it changes—this is necessary because the navigator only recomputesscaffoldValueon navigation events, not on directive-only changes.The preference follows the established pattern: sealed class with
put()andfromPreferences()methods, DataStore key registration, and integration into the settings provider's CompositionLocal chain.Localization
Includes string resource updates across multiple languages (Swedish, German, Arabic, Turkish, Latvian, Galician, Korean) with improved phrasing and consistency.
Additional Files
CLAUDE.mdwith project architecture documentation for development contexthttps://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB