MakeupImageView.java 1.46 KB
package com.bitstrips.imoji.abv3.option;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;

public class MakeupImageView
  extends AppCompatImageView
{
  boolean a = true;
  final Path b = new Path();
  
  public MakeupImageView(Context paramContext)
  {
    super(paramContext);
  }
  
  public MakeupImageView(Context paramContext, @Nullable AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
  }
  
  protected void onDraw(Canvas paramCanvas)
  {
    int i = paramCanvas.getWidth();
    int j = paramCanvas.getHeight();
    paramCanvas.save();
    RectF localRectF = new RectF(0.0F, 0.0F, i, j);
    float f2 = i / 2.0F;
    float f1 = j / 2.0F;
    if (!this.a)
    {
      f2 = i / 4.0F;
      f1 = j / 4.0F;
    }
    this.b.addRoundRect(localRectF, f2, f1, Path.Direction.CW);
    paramCanvas.clipPath(this.b);
    paramCanvas.drawColor(-1);
    super.onDraw(paramCanvas);
    paramCanvas.restore();
  }
  
  public void setCircle()
  {
    this.a = true;
  }
  
  public void setSquare()
  {
    this.a = false;
  }
}


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