Skip to content

Refactor Empty State View: Followup Code Improvements #11735

Open
@Profpatsch

Description

@Profpatsch
  • storing a Modifier in the EmptyStateSpec is bad practice and also doesn't make much sense (it's the purpose of parent views to decide the modifiers of the children, it's not a property of the children themselves)
    • It should boil down to:
      • removing the modifier field from the Spec
      • specifying the modifier in every usage of EmptyStateComposable(modifier = ...) in compose code to make the layout well-centered and/or well-spaced
      • specifying XML layout parameters in every usage of in XML layout files to make the layout well-centered and/or well-spaced (only those that will then be replaced with an EmptyStateComposable obviously, there are other unrelated ComposeViews I think)
  • the spacing of the UI is not perfect everywhere, but at least with the latest commit the panel is always centered
    • I can't understand why the "Select a playlist" dialog is tight, while "Select a channel" is larger, but I can't debug right now, see below why...
  • (in a future PR!) the error panel should be merged with the empty state panel, since:
    • only one of them is shown at a time
    • the checks for errors are often close to the checks for emptiness, so some checks could be simplified
    • I'm not totally convinced of this though
  • the empty state for unsupported content in the channel fragment does not work, but it didn't work before either, and both my Layout Inspector and by View Designer don't work, so I can't debug right now (Android Studio decided to go on vacation or something)

Originally posted by @Stypox in #11725 (comment)

Metadata

Metadata

Assignees

Labels

GUIIssue is related to the graphical user interfacecodequalityImprovements to the codebase to improve the code qualitygood first issueEasy/simple issues perfect for newcomers to get involved in the projectrewriteIssues and PRs related to rewrite

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions