-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Migrate empty_state_view xml/view to Jetpack Compose #11463
base: refactor
Are you sure you want to change the base?
Migrate empty_state_view xml/view to Jetpack Compose #11463
Conversation
cc @opusforlife2 PTAL. Let me know if other code reviewers should be in the review loop as well. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change set looks okay to me overall (I haven't tested it yet). That being said, I've suggested some changes.
|
||
import org.schabi.newpipe.BaseFragment; | ||
import org.schabi.newpipe.R; | ||
import org.schabi.newpipe.ui.emptystate.EmptyStateUtil; | ||
|
||
public class EmptyFragment extends BaseFragment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire fragment could be implemented using Compose directly, see https://developer.android.com/reference/kotlin/androidx/fragment/compose/package-summary#(androidx.fragment.app.Fragment).content(kotlin.Function0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. This PR is to have a single purpose. Since applying this API requires firstly migrating EmptyFragment to kotlin, I can start another PR purely for the migration without mixing it into one.
@@ -27,7 +31,7 @@ | |||
public class CommentsFragment extends BaseListInfoFragment<CommentsInfoItem, CommentsInfo> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've already migrated this fragment to Compose in a separate PR, so I don't think this particular change will be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know. This can wait for your PR.
What is it?
Description of the changes in your PR
As part of the rewrite effort, this PR migrates the
empty_state_view
xml and view to Jetpack Compose. It contains the followingEmptyStateComposable
and specs used different fragments.EmptyStateUtil
to provide java -> kotlin interpolation methods.MutableState<EmptyStateSpec>
to trigger recompositation upon ui state changes.Before/After Screenshots/Screen Record
More screenshot is coming before PR commition.
Fixes the following issue(s)
Rewrite Issue 1: The Jetpack Compose Migration #11198
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence