Update BarView.java

Using Android studio this was causing null pointer exception during the layout preview.
This small fix is preventing it, I just hope it is not breaking anything else ...