FileDocCategorySizeDatePackage
LinearLayoutWithDefaultTouchRecepient.javaAPI DocAndroid 1.5 API2242Wed May 06 22:41:56 BST 2009com.android.internal.widget

LinearLayoutWithDefaultTouchRecepient

public class LinearLayoutWithDefaultTouchRecepient extends android.widget.LinearLayout
Like a normal linear layout, but supports dispatching all otherwise unhandled touch events to a particular descendant. This is for the unlock screen, so that a wider range of touch events than just the lock pattern widget can kick off a lock pattern if the finger is eventually dragged into the bounds of the lock pattern view.

Fields Summary
private final android.graphics.Rect
mTempRect
private android.view.View
mDefaultTouchRecepient
Constructors Summary
public LinearLayoutWithDefaultTouchRecepient(android.content.Context context)


       
        super(context);
    
public LinearLayoutWithDefaultTouchRecepient(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
public booleandispatchTouchEvent(android.view.MotionEvent ev)

        if (mDefaultTouchRecepient == null) {
            return super.dispatchTouchEvent(ev);
        }

        if (super.dispatchTouchEvent(ev)) {
            return true;
        }
        mTempRect.set(0, 0, 0, 0);
        offsetRectIntoDescendantCoords(mDefaultTouchRecepient, mTempRect);
        ev.setLocation(ev.getX() + mTempRect.left, ev.getY() + mTempRect.top);
        return mDefaultTouchRecepient.dispatchTouchEvent(ev);
    
public voidsetDefaultTouchRecepient(android.view.View defaultTouchRecepient)

        mDefaultTouchRecepient = defaultTouchRecepient;