This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 883
Conversation
This file contains 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
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
ui-discover/src/main/java/app/tivi/home/discover/DiscoverFragment.kt
Outdated
Show resolved
Hide resolved
nickbutcher
reviewed
Sep 14, 2020
nickbutcher
reviewed
Sep 14, 2020
chrisbanes
changed the title
Converting 'Discover' to Jetpack Compose
Migrate 'Discover' to Jetpack Compose
Sep 21, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Line diff
You might see the line diff (
+669, −633
) and wonder why it increased 😲. Well, Tivi was (actually still is) a heavy user of the data-binding and Epoxy combo. They both code-generate lots of magic, but the line diff you see is only my code. I reckon if we included the generated code in there... 📈Lazy* DSL
Instead of Epoxy + Data Binding, we're now using the new (experimental)
Lazy[Column|Row]
DSL. They make creating complex scrolling UIs much easier to build, and more efficient due to the windowing!As a quick overview, it allows you to build complex scrolling UIs like so:
item { /* content */ }
😍. Content can be whatever you want:items()
anditemsIndexed()
:To see it in action, checkout the root layout in this screen here.
Epoxy + Data Binding
I found it interesting how close the state paths from my old EpoxyController are to the new Compose implementation. Obviously there are differences, but the general structure is pretty close.
Migration notes
This has not quite been a 1:1 migration though:
LazyRow
s aren't animated (yet).