JubeatPlus 3.9.11
Loading...
Searching...
No Matches
MusicListCollectionLayout Class Reference

The song-grid layout for the music-selection collection view. More...

#include <MusicListCollectionLayout.h>

Inheritance diagram for MusicListCollectionLayout:
Collaboration diagram for MusicListCollectionLayout:

Instance Methods

(int) - getXSpace:
 Returns the horizontal spacing between adjacent cells for the given column type on the current device idiom.
(int) - getYSpace:
 Returns the vertical spacing between adjacent cell rows for the given column type on the current device idiom.
(int) - getXMargin:
 Returns the leading horizontal margin for the given column type on the current device idiom.
(int) - getYMargin:
 Returns the leading vertical margin for the given column type on the current device idiom.
(NSInteger) - count:
 Returns the number of items in the given section of the collection view.
(CGPoint) - ignoreContentOffsetForProposedContentOffset:
 Records the superclass's target offset for the proposed offset and freezes it, so that the next targetContentOffsetForProposedContentOffset: returns it verbatim.
(void) - cancelIgnoreOffset
 Clears the frozen-offset flag so paging resumes deferring to the superclass.
(CGFloat) - frameScale
 Returns the cell scale factor for the current column type.
(instancetype) - init
 Caches the device idiom and clears the paging state.
(void) - dealloc
 Tears the layout down.
(void) - prepareLayout
 Lays the grid out, filling the cached attributes and the content width.
(CGSize) - collectionViewContentSize
 The laid-out content size.
(nullable NSArray< UICollectionViewLayoutAttributes * > *) - layoutAttributesForElementsInRect:
 The attributes of every cell intersecting a rectangle.
(nullable UICollectionViewLayoutAttributes *) - layoutAttributesForItemAtIndexPath:
 The attributes of one cell.
(BOOL) - shouldInvalidateLayoutForBoundsChange:
 Whether a bounds change invalidates the layout.
(CGPoint) - targetContentOffsetForProposedContentOffset:
 The content offset to settle on, honouring a frozen offset when one is set.

Properties

int columnType
 The column-type selector: 0 is the three-column grid, 1 the four-column grid, and 2 the five-column grid.

Detailed Description

The song-grid layout for the music-selection collection view.

A UICollectionViewFlowLayout subclass that precomputes one UICollectionViewLayoutAttributes per song cell in prepareLayout, arranging them into a horizontally-paged grid whose column count, row count, cell size, inter-cell spacing, and margins all vary by device idiom (isPad, is4Inch, and deviceType) and by the columnType selector. It answers the content-size and attributes queries from that precomputed array, and implements snap-to-page paging through the ignoreContentOffsetForProposedContentOffset: / cancelIgnoreOffset machinery layered over the superclass's own paging.

Method Documentation

◆ cancelIgnoreOffset

- (void) cancelIgnoreOffset

Clears the frozen-offset flag so paging resumes deferring to the superclass.

Ghidra address:
0xd9e08

◆ collectionViewContentSize

- (CGSize) collectionViewContentSize

The laid-out content size.

Returns
The computed content width by the collection view's own height.
Ghidra address:
0xd9b90

◆ count:

- (NSInteger) count: (int) section

Returns the number of items in the given section of the collection view.

Parameters
sectionThe section index.
Returns
The item count reported by the collection view's data source.
Ghidra address:
0xd9b3c

◆ dealloc

- (void) dealloc

Tears the layout down.

Ghidra address:
0xd9748

◆ frameScale

- (CGFloat) frameScale

Returns the cell scale factor for the current column type.

Returns
The scale factor applied to each cell.
Ghidra address:
0xd9e74

◆ getXMargin:

- (int) getXMargin: (int) columnType

Returns the leading horizontal margin for the given column type on the current device idiom.

Parameters
columnTypeThe column-type selector.
Returns
The leading horizontal margin in points.
Ghidra address:
0xd94e0

◆ getXSpace:

- (int) getXSpace: (int) columnType

Returns the horizontal spacing between adjacent cells for the given column type on the current device idiom.

Parameters
columnTypeThe column-type selector.
Returns
The horizontal inter-cell spacing in points.
Ghidra address:
0xd93c0

◆ getYMargin:

- (int) getYMargin: (int) columnType

Returns the leading vertical margin for the given column type on the current device idiom.

Parameters
columnTypeThe column-type selector.
Returns
The leading vertical margin in points.
Ghidra address:
0xd955c

◆ getYSpace:

- (int) getYSpace: (int) columnType

Returns the vertical spacing between adjacent cell rows for the given column type on the current device idiom.

Parameters
columnTypeThe column-type selector.
Returns
The vertical inter-row spacing in points.
Ghidra address:
0xd943c

◆ ignoreContentOffsetForProposedContentOffset:

- (CGPoint) ignoreContentOffsetForProposedContentOffset: (CGPoint) proposedContentOffset

Records the superclass's target offset for the proposed offset and freezes it, so that the next targetContentOffsetForProposedContentOffset: returns it verbatim.

Parameters
proposedContentOffsetThe proposed content offset.
Returns
The frozen (dummy) content offset.
Ghidra address:
0xd9da8

◆ init

- (instancetype) init

Caches the device idiom and clears the paging state.

Returns
The initialised layout.
Ghidra address:
0xd9600

◆ layoutAttributesForElementsInRect:

- (NSArray< UICollectionViewLayoutAttributes * > *) layoutAttributesForElementsInRect: (CGRect) rect

The attributes of every cell intersecting a rectangle.

Parameters
rectThe rectangle to test against.
Returns
The attributes of the cells that intersect rect .
Ghidra address:
0xd9bf4

◆ layoutAttributesForItemAtIndexPath:

- (UICollectionViewLayoutAttributes *) layoutAttributesForItemAtIndexPath: (NSIndexPath *) indexPath

The attributes of one cell.

Parameters
indexPathThe cell's index path.
Returns
The cell's layout attributes.
Ghidra address:
0xd9d5c

◆ prepareLayout

- (void) prepareLayout

Lays the grid out, filling the cached attributes and the content width.

Ghidra address:
0xd97b0

◆ shouldInvalidateLayoutForBoundsChange:

- (BOOL) shouldInvalidateLayoutForBoundsChange: (CGRect) newBounds

Whether a bounds change invalidates the layout.

Parameters
newBoundsThe proposed new bounds.
Returns
Always NO; the layout does not depend on the bounds.
Ghidra address:
0xd9da0

◆ targetContentOffsetForProposedContentOffset:

- (CGPoint) targetContentOffsetForProposedContentOffset: (CGPoint) proposedContentOffset

The content offset to settle on, honouring a frozen offset when one is set.

Parameters
proposedContentOffsetThe offset the collection view proposes.
Returns
The frozen offset while one is set, otherwise the superclass's answer.
Ghidra address:
0xd9e18

Property Documentation

◆ columnType

- (int) columnType
readwritenonatomicassign

The column-type selector: 0 is the three-column grid, 1 the four-column grid, and 2 the five-column grid.

Ghidra address:
0xd9e90
Ghidra address:
0xd9ea0

The documentation for this class was generated from the following files: