Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Synced latest changes" #2

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ android {
minSdkVersion 24
targetSdkVersion 29
versionCode 106
versionName '1.0.7-rs_adbserver_testbranch-main_lab-test25'
versionName '1.0.7-rs_adbserver_testbranch-tinydisplay_lab-test08'

}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,20 @@ private static GestureDescription createClick (PointF clickPoint, long duration)
return clickBuilder.build();
}

private void createSwipe (PointF originPoint, int direction, int momentum) {

final int DURATION = 300 - scrollSpeed*10;
private GestureDescription createSwipe (PointF originPoint, int direction, int momentum) {
final int DURATION = scrollSpeed + 20;
Path clickPath = new Path();
PointF lineDirection = new PointF(originPoint.x + (75 + momentum) * PointerControl.dirX[direction], originPoint.y + (75+momentum) * PointerControl.dirY[direction]);
mService.shellSwipe((int) originPoint.x, (int) originPoint.y, (int) lineDirection.x, (int) lineDirection.y, DURATION);
PointF lineDirection = new PointF(originPoint.x + (momentum + 75) * PointerControl.dirX[direction], originPoint.y + (momentum + 75) * PointerControl.dirY[direction]);

try {
Thread.sleep(DURATION + 200);
} catch (InterruptedException e) {
Log.e(LOG_TAG, "Thread interrupted: ",e);
}
mService.shellSwipe((int) originPoint.x, (int) originPoint.y, (int) lineDirection.x, (int) lineDirection.y, DURATION);

clickPath.moveTo(originPoint.x, originPoint.y);
clickPath.lineTo(lineDirection.x, lineDirection.y);
GestureDescription.StrokeDescription clickStroke =
new GestureDescription.StrokeDescription(clickPath, 0, DURATION);
GestureDescription.Builder clickBuilder = new GestureDescription.Builder();
clickBuilder.addStroke(clickStroke);
return clickBuilder.build();
}

public boolean perform (KeyEvent keyEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void shellSwipe(Integer x1, Integer y1, Integer x2, Integer y2, Integer d
// Log.i(TAG_NAME, "Succeeded ? ===> " + response.isSuccessful());
// }
// });
sendShellInput("swipe " + x1.toString() + " " + y1.toString() + " " + x2.toString() + " " + y2.toString() + " " + duration.toString());
sendShellInput("swipe " + x1.toString() + " " + y1.toString() + " " + x2.toString() + " " + y2.toString());
}

public void shellTap(Integer x, Integer y) {
Expand Down