title: How do I draw a circle with a margin surrounding a containing image?
body: <p>I only have a RemoteViews object that contains my individual views.  I have the following layout for this RemoteViews object:</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"
      android:gravity="center"&gt;
  
  &lt;LinearLayout
          android:layout_width="50dp"
          android:layout_height="52dp"
          android:layout_marginLeft="10dp"
          android:gravity="center"&gt;
  &lt;ImageView
          android:contentDescription="icon"
          android:id="@+id/icon"
          android:layout_width="30dp"
          android:layout_height="30dp"
          android:src="@drawable/dog"
          /&gt;
  &lt;/LinearLayout&gt;
  &lt;TextView
          android:id="@+id/description"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textColor="@android:color/white"
          android:layout_marginLeft="10dp"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I am trying to draw a circle around the icon with some space in between; I don't want to trace the circle around the icon, I want there to be some whitespace in between(like a target sign).  </p>
  
  <p>I thought by specifying a radius larger than the imageview dimensions I could accomplish this, but the outer circle gets cut off at some parts; here "views" is the RemoteViews object:</p>
  
  <pre><code>Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),    
                  R.drawable.dog);
  Bitmap workingBitmap = Bitmap.createBitmap(bitmap);
  Bitmap mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888, 
                         true);
  Canvas canvas = new Canvas(mutableBitmap);
  
  Paint paint = new Paint();
  paint.setAntiAlias(true);
  paint.setColor(Color.WHITE);
  paint.setStyle(Paint.Style.STROKE);
  paint.setStrokeWidth(6);
  
  int centerCoordinate = mutableBitmap.getWidth()/2;
  canvas.drawCircle(centerCoordinate, centerCoordinate, 
  centerCoordinate+15, paint);
  
  // equivalent to imageView.setImageBitmap
  views.setImageViewBitmap(R.id.icon, mutableBitmap);
  </code></pre>