TextView onTouchEvent - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getWidth, onTouchEvent, EditText.invalidate
 
    public void setState(int state) {
        switch (state) {
            case STATE_NONE:
                mHandler.removeCallbacks(mScrollFade);
                mList.invalidate();
                break; 
            case STATE_VISIBLE:
                if (mState != STATE_VISIBLE) { // Optimization
                    resetThumbPos(); 
                } 
                // Fall through 
            case STATE_DRAGGING:
                mHandler.removeCallbacks(mScrollFade);
                break; 
            case STATE_EXIT:
                int viewWidth = mList.getWidth();
                mList.invalidate(viewWidth - mThumbW, mThumbY, viewWidth, mThumbY + mThumbH);
                break; 
        } 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onTouchEvent, setInputType
     
        classCode.setOnTouchListener(new View.OnTouchListener() {
             
            public boolean onTouch(View v, MotionEvent event) {
        	 
        	classCode.setInputType(InputType.TYPE_CLASS_TEXT);
        	classCode.onTouchEvent(event); 
        	 
            return true; 
             
            }  
             
        }); 
         
         
        btn.setOnClickListener(new OnClickListener() {
        	 
            private EditText code = (EditText)findViewById(R.id.cdEntry);   
            private EditText year = (EditText)findViewById(R.id.yrEntry);   
            private RadioButton sem1 = (RadioButton)findViewById(R.id.sem1Btn);
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onTouchEvent
					wm.updateViewLayout(this, winparams);
					this.invalidate();
				} 
			} 
			if(v == ed){ // pass through to the text field if we're touching it
				return ed.onTouchEvent(me);
			}else if((resizing || moving) == false){ // only start resizing or moving if not already doing those.
				if(v == resizeHandle && me.getAction() == MotionEvent.ACTION_DOWN){
					// we're touching the resize handle. start resizing 
					initialPtrX = (int)me.getRawX();
					initialPtrY = (int)me.getRawY();
					initialW = this.getWidth();
					initialH = this.getHeight();
					resizing = true;
				}else if(v == moveHandle && me.getAction() == MotionEvent.ACTION_DOWN){
					// touching the move handle, start that. 
					initialPtrX = (int)me.getRawX();
					initialPtrY = (int)me.getRawY();
					initialX = winparams.x;
					initialY = winparams.y;		
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
onTouchEvent Method Overview
Implement this method to handle touch screen motion events.
See Code Examples for other Android TextView Methods: