GridView icon indicating copy to clipboard operation
GridView copied to clipboard

Initial tvOS Support ๐Ÿ“บ

Open toshi0383 opened this issue 6 years ago โ€ข 6 comments

๐ŸŽ‰ gridview-tvos

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๐Ÿค”)

toshi0383 avatar Nov 04 '17 04:11 toshi0383

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?

toshi0383 avatar Nov 04 '17 04:11 toshi0383

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?

KyoheiG3 avatar Nov 06 '17 01:11 KyoheiG3

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.๐Ÿ˜‰

toshi0383 avatar Nov 06 '17 02:11 toshi0383

I'll dig further when I have time.๐Ÿ˜‰

Cool. Thanks!

KyoheiG3 avatar Nov 06 '17 02:11 KyoheiG3

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.๐Ÿค”

toshi0383 avatar Nov 07 '17 04:11 toshi0383

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.

toshi0383 avatar Nov 13 '17 13:11 toshi0383

Closing for now. I'll reopen this when I'm ready again. Thank you for your kind review!

toshi0383 avatar Oct 18 '22 02:10 toshi0383