module Briar::Picker_Shared

Public Instance Methods

picker_current_index_for_column(column) click to toggle source
# 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) click to toggle source

methods common to generic and date pickers

# 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) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# File lib/briar/picker/picker_shared.rb, line 14
def previous_index_for_column (column)
  picker_current_index_for_column(column) - 1
end