guard against NPE in onSizeChanged
additional check for LayoutParams casting issue when recycling state
fix bug when default touch event execute onTouchUp