Class: WidgetPressedTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- WidgetPressedTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: User Input
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ WidgetPressedTrigger
constructor
A new instance of WidgetPressedTrigger.
- #to_s(colour: false) ⇒ Object (also: #to_summary)
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ WidgetPressedTrigger
Returns a new instance of WidgetPressedTrigger.
1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1794 def initialize(h={}) = { :swipe_start_area=>0, :swipe_motion=>0, :cleared=>true, :image_id=>2130968576, :image_package_name=>"com.android.providers.settings", :image_resource_name=>"com.android.providers.settings", :widget_label=>"", :widget_type=>4 } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object Also known as: to_summary
1807 1808 1809 1810 1811 1812 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1807 def to_s(colour: false) # 4 == cutom , 0 = green, 1 = blue, 2 = red, 3 = yellow style = %w(Green Blue Red Yellow Custom)[@h[:widget_type]] @s = "Widget Button (%s)" % [style] #+ @h.inspect super() end |