device_api-android 1.2.16 → 1.2.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a60d874192e707106199039e8d1163d7ef5a9ca0
4
- data.tar.gz: 66017f7dbf4e46e8ea407c6a7c0b7d0f2dc2eed7
3
+ metadata.gz: c33f2b423b46f2379ff4d39c9361433f594a42d7
4
+ data.tar.gz: 8a339deec28540ad5e7828090355391e1fe55b65
5
5
  SHA512:
6
- metadata.gz: d990e5a3d73eb9e27e77302ca8a98e172b4f04f2ee352f93fd78abd17ace2ee6818eab4768014a635c7919b3ac0a0ff70a9aca24dac3f2d0310e3586634ebca8
7
- data.tar.gz: e205e6b2789fd07565e0bb0765d207afbce0a76a8d473c28c0a45ef31a42bfd1dce3dbc5f7f5f9a2d2d4457cb2c900d397d077c06499a1ab53afdc6859434734
6
+ metadata.gz: 8c98f250479b2d6655abe94adf2f26a9007a818d6cc3caf841134fdb56b196e1d4cd6e8166c4f2e0401fa74d79fcfbd14d6baafc74d65fba1834fec5ed78d51c
7
+ data.tar.gz: 0fac819f51ff456635282145e24a92ef271793a2a4f55f6897e1749b392f6aed3ceaac01666f71a049b541359fc0dda1ea6404850e55534baea30fb2f8d926ca
@@ -325,6 +325,11 @@ module DeviceAPI
325
325
  end
326
326
  end
327
327
 
328
+ def resolution
329
+ res = ADB.dumpsys(qualifier, 'window | grep mUnrestrictedScreen')
330
+ /^.* (.*)x(.*)$/.match(res.first)
331
+ end
332
+
328
333
  private
329
334
 
330
335
  def get_network_info
@@ -7,17 +7,20 @@ module DeviceAPI
7
7
  # work due to Amazons implementation of the Keyguard.
8
8
  def unlock
9
9
  ADB.keyevent(qualifier, '26') unless screen_on?
10
+ ADB.swipe(qualifier, swipe_coords)
11
+ end
10
12
 
11
- return ADB.swipe(qualifier, {x_from: 900, y_from: 500, x_to: 300, y_to: 500}) if version.split('.').first.to_i < 5
12
-
13
- if orientation == :landscape
14
- coords = { x_from: 500, y_from: 750, x_to: 500, y_to: 250 }
13
+ def swipe_coords
14
+ res = resolution
15
+ x = res[1].to_i
16
+ y = res[2].to_i
17
+ if version.split('.').first.to_i < 5
18
+ {x_from: x - 100, y_from: y/2, x_to: x/6, y_to: y/2}
15
19
  else
16
- coords = { x_from: 300, y_from: 900, x_to: 300, y_to: 600 }
20
+ { x_from: x/2, y_from: y -100, x_to: x/2, y_to: y/6}
17
21
  end
18
-
19
- ADB.swipe(qualifier, coords)
20
22
  end
23
+
21
24
  end
22
25
  end
23
- end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: device_api-android
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.16
4
+ version: 1.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Buckhurst
@@ -11,62 +11,62 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-11-29 00:00:00.000000000 Z
14
+ date: 2017-01-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: device_api
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - "~>"
20
+ - - ~>
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.0.2
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rspec
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - "~>"
34
+ - - ~>
35
35
  - !ruby/object:Gem::Version
36
36
  version: '3'
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - "~>"
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
43
  version: '3'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: simplecov
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - "~>"
48
+ - - ~>
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0.12'
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - "~>"
55
+ - - ~>
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0.12'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: android-devices
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ">="
62
+ - - '>='
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ">="
69
+ - - '>='
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  description: Android implementation of DeviceAPI
@@ -76,17 +76,17 @@ extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
78
  - README.md
79
- - lib/device_api/android.rb
80
79
  - lib/device_api/android/aapt.rb
81
80
  - lib/device_api/android/adb.rb
82
- - lib/device_api/android/device.rb
83
81
  - lib/device_api/android/device/kindle.rb
84
82
  - lib/device_api/android/device/samsung.rb
83
+ - lib/device_api/android/device.rb
85
84
  - lib/device_api/android/plugins/audio.rb
86
85
  - lib/device_api/android/plugins/battery.rb
87
86
  - lib/device_api/android/plugins/disk.rb
88
87
  - lib/device_api/android/plugins/memory.rb
89
88
  - lib/device_api/android/signing.rb
89
+ - lib/device_api/android.rb
90
90
  homepage: https://github.com/bbc/device_api-android
91
91
  licenses:
92
92
  - MIT
@@ -97,17 +97,17 @@ require_paths:
97
97
  - lib
98
98
  required_ruby_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ">="
100
+ - - '>='
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">="
105
+ - - '>='
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.5.1
110
+ rubygems_version: 2.0.14
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Android Device Management API