옵션 |
|
1 2 3 4 | private void moveCursor(int x, int y){ mParams.x += x; mParams.y += y; } | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | cursorThread = new Thread(new Runnable() { public void run() { while (!(cursorThread.isInterrupted())) { new Handler(Looper.getMainLooper()).post(new Runnable() { // new Handler and Runnable @Override public void run() { if(global.getMove(true) != 0 && global.getMove(false) != 0){ Log.d("MOVE", "x = "+(int)(global.getMove(true)/2)+", y = "+(int)(global.getMove(false)/1)); } moveCursor(1, 1);//뷰의 위치를 x+= 1, y+= 1 만큼 이동 mWindowManager.updateViewLayout(mCursorView, mParams); /*try { Thread.sleep(10); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); }*/ } }); } } }); | cs |