AvatarOptionEyeView.java 2.78 KB
package com.bitstrips.imoji.abv3.option;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Cap;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;

public class AvatarOptionEyeView
  extends AvatarBuilderOptionView
{
  private int a;
  private boolean b;
  
  public AvatarOptionEyeView(Context paramContext)
  {
    super(paramContext);
  }
  
  public AvatarOptionEyeView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
  }
  
  protected void dispatchDraw(Canvas paramCanvas)
  {
    drawEyeColor(paramCanvas, paramCanvas.getClipBounds());
    super.dispatchDraw(paramCanvas);
  }
  
  public void drawEyeColor(Canvas paramCanvas, Rect paramRect)
  {
    Paint localPaint = a.a();
    int i = Color.argb(25, 0, 0, 0);
    float f1 = paramRect.width();
    Path localPath = a.b();
    localPath.reset();
    localPath.addOval(new RectF(0.0F, 0.0F, f1, f1), Path.Direction.CW);
    localPaint.reset();
    localPaint.setFlags(1);
    localPaint.setStyle(Paint.Style.FILL);
    localPaint.setColor(this.a);
    paramCanvas.drawPath(localPath, localPaint);
    float f2 = paramRect.width() / 16;
    float f3 = f2 / 2.0F;
    localPath = a.c();
    localPath.reset();
    localPath.addOval(new RectF(f3, f3, f1 - f3, f1 - f3), Path.Direction.CW);
    localPaint.reset();
    localPaint.setFlags(1);
    localPaint.setStrokeWidth(f2);
    localPaint.setStrokeCap(Paint.Cap.ROUND);
    localPaint.setStrokeMiter(10.0F);
    localPaint.setStyle(Paint.Style.STROKE);
    localPaint.setColor(i);
    paramCanvas.drawPath(localPath, localPaint);
    if (this.b)
    {
      f2 = paramRect.width() / 2.5F;
      f1 = (f1 - f2) / 2.0F;
      paramRect = a.d();
      paramRect.reset();
      paramRect.addOval(new RectF(f1, f1, f2 + f1, f2 + f1), Path.Direction.CW);
      localPaint.reset();
      localPaint.setFlags(1);
      localPaint.setStyle(Paint.Style.FILL);
      localPaint.setColor(-16777216);
      paramCanvas.drawPath(paramRect, localPaint);
    }
  }
  
  public void setIrisColor(int paramInt)
  {
    this.a = paramInt;
    invalidate();
  }
  
  public void setPupilVisible(boolean paramBoolean)
  {
    this.b = paramBoolean;
  }
  
  static final class a
  {
    private static Paint a = new Paint();
    private static Path b = new Path();
    private static Path c = new Path();
    private static Path d = new Path();
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/bitstrips/imoji/abv3/option/AvatarOptionEyeView.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */