use View.isInEditMode() to avoid layout graphic editing crash