Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
R
RatelExtension
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ratel
RatelExtension
Commits
59363e00
Commit
59363e00
authored
Jun 05, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.virjar.com:ratel/ratelextension
parents
3f7dba67
1d34c054
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
ViewImage.java
...com/virjar/ratel/api/extension/superappium/ViewImage.java
+30
-20
No files found.
src/main/java/com/virjar/ratel/api/extension/superappium/ViewImage.java
View file @
59363e00
...
@@ -32,6 +32,7 @@ import java.util.ArrayList;
...
@@ -32,6 +32,7 @@ import java.util.ArrayList;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.concurrent.ThreadLocalRandom
;
import
java.util.concurrent.ThreadLocalRandom
;
import
static
android
.
view
.
MotionEvent
.
TOOL_TYPE_FINGER
;
import
static
android
.
view
.
MotionEvent
.
TOOL_TYPE_FINGER
;
...
@@ -293,22 +294,22 @@ public class ViewImage {
...
@@ -293,22 +294,22 @@ public class ViewImage {
}
}
public
boolean
click
()
{
public
boolean
click
()
{
if
(
originView
.
isClickable
())
{
//
if (originView.isClickable()) {
if
(
originView
.
performClick
())
{
//
if (originView.performClick()) {
return
true
;
//
return true;
}
//
}
}
//
}
ViewImage
parentViewImage
=
parentNode
();
//
ViewImage parentViewImage = parentNode();
if
(
parentViewImage
!=
null
)
{
//
if (parentViewImage != null) {
View
parentOriginView
=
parentViewImage
.
getOriginView
();
//
View parentOriginView = parentViewImage.getOriginView();
if
(
parentOriginView
instanceof
AdapterView
)
{
//
if (parentOriginView instanceof AdapterView) {
if
(!
originView
.
performClick
())
{
//
if (!originView.performClick()) {
if
(
clickAdapterView
((
AdapterView
)
parentOriginView
,
originView
))
{
//
if (clickAdapterView((AdapterView) parentOriginView, originView)) {
return
true
;
//
return true;
}
//
}
}
//
}
}
//
}
}
//
}
return
clickV2
();
return
clickV2
();
}
}
...
@@ -361,17 +362,26 @@ public class ViewImage {
...
@@ -361,17 +362,26 @@ public class ViewImage {
return
rootView
.
dispatchTouchEvent
(
inputEvent
);
return
rootView
.
dispatchTouchEvent
(
inputEvent
);
}
}
@SuppressLint
(
"NewApi"
)
p
rivate
boolean
clickV2
()
{
p
ublic
boolean
clickV2
()
{
float
[]
floats
=
measureClickPoint
();
float
[]
floats
=
measureClickPoint
();
return
clickByPoint
(
floats
[
0
],
floats
[
1
]);
return
clickByPoint
(
floats
[
0
],
floats
[
1
]);
}
}
private
static
Random
random
=
new
Random
();
private
float
[]
measureClickPoint
()
{
private
float
[]
measureClickPoint
()
{
int
[]
locs
=
new
int
[
2
];
int
[]
locs
=
new
int
[
2
];
originView
.
getLocationOnScreen
(
locs
);
originView
.
getLocationOnScreen
(
locs
);
float
x
=
locs
[
0
]
+
originView
.
getWidth
()
/
4
;
float
x
=
locs
[
0
];
//+ ((float) originView.getWidth() / 4) + random.nextInt(originView.getWidth() / 4);
float
y
=
locs
[
1
]
+
originView
.
getHeight
()
/
4
;
float
y
=
locs
[
1
];
//+ ((float) originView.getHeight() / 4) + random.nextInt(originView.getHeight() / 4);
if
(
originView
.
getWidth
()
>
5
)
{
x
+=
((
float
)
originView
.
getWidth
()
/
4
)
+
random
.
nextInt
(
originView
.
getWidth
()
/
4
);
}
if
(
originView
.
getHeight
()
>
5
)
{
y
+=
((
float
)
originView
.
getHeight
()
/
4
)
+
random
.
nextInt
(
originView
.
getHeight
()
/
4
);
}
float
[]
ret
=
new
float
[
2
];
float
[]
ret
=
new
float
[
2
];
ret
[
0
]
=
x
;
ret
[
0
]
=
x
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment