use isInEditMode to fix issue #49 (AndroidStudio UI preview exception)