i have created a custom popup to show on mapview
here is the code
- Code: Select all
public class BalloonLayout extends LinearLayout
{
private Paint panelPaint, borderPaint ;
public BalloonLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public BalloonLayout(Context context) {
super(context);
init();
}
private void init() {
panelPaint = new Paint();
panelPaint.setARGB(0, 0, 0, 0); //gray
//innerPaint.setAntiAlias(true);
borderPaint = new Paint();
borderPaint.setARGB(255, 255, 0, 0);
borderPaint.setColor(Color.rgb(255, 106, 0));
borderPaint.setAntiAlias(true);
borderPaint.setStyle(Style.STROKE);
borderPaint.setStrokeWidth(2);
}
public void setInnerPaint(Paint innerPaint) {
this.panelPaint = innerPaint;
}
public void setBorderPaint(Paint borderPaint) {
this.borderPaint = borderPaint;
}
@Override
protected void dispatchDraw(Canvas canvas) {
RectF baloonRect = new RectF();
baloonRect.set(0,0, getMeasuredWidth(),2*(getMeasuredHeight()/3) );
panelPaint.setARGB(230, 255, 255, 255);
canvas.drawRoundRect(baloonRect, 10, 10, panelPaint);
canvas.drawRoundRect(baloonRect, 10, 10, borderPaint);
Path baloonTip = new Path();
baloonTip.moveTo(5*(getMeasuredWidth()/8), 2*(getMeasuredHeight()/3));
baloonTip.lineTo(getMeasuredWidth()/2, getMeasuredHeight());
baloonTip.lineTo(3*(getMeasuredWidth()/4), 2*(getMeasuredHeight()/3));
canvas.drawPath(baloonTip, panelPaint);
canvas.drawPath(baloonTip, borderPaint);
super.dispatchDraw(canvas);
}
}
please note it is showing line above triangle which looks weired
any one suggest me what mistake am i doing here or how can i remove this ugly line?



