Sha256: 25457bd39119575a864794a07f88454be66acf28298b5a5d98a535029f53e80e

Contents?: true

Size: 1.24 KB

Versions: 37

Compression:

Stored size: 1.24 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

37 entries across 37 versions & 1 rubygems

Version Path
briar-2.0.5 lib/briar/picker/picker_shared.rb
briar-2.0.4 lib/briar/picker/picker_shared.rb
briar-2.0.3 lib/briar/picker/picker_shared.rb
briar-2.0.2 lib/briar/picker/picker_shared.rb
briar-2.0.1 lib/briar/picker/picker_shared.rb
briar-2.0.0 lib/briar/picker/picker_shared.rb
briar-1.4.2 lib/briar/picker/picker_shared.rb
briar-1.4.1 lib/briar/picker/picker_shared.rb
briar-1.3.2 lib/briar/picker/picker_shared.rb
briar-1.3.1 lib/briar/picker/picker_shared.rb
briar-1.3.0 lib/briar/picker/picker_shared.rb
briar-1.2.2 lib/briar/picker/picker_shared.rb
briar-1.2.1 lib/briar/picker/picker_shared.rb
briar-1.2.0 lib/briar/picker/picker_shared.rb
briar-1.1.9 lib/briar/picker/picker_shared.rb
briar-1.1.8 lib/briar/picker/picker_shared.rb
briar-1.1.7 lib/briar/picker/picker_shared.rb
briar-1.1.6 lib/briar/picker/picker_shared.rb
briar-1.1.5 lib/briar/picker/picker_shared.rb
briar-1.1.4 lib/briar/picker/picker_shared.rb