Module: Briar::Picker_Shared

Defined in:
lib/briar/picker/picker_shared.rb

Instance Method Summary collapse

Instance Method Details

#picker_current_index_for_column(column) ⇒ Object



5
6
7
8
# File 'lib/briar/picker/picker_shared.rb', line 5

def picker_current_index_for_column (column)
  arr = query('pickerTableView', :selectionBarRow)
  arr[column]
end

#picker_current_index_for_column_is(column, val) ⇒ Object

methods common to generic and date pickers



10
11
12
# File 'lib/briar/picker/picker_shared.rb', line 10

def picker_current_index_for_column_is(column, val)
  picker_current_index_for_column(column) == val
end

#picker_next_index_for_column(column) ⇒ Object



18
19
20
# File 'lib/briar/picker/picker_shared.rb', line 18

def picker_next_index_for_column (column)
  picker_current_index_for_column(column) + 1
end

#picker_scroll_down_on_column(column) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/briar/picker/picker_shared.rb', line 22

def picker_scroll_down_on_column(column)
  new_row = previous_index_for_column column
  #scroll_to_row("pickerTableView index:#{column}", new_row)
  query("pickerTableView index:'#{column}'", [{:selectRow => new_row},
                                              {:animated => 1},
                                              {:notify => 1}])
end

#picker_scroll_up_on_column(column) ⇒ Object



30
31
32
33
34
35
# File 'lib/briar/picker/picker_shared.rb', line 30

def picker_scroll_up_on_column(column)
  new_row = picker_next_index_for_column column
  query("pickerTableView index:'#{column}'", [{:selectRow => new_row},
                                              {:animated => 1},
                                              {:notify => 1}])
end

#previous_index_for_column(column) ⇒ Object



14
15
16
# File 'lib/briar/picker/picker_shared.rb', line 14

def previous_index_for_column (column)
  picker_current_index_for_column(column) - 1
end