krschultz/AndroidWeatherBuoyDemo — pull request #1 by jonathan-caryl (2014-09-26 10:46:33+00:00)
Title: Fix some issues

Hi,
One of my colleagues saw your talk at Droidcon recently and pointed me to this sample app. I found it very interesting, but I couldn't get it to run properly, so I've fixed the issues I was seeing.

1) Crash every time for me with InstrumentView:

FATAL EXCEPTION: main
Process: com.kevinrschultz.weatherbuoy, PID: 29711
java.lang.VerifyError: com/kevinrschultz/weatherbuoy/views/InstrumentView
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.kevinrschultz.weatherbuoy.ui.BuoyDetailFragment.onCreateView(BuoyDetailFragment.java:46)
at android.app.Fragment.performCreateView(Fragment.java:1700)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:890)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
at android.app.BackStackRecord.run(BackStackRecord.java:684)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
at android.app.Activity.performStart(Activity.java:5240)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2157)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)

The problem is somehow caused by the code to get the labelText, so do that slightly differently

2) The text for ‘Speed’ and ‘Direction’ was being wrapped over two
lines for some reason. Changing from margin to padding fixed that.

![wrapped_text](https://cloud.githubusercontent.com/assets/2290987/4419400/574f3ac0-456a-11e4-91a8-4d2a38058c00.png)

3) Android Studio didn’t like showing any of the layouts with the
Headline/Title/Body1 styles as they were defined.