-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tvOS] Focus Improvements #807
Conversation
UIViewAnimationOptions
[ASMultiplexImageNode] Enables support for Photos framework on tvOS 10+ [ASMultiplexImageNode] Fixes comment depth [ASAvailability] Adjust logic in AS_AVAILABLE_IOS_TVOS to account for both versions Adjusts API_AVAILABLE to minimum deployment target
the built-in solution (more accurately target OS by checking target) Change AS_AVAILABLE_IOS -> AS_AVAILABLE_IOS_TVOS in places that shoud allow for both [ASAvailability] Simplify AS_AVAILABLE_IOS_TVOS
when targeting tvOS
overrides. Removes methods already implemented in ASDisplayNode+UIViewBridge category. [ASControlNode] Moves tvOS category declaration to ASControlNode header [ASImageNode] Moves tvOS category declaration to ASImageNode header [ASControlNode+Private] Adds private category for ASControlNode to access private selectors
…fierMinimumLineSpacing, kCTParagraphStyleSpecifierMaximumLineSpacing, kCTParagraphStyleSpecifierLineSpacingAdjustment when mapping CTParagraphStyle onto NSParagraphStyle [ASTextNode] Uses CoreText-cleansed attributed string when assigning ascender/descender to avoid crash when a CTParagraphStyle is passed as an attribute
[ASImageNode+tvOS] Add missing Foundation import (whoops!)
evaluates to an NSParagraphStyle, pass through to cleansed attributes. This fixes a bug that would occur if a CTParagraphStyle was passed as an attribute _alone_ (would not be caught by unsupported attributes check)
[ASCellNode] Implement _ASCollectionViewCell focus methods
…nimum deployment target was bumped to 9.0 [Focus] Adds convenience blocks onto ASDisplayNode for commonly overridden focus methods + asserts when there is a subclass override as well as block impl
889839a
to
80c22ca
Compare
38126e2
to
a7a798e
Compare
[ASFocus] Removes ASDisplayNode+UIViewBridge implementations of focus engine methods, since overriding these methods can cause behavior that is less than ideal for the developer -- instead, these methods will fall back to the UIView implementation if there are no subclass overrides in the node
🚫 CI failed with log |
implementations to blocks
… a more effecient way of handling this, but is still cleaner than the alternative
🚫 CI failed with log |
🚫 CI failed with log |
the super implementation of each focus method if not implemented by an ASFocus block or overridden. This does not solve the issue of being unable to return the super implementation of _ASCollectionViewCell or _ASTableViewCell for these methods from a subclass implementation -- will need to look more into this
Going to close this out and make some fundamental changes to the PR -- this was mostly put together for a project I was working on (in a rush), but many of these changes do not really fit in with the rest of Texture |
@alexhillc Curious if you saw any issues with ASControlNodeEventPrimaryActionTriggered being triggers from ASButtonNode's? |
Hey @ay8s - tvOS would require a different implementation of ASControlNode event handling, using UIPresses rather than UITouches. I don't believe Texture forwards UIPresses (from ASDisplayView) to their respective nodes, so that would also need to be implemented before the control node event handling. |
@alexhillc That'd do it. Probably a good one to get on the list. 👍 |
collectionNode:canFocusItemAtIndexPath:
collectionNode:shouldUpdateFocusInContext:
collectionNode:didUpdateFocusInContext:withAnimationCoordinator:
indexPathForPreferredFocusedViewInCollectionNode:
tableNode:canFocusRowAtIndexPath:
tableNode:shouldUpdateFocusInContext:
tableNode:didUpdateFocusInContext:withAnimationCoordinator:
indexPathForPreferredFocusedViewInTableNode:
canBecomeFocusedBlock
, which cannot be implemented alongside-[ASDisplayNode canBecomeFocused]
shouldUpdateFocusBlock
, which cannot be implemented alongside-[ASDisplayNode shouldUpdateFocusInContext:]
didUpdateFocusBlock
, which cannot be implemented alongside-[ASDisplayNode didUpdateFocusInContext:withAnimationCoordinator:]
preferredFocusEnvironmentsBlock
, which cannot be implemented alongside-[ASDisplayNode preferredFocusEnvironments]
preferredFocusedViewBlock
, which cannot be implemented alongside-[ASDisplayNode preferredFocusedView]
pressesBegan:withEvent:
pressesChanged:withEvent:
pressesEnded:withEvent:
pressesCancelled:withEvent:
canBecomeFocused
shouldUpdateFocusInContext:
didUpdateFocusInContext:withAnimationCoordinator:
setNeedsFocusUpdate
updateFocusIfNeeded
preferredFocusEnvironments
preferredFocusedView