Skip to content
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

Touch Manager #423

Merged
merged 48 commits into from Jul 29, 2016
Merged

Touch Manager #423

merged 48 commits into from Jul 29, 2016

Conversation

asm09fsu
Copy link
Contributor

@asm09fsu asm09fsu commented Jun 15, 2016

Fixes #402

This PR is ready for review.

Risk

This PR makes minor API changes.

Testing Plan

Tests need to be written to make sure that we are correctly calculating pinch, pan, single and double touches.

Summary

This PR introduces the Touch Manager, which is, simply, a wrapper around the onOnTouchEvent notification that we receive from Core. TM handles the logic for determining when a single or double tap has occurred, as well as panning and pinching. Some of these properties are changeable for the developer, but the main objective here is to develop a standard implementation so developers can focus on creating applications, not on logic to handle touching events.
The Touch Manager is only valid for applications utilizing video streaming.

For information on video streaming for mobile navigation, look at our reference here.

There are a few classes/structs/headers that have been added:

  • SDLTouchManager.h/m
    • All logic for interpreting an onOnTouchEvent notification, and calling the SDLTouchManagerListener's protocol.
  • SDLTouchManagerListener.h
    • The protocol callbacks used for informing a developer of touch events.
  • SDLTouch.h/m
    • Struct for storing SDLTouchEvent in an easier to consumer manner, as well as some functions to assist in comparisons and validity.
  • SDLPinchGesture.h/m
    • Struct for storing a pinch gesture, which is comprised of SDLTouch structs. This also contains functions for assisting in comparisons and validity.
  • CGPoint_Util.h/m
    • Basic utility functions to assist in CGPoint calculations.
  • dispatch_timer.h/m
    • Wrapper around dispatch queues for using a GCD timers.

Changelog

Enhancements
  • Added a touch manager for developers to easily add touch handling for video streaming applications.

Tasks Remaining:

  • Add Documentation
    • SDLTouchManager
    • CGPoint_Util
    • SDLTouch
    • SDLPinchGesture
  • Add Tests
    • SDLTouchManager
    • CGPoint_Util
    • SDLTouch
    • SDLPinchGesture
    • dispatch_timer

@asm09fsu asm09fsu added this to the 4.2 milestone Jun 15, 2016
@codecov-io
Copy link

codecov-io commented Jun 15, 2016

Current coverage is 69.51% (diff: 74.64%)

Merging #423 into develop will increase coverage by 0.11%

@@            develop       #423   diff @@
==========================================
  Files           281        289     +8   
  Lines          9376       9589   +213   
  Methods        2585       2636    +51   
  Messages          0          0          
  Branches        603        623    +20   
==========================================
+ Hits           6507       6666   +159   
- Misses         2581       2618    +37   
- Partials        288        305    +17   

Powered by Codecov. Last update 11b0b07...ec0262d

@asm09fsu
Copy link
Contributor Author

@joeljfischer start reviewing the tests please when you get a chance.

@@ -0,0 +1,25 @@
//
// SDLTouchManagerListener.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listener is the Java convention I believe. It should be named -Delegate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, we should be modifying all other Protocols that use -Listener, I was simply trying to keep it consistent 👎

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, definitely. It's just a breaking change to do so.

@joeljfischer joeljfischer modified the milestones: 4.X, 4.2 Jul 27, 2016
@joeljfischer
Copy link
Contributor

We already know timers don't work properly in the background. Does the touch manager explicitly handle that case? For example, it could watch for background notifications and stop timers, watch for foreground and restart, but it would also have to notify the developer that it's not going to work in the background.

@asm09fsu
Copy link
Contributor Author

Video streaming doesn't work in the background, so I don't think we really need to be concerned with the timers.

* @abstract
* First touch of a pinch gesture.
*/
@property (nonatomic, copy) SDLTouch* firstTouch;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't copyable, I don't think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! This was when we were using c-structs instead of objects.

@joeljfischer joeljfischer changed the title [WIP] Touch Manager Support Touch Manager Jul 28, 2016
@joeljfischer
Copy link
Contributor

I'm seeing a few test failures after the changes

@joeljfischer joeljfischer modified the milestones: 4.2, 4.X Jul 29, 2016
@joeljfischer
Copy link
Contributor

LGTM

# Conflicts:
#	SmartDeviceLink/SDLStreamingMediaManager.h
#	SmartDeviceLink/SDLStreamingMediaManager.m
@joeljfischer joeljfischer merged commit ca91918 into develop Jul 29, 2016
@joeljfischer joeljfischer deleted the feature/touch_manager branch July 29, 2016 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants