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

I know another use said other places were required, but for me this was enough to make the exception in the UI Preview to go away.