@@ -0,0 +1,2107 @@
+package com.beepscore.android.sunshine;%0A%0Aimport android.content.Context;%0Aimport android.util.AttributeSet;%0Aimport android.view.View;%0A%0A/**%0A * Created by stevebaker on 8/30/15.%0A * Reference Lesson 5 Create your own view%0A * https://developer.android.com/reference/android/view/View.html%0A */%0Apublic class MyView extends View %7B%0A    /**%0A     * constructor for creating view through code%0A     */%0A    public MyView(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    /**%0A     * constructor for inflating a view from XML%0A     */%0A    public MyView(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A    %7D%0A%0A    /**%0A     * constructor for inflating a view from XML and%0A     * apply a class-specific base style from a theme attribute%0A     */%0A    public MyView(Context context, AttributeSet attrs, int defaultStyleAttr) %7B%0A        super(context, attrs, defaultStyleAttr);%0A    %7D%0A%0A    /**%0A     * http://stackoverflow.com/questions/12266899/onmeasure-custom-view-explanation%0A     */%0A    @Override%0A    protected void onMeasure(int wMeasureSpec,%0A                             int hMeasureSpec) %7B%0A%0A        // base class View defaults to 100 x 100%0A        int hSpecMode = MeasureSpec.getMode(hMeasureSpec);%0A        int hSpecSize = MeasureSpec.getSize(hMeasureSpec);%0A%0A        int myHeight = hSpecSize;%0A        if (hSpecMode == MeasureSpec.EXACTLY) %7B%0A            myHeight = hSpecSize;%0A        %7D else if (hSpecMode == MeasureSpec.AT_MOST%0A                %7C%7C hSpecMode == MeasureSpec.UNSPECIFIED) %7B%0A            // typically means layout_height was set to wrap_content%0A            myHeight = 200;%0A        %7D%0A%0A        int wSpecMode = MeasureSpec.getMode(hMeasureSpec);%0A        int wSpecSize = MeasureSpec.getSize(hMeasureSpec);%0A        int myWidth = wSpecSize;%0A        if (wSpecMode == MeasureSpec.EXACTLY) %7B%0A            myWidth = wSpecSize;%0A        %7D else if (wSpecMode == MeasureSpec.AT_MOST%0A                %7C%7C wSpecMode == MeasureSpec.UNSPECIFIED) %7B%0A            // typically means layout_height was set to wrap_content%0A            myWidth = 200;%0A        %7D%0A%0A        setMeasuredDimension(myWidth, myHeight);%0A    %7D%0A%7D%0A

Add custom view class MyView extends View.