ruflet_core 0.0.17 → 0.0.19
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 +4 -4
- data/lib/ruflet/version.rb +1 -1
- data/lib/ruflet_core.rb +9 -7
- data/lib/ruflet_protocol/ruflet/protocol.rb +28 -54
- data/lib/ruflet_ui/ruflet/app.rb +1 -1
- data/lib/ruflet_ui/ruflet/colors.rb +4 -50
- data/lib/ruflet_ui/ruflet/control.rb +69 -64
- data/lib/ruflet_ui/ruflet/dsl.rb +10 -3
- data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/icons/icon_constant_names.rb +29 -0
- data/lib/ruflet_ui/ruflet/icons/material/material_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/page.rb +313 -523
- data/lib/ruflet_ui/ruflet/ui/control_factory.rb +68 -12
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +13 -6
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +45 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +43 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +0 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +56 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +53 -8
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +54 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +47 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +52 -10
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +52 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +49 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +50 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +46 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +61 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +145 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +47 -12
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/alertdialog_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb +8 -40
- data/lib/ruflet_ui/ruflet/ui/controls/materials/audio_control.rb +16 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/autocomplete_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/badge_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/banner_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomappbar_control.rb +8 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomsheet_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/button_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/card_control.rb +8 -50
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +19 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/checkbox_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb +7 -81
- data/lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb +7 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/container_control.rb +9 -65
- data/lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacolumn_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb +7 -88
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datepicker_control.rb +9 -55
- data/lib/ruflet_ui/ruflet/ui/controls/materials/daterangepicker_control.rb +8 -58
- data/lib/ruflet_ui/ruflet/ui/controls/materials/divider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdown_control.rb +8 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +9 -103
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownoption_control.rb +0 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanel_control.rb +7 -51
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanellist_control.rb +46 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansiontile_control.rb +69 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/fillediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonalbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonaliconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/floatingactionbutton_control.rb +7 -69
- data/lib/ruflet_ui/ruflet/ui/controls/materials/iconbutton_control.rb +8 -68
- data/lib/ruflet_ui/ruflet/ui/controls/materials/listtile_control.rb +8 -74
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb +99 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menuitembutton_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbar_control.rb +7 -59
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawer_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationrail_control.rb +7 -73
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinedbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenubutton_control.rb +8 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenuitem_control.rb +0 -6
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressbar_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressring_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/radio_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rangeslider_control.rb +7 -62
- data/lib/ruflet_ui/ruflet/ui/controls/materials/reorderablelistview_control.rb +9 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +5 -26
- data/lib/ruflet_ui/ruflet/ui/controls/materials/searchbar_control.rb +80 -11
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segment_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segmentedbutton_control.rb +7 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/selectionarea_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/slider_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbar_control.rb +37 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbaraction_control.rb +38 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_control.rb +25 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/submenubutton_control.rb +52 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/switch_control.rb +9 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tab_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbar_control.rb +8 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbarview_control.rb +43 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabs_control.rb +7 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textfield_control.rb +9 -132
- data/lib/ruflet_ui/ruflet/ui/controls/materials/timepicker_control.rb +10 -34
- data/lib/ruflet_ui/ruflet/ui/controls/materials/verticaldivider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +3 -4
- data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +13 -28
- data/lib/ruflet_ui/ruflet/ui/controls/shared/animatedswitcher_control.rb +46 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/arc_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +1 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/canvas_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/circle_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/column_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dismissible_control.rb +52 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/draggable_control.rb +1 -7
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dragtarget_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/shared/fletapp_control.rb +9 -46
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gesturedetector_control.rb +9 -113
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gridview_control.rb +57 -13
- data/lib/ruflet_ui/ruflet/ui/controls/shared/hero_control.rb +9 -40
- data/lib/ruflet_ui/ruflet/ui/controls/shared/icon_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/interactiveviewer_control.rb +9 -53
- data/lib/ruflet_ui/ruflet/ui/controls/shared/line_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/listview_control.rb +57 -11
- data/lib/ruflet_ui/ruflet/ui/controls/shared/markdown_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/oval_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/page_control.rb +9 -58
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pagelet_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pageview_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/path_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/placeholder_control.rb +44 -9
- data/lib/ruflet_ui/ruflet/ui/controls/shared/points_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rect_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/reorderabledraghandle_control.rb +43 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/responsiverow_control.rb +47 -15
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rotatedbox_control.rb +97 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/row_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_controls.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/safearea_control.rb +48 -4
- data/lib/ruflet_ui/ruflet/ui/{services/ruflet → controls/shared}/screenshot_control.rb +18 -2
- data/lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb +65 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shadermask_control.rb +9 -41
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shimmer_control.rb +9 -44
- data/lib/ruflet_ui/ruflet/ui/controls/shared/stack_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb +9 -35
- data/lib/ruflet_ui/ruflet/ui/controls/shared/transparentpointer_control.rb +9 -38
- data/lib/ruflet_ui/ruflet/ui/controls/shared/view_control.rb +63 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/window_control.rb +40 -66
- data/lib/ruflet_ui/ruflet/ui/controls/shared/windowdragarea_control.rb +45 -4
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +62 -18
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/accelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/audio_recorder_control.rb +14 -36
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/barometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/battery_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/clipboard_control.rb +31 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/connectivity_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/filepicker_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/flashlight_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/geolocator_control.rb +14 -30
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/gyroscope_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/hapticfeedback_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/magnetometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/permissionhandler_control.rb +5 -20
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/screenbrightness_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/securestorage_control.rb +22 -49
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/semanticsservice_control.rb +20 -15
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/shakedetector_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/share_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/sharedpreferences_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/storagepaths_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/urllauncher_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/useraccelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/wakelock_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +25 -2
- data/lib/ruflet_ui.rb +12 -10
- metadata +7 -8
- data/lib/ruflet_ui/ruflet/types/animation.rb +0 -110
- data/lib/ruflet_ui/ruflet/ui/controls/materials/codeeditor_control.rb +0 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_controls.rb +0 -311
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rive_control.rb +0 -87
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_controls.rb +0 -109
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/tester_control.rb +0 -126
|
@@ -7,11 +7,12 @@ module Ruflet
|
|
|
7
7
|
class AudioRecorderControl < Ruflet::Control
|
|
8
8
|
TYPE = "audiorecorder".freeze
|
|
9
9
|
WIRE = "AudioRecorder".freeze
|
|
10
|
+
KEYWORDS = [:configuration, :data, :key, :on_state_change, :on_stream, :on_upload].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, configuration: nil, data: nil, key: nil, on_state_change: nil, on_stream: nil, on_upload: nil)
|
|
12
13
|
configuration ||= {}
|
|
13
14
|
props = {}
|
|
14
|
-
props[:configuration] = configuration
|
|
15
|
+
props[:configuration] = configuration
|
|
15
16
|
props[:data] = data unless data.nil?
|
|
16
17
|
props[:key] = key unless key.nil?
|
|
17
18
|
props[:on_state_change] = on_state_change unless on_state_change.nil?
|
|
@@ -20,39 +21,21 @@ module Ruflet
|
|
|
20
21
|
super(type: TYPE, id: id, **props)
|
|
21
22
|
end
|
|
22
23
|
|
|
23
|
-
%w[
|
|
24
|
-
cancel_recording
|
|
25
|
-
get_input_devices
|
|
26
|
-
has_permission
|
|
27
|
-
is_paused
|
|
28
|
-
is_recording
|
|
29
|
-
pause_recording
|
|
30
|
-
resume_recording
|
|
31
|
-
stop_recording
|
|
32
|
-
].each do |method_name|
|
|
24
|
+
%w[cancel_recording get_input_devices has_permission is_paused is_recording pause_recording resume_recording stop_recording].each do |method_name|
|
|
33
25
|
define_method(method_name) do |timeout: 10, on_result: nil|
|
|
34
|
-
|
|
26
|
+
invoke_service(method_name, timeout: timeout, on_result: on_result)
|
|
35
27
|
end
|
|
36
28
|
end
|
|
37
29
|
|
|
38
30
|
def is_supported_encoder(encoder, timeout: 10, on_result: nil)
|
|
39
|
-
|
|
40
|
-
"is_supported_encoder",
|
|
41
|
-
args: { "encoder" => normalize_service_value(encoder) },
|
|
42
|
-
timeout: timeout,
|
|
43
|
-
on_result: on_result
|
|
44
|
-
)
|
|
31
|
+
invoke_service("is_supported_encoder", args: { "encoder" => encoder }, timeout: timeout, on_result: on_result)
|
|
45
32
|
end
|
|
46
33
|
|
|
47
34
|
def start_recording(output_path: nil, configuration: nil, upload: nil, timeout: 10, on_result: nil)
|
|
48
|
-
configuration
|
|
49
|
-
|
|
35
|
+
configuration = props["configuration"] if configuration.nil?
|
|
36
|
+
invoke_service(
|
|
50
37
|
"start_recording",
|
|
51
|
-
args: compact_args(
|
|
52
|
-
"output_path" => output_path,
|
|
53
|
-
"configuration" => configuration,
|
|
54
|
-
"upload" => upload
|
|
55
|
-
),
|
|
38
|
+
args: compact_args("output_path" => output_path, "configuration" => configuration, "upload" => upload),
|
|
56
39
|
timeout: timeout,
|
|
57
40
|
on_result: on_result
|
|
58
41
|
)
|
|
@@ -60,26 +43,21 @@ module Ruflet
|
|
|
60
43
|
|
|
61
44
|
private
|
|
62
45
|
|
|
63
|
-
def
|
|
46
|
+
def invoke_service(method_name, args: nil, timeout:, on_result:)
|
|
64
47
|
runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
|
|
65
48
|
end
|
|
66
49
|
|
|
67
50
|
def compact_args(hash)
|
|
68
|
-
hash.each_with_object({})
|
|
69
|
-
result[key] = normalize_service_value(value) unless value.nil?
|
|
70
|
-
end
|
|
51
|
+
hash.each_with_object({}) { |(key, value), result| result[key] = normalize_value(value) unless value.nil? }
|
|
71
52
|
end
|
|
72
53
|
|
|
73
|
-
def
|
|
54
|
+
def normalize_value(value)
|
|
74
55
|
case value
|
|
75
|
-
when Array
|
|
76
|
-
value.map { |item| normalize_service_value(item) }
|
|
56
|
+
when Array then value.map { |item| normalize_value(item) }
|
|
77
57
|
when Hash
|
|
78
|
-
value.
|
|
79
|
-
result[key] = normalize_service_value(item) unless item.nil?
|
|
80
|
-
end
|
|
58
|
+
value.each_with_object({}) { |(key, item), result| result[key.to_s] = normalize_value(item) unless item.nil? }
|
|
81
59
|
else
|
|
82
|
-
value.respond_to?(:to_h) ?
|
|
60
|
+
value.respond_to?(:to_h) ? normalize_value(value.to_h) : value
|
|
83
61
|
end
|
|
84
62
|
end
|
|
85
63
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class BarometerControl < Ruflet::Control
|
|
8
8
|
TYPE = "barometer".freeze
|
|
9
9
|
WIRE = "Barometer".freeze
|
|
10
|
+
KEYWORDS = [:cancel_on_error, :data, :enabled, :interval, :key, :on_error, :on_reading].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, cancel_on_error: nil, data: nil, enabled: nil, interval: nil, key: nil, on_error: nil, on_reading: nil)
|
|
12
13
|
props = {}
|
|
@@ -8,48 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "camera".freeze
|
|
9
9
|
WIRE = "Camera".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
21
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
22
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
23
|
-
props[:badge] = badge unless badge.nil?
|
|
24
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
25
|
-
props[:col] = col unless col.nil?
|
|
26
|
-
props[:content] = content unless content.nil?
|
|
27
|
-
props[:data] = data unless data.nil?
|
|
28
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
29
|
-
props[:expand] = expand unless expand.nil?
|
|
30
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
31
|
-
props[:height] = height unless height.nil?
|
|
32
|
-
props[:key] = key unless key.nil?
|
|
33
|
-
props[:left] = left unless left.nil?
|
|
34
|
-
props[:margin] = margin unless margin.nil?
|
|
35
|
-
props[:offset] = offset unless offset.nil?
|
|
36
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
37
|
-
props[:preview_enabled] = preview_enabled unless preview_enabled.nil?
|
|
38
|
-
props[:right] = right unless right.nil?
|
|
39
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
40
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
41
|
-
props[:scale] = scale unless scale.nil?
|
|
42
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
43
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
44
|
-
props[:top] = top unless top.nil?
|
|
45
|
-
props[:visible] = visible unless visible.nil?
|
|
46
|
-
props[:width] = width unless width.nil?
|
|
47
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
48
|
-
props[:on_error] = on_error unless on_error.nil?
|
|
49
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
50
|
-
props[:on_state_change] = on_state_change unless on_state_change.nil?
|
|
51
|
-
props[:on_stream_image] = on_stream_image unless on_stream_image.nil?
|
|
52
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :content, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :preview_enabled, :right, :rotate, :rtl, :scale, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_error, :on_size_change, :on_state_change, :on_stream_image].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
53
20
|
end
|
|
54
21
|
end
|
|
55
22
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class ClipboardControl < Ruflet::Control
|
|
8
8
|
TYPE = "clipboard".freeze
|
|
9
9
|
WIRE = "Clipboard".freeze
|
|
10
|
+
KEYWORDS = [:data, :key].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, key: nil)
|
|
12
13
|
props = {}
|
|
@@ -14,6 +15,36 @@ module Ruflet
|
|
|
14
15
|
props[:key] = key unless key.nil?
|
|
15
16
|
super(type: TYPE, id: id, **props)
|
|
16
17
|
end
|
|
18
|
+
|
|
19
|
+
def set(value, timeout: 10, on_result: nil)
|
|
20
|
+
invoke_service("set", args: { "data" => value.to_s }, timeout: timeout, on_result: on_result)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def get(timeout: 10, on_result: nil)
|
|
24
|
+
invoke_service("get", timeout: timeout, on_result: on_result)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def set_image(value, timeout: 10, on_result: nil)
|
|
28
|
+
invoke_service("set_image", args: { "data" => value }, timeout: timeout, on_result: on_result)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def get_image(timeout: 10, on_result: nil)
|
|
32
|
+
invoke_service("get_image", timeout: timeout, on_result: on_result)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def set_files(files, timeout: 10, on_result: nil)
|
|
36
|
+
invoke_service("set_files", args: { "files" => Array(files).map(&:to_s) }, timeout: timeout, on_result: on_result)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def get_files(timeout: 10, on_result: nil)
|
|
40
|
+
invoke_service("get_files", timeout: timeout, on_result: on_result)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
private
|
|
44
|
+
|
|
45
|
+
def invoke_service(method_name, args: nil, timeout:, on_result:)
|
|
46
|
+
runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
|
|
47
|
+
end
|
|
17
48
|
end
|
|
18
49
|
end
|
|
19
50
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class FilePickerControl < Ruflet::Control
|
|
8
8
|
TYPE = "filepicker".freeze
|
|
9
9
|
WIRE = "FilePicker".freeze
|
|
10
|
+
KEYWORDS = [:data, :key, :on_result, :on_upload].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, key: nil, on_result: nil, on_upload: nil)
|
|
12
13
|
props = {}
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class GeolocatorControl < Ruflet::Control
|
|
8
8
|
TYPE = "geolocator".freeze
|
|
9
9
|
WIRE = "Geolocator".freeze
|
|
10
|
+
KEYWORDS = [:configuration, :data, :key, :on_error, :on_position_change].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, configuration: nil, data: nil, key: nil, on_error: nil, on_position_change: nil)
|
|
12
13
|
props = {}
|
|
@@ -18,21 +19,14 @@ module Ruflet
|
|
|
18
19
|
super(type: TYPE, id: id, **props)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
|
-
%w[
|
|
22
|
-
get_last_known_position
|
|
23
|
-
get_permission_status
|
|
24
|
-
is_location_service_enabled
|
|
25
|
-
open_app_settings
|
|
26
|
-
open_location_settings
|
|
27
|
-
request_permission
|
|
28
|
-
].each do |method_name|
|
|
22
|
+
%w[get_last_known_position get_permission_status is_location_service_enabled open_app_settings open_location_settings request_permission].each do |method_name|
|
|
29
23
|
define_method(method_name) do |timeout: 10, on_result: nil|
|
|
30
|
-
|
|
24
|
+
invoke_service(method_name, timeout: timeout, on_result: on_result)
|
|
31
25
|
end
|
|
32
26
|
end
|
|
33
27
|
|
|
34
28
|
def distance_between(start_latitude, start_longitude, end_latitude, end_longitude, timeout: 10, on_result: nil)
|
|
35
|
-
|
|
29
|
+
invoke_service(
|
|
36
30
|
"distance_between",
|
|
37
31
|
args: {
|
|
38
32
|
"start_latitude" => start_latitude,
|
|
@@ -46,36 +40,26 @@ module Ruflet
|
|
|
46
40
|
end
|
|
47
41
|
|
|
48
42
|
def get_current_position(configuration: nil, timeout: 10, on_result: nil)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
)
|
|
43
|
+
# The public Ruflet/Flet API calls this value `configuration`, while
|
|
44
|
+
# the Flutter service currently reads it from the `settings` invoke
|
|
45
|
+
# argument.
|
|
46
|
+
args = configuration.nil? ? nil : { "settings" => normalize_value(configuration) }
|
|
47
|
+
invoke_service("get_current_position", args: args, timeout: timeout, on_result: on_result)
|
|
55
48
|
end
|
|
56
49
|
|
|
57
50
|
private
|
|
58
51
|
|
|
59
|
-
def
|
|
52
|
+
def invoke_service(method_name, args: nil, timeout:, on_result:)
|
|
60
53
|
runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
|
|
61
54
|
end
|
|
62
55
|
|
|
63
|
-
def
|
|
64
|
-
hash.each_with_object({}) do |(key, value), result|
|
|
65
|
-
result[key] = normalize_service_value(value) unless value.nil?
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
def normalize_service_value(value)
|
|
56
|
+
def normalize_value(value)
|
|
70
57
|
case value
|
|
71
|
-
when Array
|
|
72
|
-
value.map { |item| normalize_service_value(item) }
|
|
58
|
+
when Array then value.map { |item| normalize_value(item) }
|
|
73
59
|
when Hash
|
|
74
|
-
value.
|
|
75
|
-
result[key] = normalize_service_value(item) unless item.nil?
|
|
76
|
-
end
|
|
60
|
+
value.each_with_object({}) { |(key, item), result| result[key.to_s] = normalize_value(item) unless item.nil? }
|
|
77
61
|
else
|
|
78
|
-
value.respond_to?(:to_h) ?
|
|
62
|
+
value.respond_to?(:to_h) ? normalize_value(value.to_h) : value
|
|
79
63
|
end
|
|
80
64
|
end
|
|
81
65
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class GyroscopeControl < Ruflet::Control
|
|
8
8
|
TYPE = "gyroscope".freeze
|
|
9
9
|
WIRE = "Gyroscope".freeze
|
|
10
|
+
KEYWORDS = [:cancel_on_error, :data, :enabled, :interval, :key, :on_error, :on_reading].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, cancel_on_error: nil, data: nil, enabled: nil, interval: nil, key: nil, on_error: nil, on_reading: nil)
|
|
12
13
|
props = {}
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class MagnetometerControl < Ruflet::Control
|
|
8
8
|
TYPE = "magnetometer".freeze
|
|
9
9
|
WIRE = "Magnetometer".freeze
|
|
10
|
+
KEYWORDS = [:cancel_on_error, :data, :enabled, :interval, :key, :on_error, :on_reading].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, cancel_on_error: nil, data: nil, enabled: nil, interval: nil, key: nil, on_error: nil, on_reading: nil)
|
|
12
13
|
props = {}
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class PermissionHandlerControl < Ruflet::Control
|
|
8
8
|
TYPE = "permissionhandler".freeze
|
|
9
9
|
WIRE = "PermissionHandler".freeze
|
|
10
|
+
KEYWORDS = [:data, :key].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, key: nil)
|
|
12
13
|
props = {}
|
|
@@ -16,38 +17,22 @@ module Ruflet
|
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def get_status(permission, timeout: 10, on_result: nil)
|
|
19
|
-
|
|
20
|
-
"get_status",
|
|
21
|
-
args: { "permission" => normalize_service_value(permission) },
|
|
22
|
-
timeout: timeout,
|
|
23
|
-
on_result: on_result
|
|
24
|
-
)
|
|
20
|
+
invoke_service("get_status", args: { "permission" => permission }, timeout: timeout, on_result: on_result)
|
|
25
21
|
end
|
|
26
22
|
|
|
27
23
|
def request(permission, timeout: 10, on_result: nil)
|
|
28
|
-
|
|
29
|
-
"request",
|
|
30
|
-
args: { "permission" => normalize_service_value(permission) },
|
|
31
|
-
timeout: timeout,
|
|
32
|
-
on_result: on_result
|
|
33
|
-
)
|
|
24
|
+
invoke_service("request", args: { "permission" => permission }, timeout: timeout, on_result: on_result)
|
|
34
25
|
end
|
|
35
26
|
|
|
36
27
|
def open_app_settings(timeout: 10, on_result: nil)
|
|
37
|
-
|
|
28
|
+
invoke_service("open_app_settings", timeout: timeout, on_result: on_result)
|
|
38
29
|
end
|
|
39
30
|
|
|
40
31
|
private
|
|
41
32
|
|
|
42
|
-
def
|
|
33
|
+
def invoke_service(method_name, args: nil, timeout:, on_result:)
|
|
43
34
|
runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
|
|
44
35
|
end
|
|
45
|
-
|
|
46
|
-
def normalize_service_value(value)
|
|
47
|
-
return value.to_s if value.is_a?(Symbol)
|
|
48
|
-
|
|
49
|
-
value.respond_to?(:to_h) ? value.to_h.transform_keys(&:to_s) : value
|
|
50
|
-
end
|
|
51
36
|
end
|
|
52
37
|
end
|
|
53
38
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class ScreenBrightnessControl < Ruflet::Control
|
|
8
8
|
TYPE = "screenbrightness".freeze
|
|
9
9
|
WIRE = "ScreenBrightness".freeze
|
|
10
|
+
KEYWORDS = [:data, :key, :on_application_screen_brightness_change, :on_system_screen_brightness_change].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, key: nil, on_application_screen_brightness_change: nil, on_system_screen_brightness_change: nil)
|
|
12
13
|
props = {}
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class SecureStorageControl < Ruflet::Control
|
|
8
8
|
TYPE = "securestorage".freeze
|
|
9
9
|
WIRE = "SecureStorage".freeze
|
|
10
|
+
KEYWORDS = [:android_options, :data, :ios_options, :key, :macos_options, :web_options, :windows_options, :on_change].freeze
|
|
10
11
|
OPTION_KEYS = %w[web ios macos android windows].freeze
|
|
11
12
|
|
|
12
13
|
def initialize(id: nil, android_options: nil, data: nil, ios_options: nil, key: nil, macos_options: nil, web_options: nil, windows_options: nil, on_change: nil)
|
|
@@ -22,66 +23,38 @@ module Ruflet
|
|
|
22
23
|
super(type: TYPE, id: id, **props)
|
|
23
24
|
end
|
|
24
25
|
|
|
25
|
-
def set(key, value, **options)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def get(key, **options)
|
|
32
|
-
invoke_secure_storage("get", args: option_args(options).merge("key" => key), **invoke_options(options))
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def contains_key(key, **options)
|
|
36
|
-
invoke_secure_storage("contains_key", args: option_args(options).merge("key" => key), **invoke_options(options))
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def get_all(**options)
|
|
40
|
-
invoke_secure_storage("get_all", args: option_args(options), **invoke_options(options))
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def remove(key, **options)
|
|
44
|
-
invoke_secure_storage("remove", args: option_args(options).merge("key" => key), **invoke_options(options))
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def clear(**options)
|
|
48
|
-
invoke_secure_storage("clear", args: option_args(options), **invoke_options(options))
|
|
49
|
-
end
|
|
26
|
+
def set(key, value, **options) = invoke_with_options("set", options, "key" => key, "value" => value)
|
|
27
|
+
def get(key, **options) = invoke_with_options("get", options, "key" => key)
|
|
28
|
+
def contains_key(key, **options) = invoke_with_options("contains_key", options, "key" => key)
|
|
29
|
+
def get_all(**options) = invoke_with_options("get_all", options)
|
|
30
|
+
def remove(key, **options) = invoke_with_options("remove", options, "key" => key)
|
|
31
|
+
def clear(**options) = invoke_with_options("clear", options)
|
|
50
32
|
|
|
51
33
|
def get_availability(timeout: 10, on_result: nil)
|
|
52
|
-
|
|
34
|
+
runtime_page&.invoke(self, "get_availability", timeout: timeout, on_result: on_result)
|
|
53
35
|
end
|
|
54
36
|
|
|
55
37
|
private
|
|
56
38
|
|
|
57
|
-
def
|
|
58
|
-
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def invoke_options(options)
|
|
62
|
-
{
|
|
63
|
-
timeout: options.fetch(:timeout, 10),
|
|
64
|
-
on_result: options[:on_result]
|
|
65
|
-
}
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def option_args(options)
|
|
69
|
-
OPTION_KEYS.each_with_object({}) do |key, result|
|
|
39
|
+
def invoke_with_options(method_name, options, args = {})
|
|
40
|
+
OPTION_KEYS.each do |key|
|
|
70
41
|
value = options[key.to_sym] || options[key]
|
|
71
|
-
|
|
42
|
+
args[key] = normalize_value(value) unless value.nil?
|
|
72
43
|
end
|
|
44
|
+
runtime_page&.invoke(
|
|
45
|
+
self,
|
|
46
|
+
method_name,
|
|
47
|
+
args: args,
|
|
48
|
+
timeout: options.fetch(:timeout, 10),
|
|
49
|
+
on_result: options[:on_result]
|
|
50
|
+
)
|
|
73
51
|
end
|
|
74
52
|
|
|
75
|
-
def
|
|
53
|
+
def normalize_value(value)
|
|
76
54
|
case value
|
|
77
|
-
when Array
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
value.transform_keys(&:to_s).each_with_object({}) do |(key, item), result|
|
|
81
|
-
result[key] = normalize_service_value(item) unless item.nil?
|
|
82
|
-
end
|
|
83
|
-
else
|
|
84
|
-
value.respond_to?(:to_h) ? normalize_service_value(value.to_h) : value
|
|
55
|
+
when Array then value.map { |item| normalize_value(item) }
|
|
56
|
+
when Hash then value.each_with_object({}) { |(key, item), result| result[key.to_s] = normalize_value(item) unless item.nil? }
|
|
57
|
+
else value.respond_to?(:to_h) ? normalize_value(value.to_h) : value
|
|
85
58
|
end
|
|
86
59
|
end
|
|
87
60
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class SemanticsServiceControl < Ruflet::Control
|
|
8
8
|
TYPE = "semanticsservice".freeze
|
|
9
9
|
WIRE = "SemanticsService".freeze
|
|
10
|
+
KEYWORDS = [:data, :key].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, key: nil)
|
|
12
13
|
props = {}
|
|
@@ -15,32 +16,36 @@ module Ruflet
|
|
|
15
16
|
super(type: TYPE, id: id, **props)
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
def
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
args: {
|
|
23
|
-
"message" => message,
|
|
24
|
-
"rtl" => rtl,
|
|
25
|
-
"assertiveness" => assertiveness
|
|
26
|
-
},
|
|
19
|
+
def announce_tooltip(message, timeout: 10, on_result: nil)
|
|
20
|
+
invoke_service(
|
|
21
|
+
"announce_tooltip",
|
|
22
|
+
args: { "message" => message.to_s },
|
|
27
23
|
timeout: timeout,
|
|
28
24
|
on_result: on_result
|
|
29
25
|
)
|
|
30
26
|
end
|
|
31
27
|
|
|
32
|
-
def
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
def announce_message(message, rtl: false, assertiveness: "polite", timeout: 10, on_result: nil)
|
|
29
|
+
invoke_service(
|
|
30
|
+
"announce_message",
|
|
31
|
+
args: {
|
|
32
|
+
"message" => message.to_s,
|
|
33
|
+
"rtl" => !!rtl,
|
|
34
|
+
"assertiveness" => assertiveness.to_s
|
|
35
|
+
},
|
|
37
36
|
timeout: timeout,
|
|
38
37
|
on_result: on_result
|
|
39
38
|
)
|
|
40
39
|
end
|
|
41
40
|
|
|
42
41
|
def get_accessibility_features(timeout: 10, on_result: nil)
|
|
43
|
-
|
|
42
|
+
invoke_service("get_accessibility_features", timeout: timeout, on_result: on_result)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
private
|
|
46
|
+
|
|
47
|
+
def invoke_service(method_name, args: nil, timeout:, on_result:)
|
|
48
|
+
runtime_page&.invoke(self, method_name, args: args, timeout: timeout, on_result: on_result)
|
|
44
49
|
end
|
|
45
50
|
end
|
|
46
51
|
end
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class ShakeDetectorControl < Ruflet::Control
|
|
8
8
|
TYPE = "shakedetector".freeze
|
|
9
9
|
WIRE = "ShakeDetector".freeze
|
|
10
|
+
KEYWORDS = [:data, :key, :minimum_shake_count, :shake_count_reset_time_ms, :shake_slop_time_ms, :shake_threshold_gravity, :on_shake].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, data: nil, key: nil, minimum_shake_count: nil, shake_count_reset_time_ms: nil, shake_slop_time_ms: nil, shake_threshold_gravity: nil, on_shake: nil)
|
|
12
13
|
props = {}
|
|
@@ -7,6 +7,7 @@ module Ruflet
|
|
|
7
7
|
class UserAccelerometerControl < Ruflet::Control
|
|
8
8
|
TYPE = "useraccelerometer".freeze
|
|
9
9
|
WIRE = "UserAccelerometer".freeze
|
|
10
|
+
KEYWORDS = [:cancel_on_error, :data, :enabled, :interval, :key, :on_error, :on_reading].freeze
|
|
10
11
|
|
|
11
12
|
def initialize(id: nil, cancel_on_error: nil, data: nil, enabled: nil, interval: nil, key: nil, on_error: nil, on_reading: nil)
|
|
12
13
|
props = {}
|