Sha256: d9cfcbcd182568d895a051ce08c4c3815af126e1868f2be8e3fd23398505ebed

Contents?: true

Size: 1.02 KB

Versions: 15

Compression:

Stored size: 1.02 KB

Contents

require 'calabash-cucumber'

module Briar
  module Picker_Shared
    def picker_current_index_for_column (column)
      arr = query("pickerTableView", :selectionBarRow)
      arr[column]
    end
    # methods common to generic and date pickers
    def picker_current_index_for_column_is(column, val)
      picker_current_index_for_column(column) == val
    end

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

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

    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

    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
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
briar-0.1.3.b6 lib/briar/picker/picker_shared.rb
briar-0.1.3.b5 lib/briar/picker/picker_shared.rb
briar-0.1.3.b4 lib/briar/picker/picker_shared.rb
briar-0.1.3.b3 lib/briar/picker/picker_shared.rb
briar-0.1.3.b2 lib/briar/picker/picker_shared.rb
briar-0.1.3.b1 lib/briar/picker/picker_shared.rb
briar-0.1.2 lib/briar/picker/picker_shared.rb
briar-0.1.1 lib/briar/picker/picker_shared.rb
briar-0.1.0 lib/briar/picker/picker_shared.rb
briar-0.0.9 lib/briar/picker/picker_shared.rb
briar-0.0.8 lib/briar/picker/picker_shared.rb
briar-0.0.7 lib/briar/picker/picker_shared.rb
briar-0.0.6 lib/briar/picker/picker_shared.rb
briar-0.0.5 lib/briar/picker/picker_shared.rb
briar-0.0.4 lib/briar/picker/picker_shared.rb