GridView
GridView copied to clipboard
Initial tvOS Support ๐บ
๐
This is kind of beta implementation.
We still need to ..
- improve infinite loading timing
- provide delegate method like UICollectionView's
collectionView(:didUpdateFocusInContext:withAnimationCoordinator:)
(not sure if possible๐ค)
I have detected these bugs.
- Cell size becomes too small or too large when modifying Cell's
transform
on focus update. (which I implemented in Example) - Focus jumps to unexpected cells on left scroll (right scroll seems ok. Maybe related to infinite scroll.)
@KyoheiG3 Do you come-up with any workaround?
Hi, @toshi0383
Cell size becomes too small or too large when modifying Cell's transform on focus update. (which I implemented in Example)
Try to modify transform of subviews on the Cell.
Focus jumps to unexpected cells on left scroll (right scroll seems ok. Maybe related to infinite scroll.)
It so difficult issues. I also couldn't solve.
I guess it depends to reuse of the Cell. So, could you return false
with canBecomeFocused
if canReuse is true
?
Try to modify transform of subviews on the Cell.
Thanks! I'll try.
It so difficult issues. I also couldn't solve.
Yea maybe we should implement different infinite scroll algorithm for tvOS. (not changing contentOffset, because of focus) I'll dig further when I have time.๐
I'll dig further when I have time.๐
Cool. Thanks!
I guess it depends to reuse of the Cell. So, could you return false with canBecomeFocused if canReuse is true?
This doesn't solve the jumping focus issue, FYI.
I imagine that when changing contentOffset
, focusedView remains same. So the focused cell gets out of the screen when contentOffset
is applied by infiniteIfNeeded()
, which triggers GridView snapping back to show the focused cell.
That's why I said we need a different algorithm.๐ค
Cell size becomes too small or too large when modifying Cell's transform on focus update. (which I implemented in Example)
This one is solved in b6a9ad1, using toshi0383/FocusZPositionMutating . It's installed in Example project, because I thought GridView should focus on reuse and drawing views.
Closing for now. I'll reopen this when I'm ready again. Thank you for your kind review!