Android Open Source - android-roadkill Transparent Panel






From Project

Back to project page android-roadkill.

License

The source code is released under:

GNU General Public License

If you think the Android project android-roadkill listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package edu.ucdavis.cros.roadkill;
/*  ww w. j a va  2  s .  c o m*/
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.RectF;
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);
  }
}




Java Source Code List

edu.ucdavis.cros.roadkill.CopyOfCopyOfMySqlHandler.java
edu.ucdavis.cros.roadkill.CopyOfMySqlHandler.java
edu.ucdavis.cros.roadkill.DataBaseHelper.java
edu.ucdavis.cros.roadkill.DataList.java
edu.ucdavis.cros.roadkill.DateTime.java
edu.ucdavis.cros.roadkill.DbAdapter.java
edu.ucdavis.cros.roadkill.GPSHandler.java
edu.ucdavis.cros.roadkill.ListData.java
edu.ucdavis.cros.roadkill.MapChoose.java
edu.ucdavis.cros.roadkill.MapData.java
edu.ucdavis.cros.roadkill.MySqlHandler.java
edu.ucdavis.cros.roadkill.Roadkill.java
edu.ucdavis.cros.roadkill.SpCurAdapter.java
edu.ucdavis.cros.roadkill.TakeGps.java
edu.ucdavis.cros.roadkill.TakePhoto.java
edu.ucdavis.cros.roadkill.Tools.java
edu.ucdavis.cros.roadkill.TransparentPanel.java
edu.ucdavis.cros.roadkill.myDbAdapter.java