/** * The view flags hold various views states. */ int mViewFlags;
/** * This view wants keystrokes. Use with TAKES_FOCUS_MASK when calling * setFlags. */ staticfinalint FOCUSABLE = 0x00000001;
/** * <p>Indicates this view can be clicked. When clickable, a View reacts * to clicks by notifying the OnClickListener.<p> */ staticfinalint CLICKABLE = 0x00004000;
/** * Set flags controlling behavior of this view. * * @param flags Constant indicating the value which should be set * @param mask Constant indicating the bit range that should be changed */ voidsetFlags(int flags, int mask){ ... int old = mViewFlags; mViewFlags = (mViewFlags & ~mask) | (flags & mask);
int changed = mViewFlags ^ old; if (changed == 0) { return; } int privateFlags = mPrivateFlags; ... }