mã này để kéo màn hình hiện tại lên.di chuyển chậm hoặc nhanh (cuộn) bằng cách sử dụng robotium
int screenWidth = getActivity().getWindowManager().getDefaultDisplay().getWidth();
int screenHeight = getActivity().getWindowManager().getDefaultDisplay().getHeight();
int fromX, toX, fromY, toY = 0;
fromX = screenWidth/2;
toX = screenWidth/2;
fromY = (screenHeight/2) + (screenHeight/3);
toY = (screenHeight/2) - (screenHeight/3);
int scroll_time = 10000;
solo.sleep(5000);
// Drag UP
solo.drag(fromX, toX, fromY, toY, 40);
Log.d(TAG, "Drag 1");
// here default origin (x,y = 0,0) is left upper corner
cuộn ở đây hoạt động nhưng rất chậm.
Vì vậy, để nhanh chóng cuộn những thay đổi nào trong mã này được yêu cầu?
Cảm ơn rất nhiều Royston Pinto, làm việc trên điện thoại của tôi Galaxy Ace tốt. –