Class: PMCursorAdapter
- Inherits:
-
PMBaseAdapter
- Object
- Android::Widget::BaseAdapter
- PMBaseAdapter
- PMCursorAdapter
- Defined in:
- lib/project/pro_motion/adapters/pm_cursor_adapter.rb
Instance Attribute Summary collapse
-
#cell_options ⇒ Object
Returns the value of attribute cell_options.
-
#cursor ⇒ Object
Returns the value of attribute cursor.
Attributes inherited from PMBaseAdapter
Instance Method Summary collapse
-
#action_arguments(data, position) ⇒ Object
slighty different arguments to send when tapping.
- #count ⇒ Object
-
#initialize(opts = {}) ⇒ PMCursorAdapter
constructor
A new instance of PMCursorAdapter.
- #item_data(position) ⇒ Object
Methods inherited from PMBaseAdapter
#areAllItemsEnabled, #are_all_items_enabled?, #getCount, #getItem, #getItemId, #getItemViewType, #getView, #getViewTypeCount, #hasStableIds, #has_stable_ids?, #inflate_row, #isEmpty, #isEnabled, #is_empty?, #is_enabled?, #item_id, #item_view_type_id, #screen, #screen=, #selected_view, #update_view, #view, #view_type_count, #view_types
Constructor Details
#initialize(opts = {}) ⇒ PMCursorAdapter
Returns a new instance of PMCursorAdapter.
5 6 7 8 9 10 |
# File 'lib/project/pro_motion/adapters/pm_cursor_adapter.rb', line 5 def initialize(opts={}) super() @cursor = opts.fetch(:cursor) = opts.fetch(:cell, 1) [:cursor] = @cursor # slip the cursor inside so callbacks have it end |
Instance Attribute Details
#cell_options ⇒ Object
Returns the value of attribute cell_options.
3 4 5 |
# File 'lib/project/pro_motion/adapters/pm_cursor_adapter.rb', line 3 def end |
#cursor ⇒ Object
Returns the value of attribute cursor.
2 3 4 |
# File 'lib/project/pro_motion/adapters/pm_cursor_adapter.rb', line 2 def cursor @cursor end |
Instance Method Details
#action_arguments(data, position) ⇒ Object
slighty different arguments to send when tapping
22 23 24 25 |
# File 'lib/project/pro_motion/adapters/pm_cursor_adapter.rb', line 22 def action_arguments(data, position) item_data(position) # move the cursor into position @cursor end |
#count ⇒ Object
12 13 14 |
# File 'lib/project/pro_motion/adapters/pm_cursor_adapter.rb', line 12 def count cursor.count end |
#item_data(position) ⇒ Object
16 17 18 19 |
# File 'lib/project/pro_motion/adapters/pm_cursor_adapter.rb', line 16 def item_data(position) cursor.moveToPosition(position) # return the one & only one cell_options end |