title: Custom View with animation,color and border containing inner textview
body: <p>Referring to below image, I want that view with yellow background and right border to slide in from right with some text. So this requirements include:</p>
  
  <ul>
  <li>creating a custom view (which will need canvas I guess)</li>
  <li>giving it width, height, position, color, border, border-color, etc.</li>
  <li>animation to slide from right</li>
  <li>textview within this custom view to display text</li>
  </ul>
  
  <p>I referred <a href="http://android-er.blogspot.nl/2011/08/drawpath-on-canvas.html" rel="nofollow noreferrer">this</a> tutorial to understand how to include view with a canvas in layout. But instead of hard coded point positions, I tried following:</p>
  
  <pre><code>public MyView(Context context) {
      super(context);
          WindowManager wm = (WindowManager) DashBoardActivity.mContext
                  .getSystemService(Context.WINDOW_SERVICE);
          Display display = wm.getDefaultDisplay();
          Point size = new Point();
          display.getSize(size);
          width = size.x;
          height = size.y;
  
          width -= 10;
          height -= 50;
          myPath = new Pt[6];
          myPath[0] = new Pt(width, height);
          myPath[1] = new Pt(width - 400, height);
          myPath[2] = new Pt(width - 500, height - 100);
          myPath[3] = new Pt(width - 400, height - 200);
          myPath[4] = new Pt(width, height - 200);
          myPath[5] = new Pt(width, height);
  }
  </code></pre>
  
  <p>But view is not getting positioned as per the expectation. I tried with different hard-coded positions, but either it's getting displayed at wrong position or not getting displayed at all.</p>
  
  <p>Also, to show the text, I added textview in the layout itself but it is getting displayed at top left of the screen instead of the position shown in below image.</p>
  
  <p>How I can achieve this ? Any suggestions appreciated.</p>
  
  <p><img src="https://i.imgur.com/cmhZMiM.png" alt="Image"></p>