@@ -0,0 +1,3076 @@
+package com.stefanhoth.ropasclisp;%0A%0Aimport android.graphics.Bitmap;%0Aimport android.graphics.BitmapShader;%0Aimport android.graphics.Canvas;%0Aimport android.graphics.ColorFilter;%0Aimport android.graphics.Paint;%0Aimport android.graphics.PixelFormat;%0Aimport android.graphics.Rect;%0Aimport android.graphics.RectF;%0Aimport android.graphics.Shader;%0Aimport android.graphics.drawable.Drawable;%0Aimport android.support.annotation.ColorInt;%0A%0Apublic class CircularFrameDrawable extends Drawable %7B%0A%0A    private final Drawable content;%0A    private final RectF bounds;%0A    private final Paint backgroundPaint;%0A    private final Paint contentPaint;%0A    private final Paint outlinePaint;%0A%0A    public CircularFrameDrawable(Drawable content, @ColorInt int backgroundColor, @ColorInt int outlineColor) %7B%0A        this.content = content;%0A        this.bounds = new RectF();%0A        this.backgroundPaint = getBackgroundPaint(backgroundColor);%0A        this.contentPaint = new Paint();%0A        this.outlinePaint = getOutlinePaint(outlineColor);%0A    %7D%0A%0A    private Paint getBackgroundPaint(@ColorInt int backgroundColor) %7B%0A        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);%0A        paint.setColor(backgroundColor);%0A        paint.setStyle(Paint.Style.FILL);%0A        return paint;%0A    %7D%0A%0A    private Paint getOutlinePaint(@ColorInt int outlineColor) %7B%0A        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);%0A        paint.setColor(outlineColor);%0A        paint.setStyle(Paint.Style.STROKE);%0A        return paint;%0A    %7D%0A%0A    @Override%0A    protected void onBoundsChange(Rect bounds) %7B%0A        this.bounds.set(bounds);%0A        content.setBounds(bounds);%0A        outlinePaint.setStrokeWidth(bounds.width() * .05f);%0A        contentPaint.setShader(null);%0A    %7D%0A%0A    @Override%0A    public int getIntrinsicWidth() %7B%0A        return content.getIntrinsicWidth();%0A    %7D%0A%0A    @Override%0A    public int getIntrinsicHeight() %7B%0A        return content.getIntrinsicHeight();%0A    %7D%0A%0A    @Override%0A    public void draw(Canvas canvas) %7B%0A        if (contentPaint.getShader() == null) %7B%0A            updateContentPaint(content);%0A        %7D%0A        canvas.drawOval(bounds, backgroundPaint);%0A        canvas.drawOval(bounds, contentPaint);%0A        canvas.drawOval(bounds, outlinePaint);%0A    %7D%0A%0A    private void updateContentPaint(Drawable content) %7B%0A        Rect bounds = getBounds();%0A        Bitmap bitmap = Bitmap.createBitmap(bounds.width(), bounds.height(), Bitmap.Config.ARGB_8888);%0A        content.draw(new Canvas(bitmap));%0A        contentPaint.setShader(new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));%0A    %7D%0A%0A    @Override%0A    public void setAlpha(int alpha) %7B%0A        backgroundPaint.setAlpha(alpha);%0A        contentPaint.setAlpha(alpha);%0A        outlinePaint.setAlpha(alpha);%0A    %7D%0A%0A    @Override%0A    public void setColorFilter(ColorFilter colorFilter) %7B%0A        backgroundPaint.setColorFilter(colorFilter);%0A        contentPaint.setColorFilter(colorFilter);%0A        outlinePaint.setColorFilter(colorFilter);%0A    %7D%0A%0A    @Override%0A    public int getOpacity() %7B%0A        return PixelFormat.UNKNOWN;%0A    %7D%0A%0A%7D%0A

Add custom drawable to draw hand signs with correct clipping.