MotionEvent getYPrecision - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for MotionEvent getYPrecision method.

This code example shows how to use the following methods:getAction, getX, getXPrecision, getY, getYPrecision
	final public void sendQuitEvent() { 
		_residualvm.pushEvent(JE_QUIT, 0, 0, 0, 0, 0, 0);
	} 
 
	public boolean onTrackballEvent(MotionEvent e) {
		_residualvm.pushEvent(JE_BALL, e.getAction(),
							(int)(e.getX() * e.getXPrecision() * 100),
							(int)(e.getY() * e.getYPrecision() * 100),
							0, 0, 0); 
		return true; 
	} 
 
	final static int MSG_MENU_LONG_PRESS = 1;
 
	final private Handler keyHandler = new Handler() {
		@Override 
		public void handleMessage(Message msg) { 
			if (msg.what == MSG_MENU_LONG_PRESS) { 
				InputMethodManager imm = (InputMethodManager) 
					_context.getSystemService(_context.INPUT_METHOD_SERVICE); 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDeviceId, getDownTime, getEdgeFlags, getEventTime, getMetaState
			return false; 
		} 
		 
		private boolean actionMove(MotionEvent event)
		{ 
			int newDistance = mMotionStartX - (int) event.getX();
			int newDirection;
			 
			if(newDistance<0) //backwards
			{ 
				newDirection =  (mDistanceX+4 <= newDistance) ? 1 : -1;  //the distance +4 is to allow for jitter
			} 
			else //forwards 
			{ 
				newDirection =  (mDistanceX-4 <= newDistance) ? 1 : -1;  //the distance -4 is to allow for jitter
			} 
			 
			 
			if(newDirection != mPreviousDirection && !mFirstMotionEvent)//changed direction, so reset start point
			{ 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDeviceId, getDownTime, getEdgeFlags, getEventTime, getMetaState
            return false; 
        } 
 
        private boolean actionMove(MotionEvent event)
        { 
            int newDistance = mMotionStartX - (int) event.getX();
            int newDirection;
 
            if (newDistance < 0) // backwards
            { 
                newDirection = (mDistanceX + 4 <= newDistance) ? 1 : -1; // the
                                                                         // distance 
                                                                         // +4 
                                                                         // is 
                                                                         // to 
                                                                         // allow 
                                                                         // for 
                                                                         // jitter 
            } 
            else // forwards 

6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related MotionEvent getYPrecision Questions & Answers:

getYPrecision Method Overview
Return the precision of the Y coordinates being reported.
See Code Examples for other Android MotionEvent Methods: