Kore/doc/diagrams/sequence/org.xbmc.kore.ui.abstractcursorlist.puml

98 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

Refactored AbstractDetailsFragment This introduces the MVC model to details fragments. It moves as much view and control code out of the concrete fragments into the abstract classes. * Added UML class and sequence diagrams under doc/diagrams to clarify the new setup * Introduces new abstract classes * AbstractFragment class to hold the DataHolder * AbstractInfoFragment class to display media information * AbstractAddtionalInfoFragment class to allow *InfoFragments to add additional UI elements and propagate refresh requests. See for an example TVShowInfoFragment which adds TVShowProgressFragment to display next episodes and season progression. * Introduces new RefreshItem class to encapsulate all refresh functionality from AbstractDetailsFragment * Introduces new SharedElementTransition utility class to encapsulate all shared element transition code * Introduces new CastFragment class to encapsulate all code for displaying casts reducing code duplication * Introduces DataHolder class to replace passing the ViewHolder from the *ListFragment to the *DetailsFragment or *InfoFragment * Refactored AbstractDetailsFragment into two classes: o AbstractDetailsFragment: for fragments requiring a tab bar o AbstractInfoFragment: for fragments showing media information We used to use <NAME>DetailsFragments for both fragments that show generic info about some media item and fragments that hold all details for some media item. For example, artist details showed artist info and used tabs to show artist albums and songs as well. Now Details fragments are used to show all details, Info fragments only show media item information like description, title, rating, etc. * Moved swiperefreshlayout code from AbstractCursorListFragment to AbstractListFragment
2016-12-30 09:27:24 +01:00
@startuml
Actor Activity
participant "AbstractListFragment" as A
participant "AbstractCursorListFragment" as B
participant "ConcreteCursorListFragment" as C
Activity -> A: onCreate
activate A
A -> C: createAdapter()
activate C
C --> A: return adapter
deactivate C
deactivate A
Activity -> B: onCreateView
activate B
B -> A: onCreateView
deactivate B
activate A
A -> A: connect this class as swipe refresh listener
A -> A: setup gridview
activate A
A -> B: createOnItemClickListener
activate B
B --> A: return click listener
deactivate B
deactivate A
A -> A: restore saved state (if any)
A -> A: enable options menu
A -> B:
deactivate A
activate B
B -> B: restore saved search query (if any)
activate B
deactivate B
deactivate B
Activity -> B: onActivityCreated
activate B
B -> LoaderManager: initialize cursor loader
activate LoaderManager
LoaderManager -> B: onCreateLoader
B -> C: createCursorLoader
activate B
activate C
C --> B: return cursorLoader
deactivate C
B --> LoaderManager: return cursorLoader
deactivate B
deactivate B
deactivate LoaderManager
Activity -> B: onStart
Activate B
B ->> LoaderManager: onStart
Activate LoaderManager
B -> B: bind to library sync service
activate B
deactivate B
deactivate B
LoaderManager ->> B: onLoadFinished
Activity -> B: onResume
Activate B
B -> B: register to eventbus
activate B
deactivate B
deactivate B
== UI active ==
...
Activity ->> B: user selects list item
activate B
B -> B: saveSearchState
activate B
deactivate B
B -> C: onListItemClicked(view)
Activate C
C -> Activity: onItemSelected
note over Activity: starts corresponding InfoFragment
deactivate C
deactivate B
== UI inactive ==
Activity -> B: onPause
activate B
B -> B: unregister from eventbus
activate B
deactivate B
deactivate B
Activity -> B: onStop
activate B
B -> B: unbind from library sync service
activate B
deactivate B
deactivate B
@enduml