motion-gyro-image-controller 1.1 → 1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                NjQwOWZhNGY4NzExZDdmMDhkZTg0N2M3YmYzNjMxNzM1ZDAzM2M4Nw==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                OGY2OTZiOTZiMmY2NTE1YTkxNmNjMmE0NGI2YjJhMzEyNDRhMTY0MA==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                ZTcyNDY3MGM5YTI3ZDM3NzZiOWZkYWIzYmZmOWQ1NzFjNWFjMGM4ZjQwODA3
         
     | 
| 
      
 10 
     | 
    
         
            +
                ODJiNzc4ZmQxY2VmZmZhZWMxNzljZWU0YjAxNTFiMDQ3ZjAxMmYxOGJkNjFk
         
     | 
| 
      
 11 
     | 
    
         
            +
                ZDJlZDRiNDZhMjczZWVmZGRlZTZmZTUzM2YzNzAzYmQ1ZmQ3YWQ=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                N2Q4YzAxMmVjYzQzZTZiNmM2OWNkMWNhZDkxMDNlYTJiNGY3ODE4MzFkZDI4
         
     | 
| 
      
 14 
     | 
    
         
            +
                YTEzNDAyNWE2Y2RkODk4YmM5ZTliMDFhYmQ2YzgwNjNhNTE0ODg4YTYzODFi
         
     | 
| 
      
 15 
     | 
    
         
            +
                MmZmMzc4NGMxZjAxODAwZTdhYjJhOWZhMjFmNWQ0ZjdiM2RmN2I=
         
     | 
| 
         @@ -8,12 +8,12 @@ class GyroDrivenImageViewController < ScrollingImageViewController 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
              def viewDidAppear animated
         
     | 
| 
       10 
10 
     | 
    
         
             
                super
         
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 11 
     | 
    
         
            +
                set_up_gyro if gyro_available
         
     | 
| 
       12 
12 
     | 
    
         
             
              end
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
              def viewWillDisappear(animated)
         
     | 
| 
       15 
15 
     | 
    
         
             
                super
         
     | 
| 
       16 
     | 
    
         
            -
                 
     | 
| 
      
 16 
     | 
    
         
            +
                tear_down_gyro if gyro_available
         
     | 
| 
       17 
17 
     | 
    
         
             
              end
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
              def gyro_available
         
     | 
| 
         @@ -28,7 +28,7 @@ class GyroDrivenImageViewController < ScrollingImageViewController 
     | 
|
| 
       28 
28 
     | 
    
         
             
                @motion_manager.deviceMotion
         
     | 
| 
       29 
29 
     | 
    
         
             
              end
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
              def  
     | 
| 
      
 31 
     | 
    
         
            +
              def set_up_gyro
         
     | 
| 
       32 
32 
     | 
    
         
             
                initialize_gyro_setup
         
     | 
| 
       33 
33 
     | 
    
         
             
                activate_timer_control
         
     | 
| 
       34 
34 
     | 
    
         
             
              end
         
     | 
| 
         @@ -39,7 +39,7 @@ class GyroDrivenImageViewController < ScrollingImageViewController 
     | 
|
| 
       39 
39 
     | 
    
         
             
                @motion_manager.startDeviceMotionUpdates
         
     | 
| 
       40 
40 
     | 
    
         
             
              end
         
     | 
| 
       41 
41 
     | 
    
         | 
| 
       42 
     | 
    
         
            -
              def  
     | 
| 
      
 42 
     | 
    
         
            +
              def tear_down_gyro
         
     | 
| 
       43 
43 
     | 
    
         
             
                @timer.cancel!
         
     | 
| 
       44 
44 
     | 
    
         
             
                @motion_manager.stopDeviceMotionUpdates
         
     | 
| 
       45 
45 
     | 
    
         
             
              end
         
     | 
| 
         @@ -76,7 +76,7 @@ class GyroDrivenImageViewController < ScrollingImageViewController 
     | 
|
| 
       76 
76 
     | 
    
         | 
| 
       77 
77 
     | 
    
         
             
              def get_scroll_offset_towards_right roll
         
     | 
| 
       78 
78 
     | 
    
         
             
                current_offset = @scroll_view.contentOffset.x
         
     | 
| 
       79 
     | 
    
         
            -
                width = @scroll_view.contentSize.width -  
     | 
| 
      
 79 
     | 
    
         
            +
                width = @scroll_view.contentSize.width - self.width
         
     | 
| 
       80 
80 
     | 
    
         
             
                new_offset = current_offset - ((width - current_offset) * roll)
         
     | 
| 
       81 
81 
     | 
    
         
             
                new_offset = width if new_offset > width
         
     | 
| 
       82 
82 
     | 
    
         
             
                new_offset
         
     | 
| 
         @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 
     | 
|
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            Gem::Specification.new do |spec|
         
     | 
| 
       6 
6 
     | 
    
         
             
              spec.name          = "motion-gyro-image-controller"
         
     | 
| 
       7 
     | 
    
         
            -
              spec.version       = "1. 
     | 
| 
      
 7 
     | 
    
         
            +
              spec.version       = "1.2"
         
     | 
| 
       8 
8 
     | 
    
         
             
              spec.authors       = ["Multunus"]
         
     | 
| 
       9 
9 
     | 
    
         
             
              spec.email         = ["info@multunus.com"]
         
     | 
| 
       10 
10 
     | 
    
         
             
              spec.summary       = %q{A controller that lets you control images using gyro}
         
     |