Class: Applitools::Appium::AndroidScreenshot

Inherits:
Screenshot show all
Defined in:
lib/applitools/appium/android_screenshot.rb

Constant Summary

Constants inherited from EyesScreenshot

EyesScreenshot::COORDINATE_TYPES

Instance Attribute Summary

Attributes inherited from Screenshot

#device_pixel_ratio, #status_bar_height

Attributes inherited from EyesScreenshot

#image, #top_left_location

Instance Method Summary collapse

Methods inherited from Screenshot

#initialize, #sub_screenshot

Methods inherited from EyesScreenshot

#initialize, #sub_screenshots

Methods included from Helpers

#abstract_attr_accessor, #abstract_method, #env_variable, #environment_attribute, environment_variables

Constructor Details

This class inherits a constructor from Applitools::Appium::Screenshot

Instance Method Details

#convert_location(location, _from, _to) ⇒ Object



15
16
17
# File 'lib/applitools/appium/android_screenshot.rb', line 15

def convert_location(location, _from, _to)
  location.offset_negative(Applitools::Location.new(0, status_bar_height))
end

#convert_region_location(region, from, to) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/applitools/appium/android_screenshot.rb', line 5

def convert_region_location(region, from, to)
  # converted_size = region.size.dup.scale_it!(1 / device_pixel_ratio)
  # converted_location = region.location.dup.offset_negative(Applitools::Location.new(0, status_bar_height)).scale_it!(1 / device_pixel_ratio)
  # Applitools::Region.from_location_size(converted_location, converted_size)
  Applitools::Region.from_location_size(
    convert_location(region.location, nil, nil),
    region.size
  ).scale_it!(1.to_f / device_pixel_ratio)
end