0

My Nexus 10 updated to Android 4.3 a couple days ago and I noticed now I'm having a weird issue with my EditText views. Instead of the black border being around the text, it's around the view.

Here's my code I used for drawing the black border around my text. It works great..or so I thought. This could possibly be a bug with Android 4.3? That's the only device I have the issue on, and I didn't it when it was running Android 4.2.

Override draw method:

@Override
public void draw(Canvas aCanvas)
{
    BLACK_BORDER_PAINT.setColor(Color.BLACK);
    aCanvas.saveLayer(null, BLACK_BORDER_PAINT, Canvas.FULL_COLOR_LAYER_SAVE_FLAG | Canvas.MATRIX_SAVE_FLAG);
    drawBackground(aCanvas, -border_width, -border_width);
    drawBackground(aCanvas, border_width + border_width, 0);
    drawBackground(aCanvas, 0, border_width + border_width);
    drawBackground(aCanvas, -border_width - border_width, 0);
    aCanvas.restore();
    super.draw(aCanvas);
}

drawBackground:

private void drawBackground(Canvas aCanvas, int aDX, int aDY)
{
    aCanvas.translate(aDX, aDY);
    super.draw(aCanvas);
}

The paint:

private static final Paint BLACK_BORDER_PAINT = new Paint();

static
{
    BLACK_BORDER_PAINT.setXfermode(new PorterDuffXfermode(Mode.DST_OUT));
}

Any opinions? I feel like it could be a bug, but it's hard to say. I could just be missing something. I've tried a lot of different things, but haven't found a solution for Android 4.3 yet.

4

0 回答 0