google / horologist

Horologist is a group of libraries that aim to supplement Wear OS developers with features that are commonly required by developers but not yet available.
https://google.github.io/horologist/
Apache License 2.0
543 stars 87 forks source link

Navigation parameters are read only, #2282

Closed Tolriq closed 4 days ago

Tolriq commented 4 days ago

Use a simple solution to only change page once per backStack.

WHAT

Fix sample giving invalid advice.

WHY

HOW

Checklist :clipboard:

yschimke commented 4 days ago

Thanks for the fix.

Once we switch to 0.7.x, this will be even more important as we'll start using the typesafe nav. https://github.com/google/horologist/compare/main...pre-0.7.x#diff-715593650c80e162494bcfc5a37a7635a80cec9c3b314f447c9fba6d58524b84R53

yschimke commented 4 days ago

Failing on

/home/runner/work/horologist/horologist/media/ui/api/current.api:299: error: Removed method com.google.android.horologist.media.ui.navigation.NavigationScreens.Player.getPageParam(androidx.navigation.NavBackStackEntry,boolean) [RemovedMethod]
Aborting: Found compatibility problems checking the public API (/home/runner/work/horologist/horologist/media/ui/build/metalava/current.txt) against the API in /home/runner/work/horologist/horologist/media/ui/api/current.api

running

./gradlew metalavaGenerateSignature metalavaGenerateSignatureRelease

Should fix, or edit the file if brave.

Tolriq commented 4 days ago

For the API file I wonder why that part is public API so waited for your input :) I'll update the API file.