use isInEditMode for rendering in xml layouts