Sha256: 10add9bc31a56173bfe97cfe78bd2ff3706517f25ad7f0be7da4ff35d19254ff

Contents?: true

Size: 473 Bytes

Versions: 17

Compression:

Stored size: 473 Bytes

Contents

class Accelerometer
  
  attr_accessor :sensor, :rate
  include Droiuby::Wrappers::Listeners
  
  def initialize
    @native = _execution_bundle.getSensor(Java::Sensor.TYPE_ACCELEROMETER)
  end
  
  def on(event, &block)
    unless @listener
      @listener = Droiuby::Wrappers::Listeners::AutoWrapMultiple.new(_execution_bundle)
      @native.registerListener(@listener.to_native('SensorEventListener'), @sensor, @rate)
    end
    @listener.impl(event, &block) 
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
droiuby-0.3.6 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.3.5 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.3.4 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.3.3 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.3.2 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.3.1 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.3.0 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.9 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.8 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.7 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.6 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.5 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.4 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.3 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.2 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.1 lib/droiuby/wrappers/accelerometer.rb
droiuby-0.2.0 lib/droiuby/wrappers/accelerometer.rb