package com.ikea.kompis.util;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.PathEffect;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
import com.ikea.kompis.R.styleable;

public class DashedLine extends View
{
  private PathEffect mEffect;
  private Paint mPaint;
  private Path mPath;

  public DashedLine(Context paramContext)
  {
    this(paramContext, null);
  }

  public DashedLine(Context paramContext, AttributeSet paramAttributeSet)
  {
    this(paramContext, paramAttributeSet, 2130771981);
  }

  public DashedLine(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
    init(paramContext, paramContext.obtainStyledAttributes(paramAttributeSet, R.styleable.DashLineHelper, paramInt, 0));
  }

  private void init(Context paramContext, TypedArray paramTypedArray)
  {
    float f = getResources().getDisplayMetrics().density;
    this.mPaint = new Paint();
    this.mPaint.setColor(paramTypedArray.getColor(0, 2131492940));
    boolean bool = paramTypedArray.getBoolean(1, true);
    this.mPaint.setStyle(Paint.Style.STROKE);
    this.mPaint.setStrokeWidth(f);
    this.mPath = new Path();
    if (bool)
    {
      this.mEffect = new DashPathEffect(new float[] { 8.0F, 4.0F, 8.0F, 4.0F }, 0.0F);
      return;
    }
    this.mEffect = new DashPathEffect(new float[] { 8.0F, 0.0F, 8.0F, 0.0F }, 0.0F);
  }

  public void needDashedLine(boolean paramBoolean)
  {
    if (paramBoolean);
    for (this.mEffect = new DashPathEffect(new float[] { 8.0F, 4.0F, 8.0F, 4.0F }, 0.0F); ; this.mEffect = new DashPathEffect(new float[] { 8.0F, 0.0F, 8.0F, 0.0F }, 0.0F))
    {
      invalidate();
      return;
    }
  }

  protected void onDraw(Canvas paramCanvas)
  {
    super.onDraw(paramCanvas);
    this.mPaint.setPathEffect(this.mEffect);
    int i = getMeasuredHeight();
    int j = getMeasuredWidth();
    this.mPath.moveTo(0.0F, i / 2);
    this.mPath.lineTo(j, i / 2);
    paramCanvas.drawPath(this.mPath, this.mPaint);
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.ikea.kompis.util.DashedLine
 * JD-Core Version:    0.6.2
 */