package com.pocketjourney.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Paint.Style;
import android.util.AttributeSet;
import android.widget.LinearLayout;

public class TransparentPanel extends LinearLayout 
{ 
	private Paint	innerPaint, borderPaint ;
    
	public TransparentPanel(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	public TransparentPanel(Context context) {
		super(context);
		init();
	}

	private void init() {
		innerPaint = new Paint();
		innerPaint.setARGB(225, 75, 75, 75); //gray
		innerPaint.setAntiAlias(true);

		borderPaint = new Paint();
		borderPaint.setARGB(255, 255, 255, 255);
		borderPaint.setAntiAlias(true);
		borderPaint.setStyle(Style.STROKE);
		borderPaint.setStrokeWidth(2);
	}
	
	public void setInnerPaint(Paint innerPaint) {
		this.innerPaint = innerPaint;
	}

	public void setBorderPaint(Paint borderPaint) {
		this.borderPaint = borderPaint;
	}

    @Override
    protected void dispatchDraw(Canvas canvas) {
    	
    	RectF drawRect = new RectF();
    	drawRect.set(0,0, getMeasuredWidth(), getMeasuredHeight());
    	
    	canvas.drawRoundRect(drawRect, 5, 5, innerPaint);
		canvas.drawRoundRect(drawRect, 5, 5, borderPaint);
		
		super.dispatchDraw(canvas);
    }
}
@@ -130,78 +130,8 @@
 t;%0D%0A
-import android.graphics.RectF;%0D%0Aimport android.graphics.Paint.Style;%0D%0A
 impo
@@ -494,16 +494,154 @@
 %0D%0A%09%7D%0D%0A%0D%0A
+%09// TODO: Clean this up properly, use attributes so that layouts can%0D%0A%09// specify colours, opacity, and maybe border colour information.%0D%0A
 %09private
@@ -710,23 +710,20 @@
 RGB(
-225, 75, 75, 75
+140, 0, 0, 0
 ); /
@@ -765,16 +765,18 @@
 ue);%0D%0A%0D%0A
+//
 %09%09border
@@ -793,24 +793,26 @@
 w Paint();%0D%0A
+//
 %09%09borderPain
@@ -839,24 +839,26 @@
 255, 255);%0D%0A
+//
 %09%09borderPain
@@ -876,24 +876,26 @@
 ias(true);%0D%0A
+//
 %09%09borderPain
@@ -921,16 +921,18 @@
 ROKE);%0D%0A
+//
 %09%09border
@@ -1210,24 +1210,26 @@
 ) %7B%0D%0A    %09%0D%0A
+//
     %09RectF d
@@ -1248,24 +1248,26 @@
 w RectF();%0D%0A
+//
     %09drawRec
@@ -1320,23 +1320,147 @@
 ht());%0D%0A
+//
     %09
-%0D%0A
+canvas.drawRect(drawRect, innerPaint);%0D%0A    %09canvas.drawRect(0, 0, getMeasuredWidth(), getMeasuredHeight(), innerPaint);%0D%0A//
     %09can
@@ -1507,16 +1507,18 @@
 aint);%0D%0A
+//
 %09%09canvas

Simplify so that it just makes the background translucent.