项目:letv
文件:MaterialProgressDrawable.java
private void drawTriangle(Canvas c,float startAngle,float sweepAngle,Rect bounds) {
if (this.mShowArrow) {
if (this.mArrow == null) {
this.mArrow = new Path();
this.mArrow.setFillType(FillType.EVEN_ODD);
} else {
this.mArrow.reset();
}
float inset = ((float) (((int) this.mstrokeInset) / 2)) * this.mArrowScale;
float x = (float) ((this.mRingCenterRadius * Math.cos(0.0d)) + ((double) bounds.exactCenterX()));
float y = (float) ((this.mRingCenterRadius * Math.sin(0.0d)) + ((double) bounds.exactCenterY()));
this.mArrow.moveto(0.0f,0.0f);
this.mArrow.lineto(((float) this.mArrowWidth) * this.mArrowScale,0.0f);
this.mArrow.lineto((((float) this.mArrowWidth) * this.mArrowScale) / 2.0f,((float) this.mArrowHeight) * this.mArrowScale);
this.mArrow.offset(x - inset,y);
this.mArrow.close();
this.mArrowPaint.setColor(this.mCurrentColor);
c.rotate((startAngle + sweepAngle) - 5.0f,bounds.exactCenterX(),bounds.exactCenterY());
c.drawPath(this.mArrow,this.mArrowPaint);
}
}
private void buildShadowCorners() {
RectF innerBounds = new RectF(-this.mCornerRadius,-this.mCornerRadius,this.mCornerRadius,this.mCornerRadius);
RectF outerBounds = new RectF(innerBounds);
outerBounds.inset(-this.mShadowSize,-this.mShadowSize);
if (this.mCornerShadowPath == null) {
this.mCornerShadowPath = new Path();
} else {
this.mCornerShadowPath.reset();
}
this.mCornerShadowPath.setFillType(FillType.EVEN_ODD);
this.mCornerShadowPath.moveto(-this.mCornerRadius,0.0f);
this.mCornerShadowPath.rLineto(-this.mShadowSize,0.0f);
this.mCornerShadowPath.arcTo(outerBounds,180.0f,90.0f,false);
this.mCornerShadowPath.arcTo(innerBounds,270.0f,-90.0f,false);
this.mCornerShadowPath.close();
float startRatio = this.mCornerRadius / (this.mCornerRadius + this.mShadowSize);
this.mCornerShadowPaint.setShader(new RadialGradient(0.0f,0.0f,this.mCornerRadius + this.mShadowSize,new int[]{this.mShadowStartColor,this.mShadowStartColor,this.mShadowEndColor},new float[]{0.0f,startRatio,1.0f},TileMode.CLAMP));
this.mEdgeShadowPaint.setShader(new LinearGradient(0.0f,(-this.mCornerRadius) + this.mShadowSize,(-this.mCornerRadius) - this.mShadowSize,0.5f,TileMode.CLAMP));
this.mEdgeShadowPaint.setAntiAlias(false);
}
private void drawTriangle(Canvas c,this.mArrowPaint);
}
}
private void buildShadowCorners() {
RectF innerBounds = new RectF(-this.mCornerRadius,false);
this.mCornerShadowPath.close();
float shadowRadius = -outerBounds.top;
if (shadowRadius > 0.0f) {
float startRatio = this.mCornerRadius / shadowRadius;
float midratio = startRatio + ((1.0f - startRatio) / 2.0f);
this.mCornerShadowPaint.setShader(new RadialGradient(0.0f,shadowRadius,new int[]{0,this.mShadowMiddleColor,midratio,TileMode.CLAMP));
}
this.mEdgeShadowPaint.setShader(new LinearGradient(0.0f,innerBounds.top,outerBounds.top,SHADOW_HORIZ_SCALE,TileMode.CLAMP));
this.mEdgeShadowPaint.setAntiAlias(false);
}
public discoveryBadgerating(Context paramContext,AttributeSet paramAttributeSet)
{
super(paramContext,paramAttributeSet);
Resources localResources = getResources();
this.mBadgeRadius = (localResources.getDimensionPixelSize(2131493007) / 2);
this.mPaint = new Paint(1);
this.mOctagonPath = new Path();
this.mOctagonPath.setFillType(Path.FillType.EVEN_ODD);
setwillNotDraw(false);
this.mVertices = new PointF[8];
for (int i = 0; i < 8; i++) {
this.mVertices[i] = new PointF();
}
this.mWhiteOctagonstrokeWidth = localResources.getDimensionPixelSize(2131493299);
this.mWhiteOctagonRadius = (this.mBadgeRadius - this.mWhiteOctagonstrokeWidth - this.mWhiteOctagonstrokeWidth / 2);
this.mpressedFillColor = localResources.getColor(2131689475);
this.mpressedOutlineColor = localResources.getColor(2131689476);
this.mFocusedOutlineColor = localResources.getColor(2131689473);
this.mOutlinestrokeWidth = (0.5F * localResources.getDimensionPixelSize(2131493377));
}
@Override
public synchronized boolean draw(BoundingBox boundingBox,byte zoomLevel,Canvas canvas,Point canvasPosition) {
synchronized (this.polygonalChains) {
if (this.polygonalChains.isEmpty() || (this.paintstroke == null && this.paintFill == null)) {
return false;
}
Path path = new Path();
path.setFillType(FillType.EVEN_ODD);
for (int i = 0; i < this.polygonalChains.size(); ++i) {
polygonalChain polygonalChain = this.polygonalChains.get(i);
Path closedpath = polygonalChain.draw(zoomLevel,canvasPosition,true);
if (closedpath != null) {
path.addpath(closedpath);
}
}
if (this.paintstroke != null) {
canvas.drawPath(path,this.paintstroke);
}
if (this.paintFill != null) {
canvas.drawPath(path,this.paintFill);
}
return true;
}
}
项目:Mapyst
文件:RouteMapOverlay.java
private void drawDirections(Canvas canvas) {
paint.setShader(null);
for (int i = 0; i < directions.length; i++) {
Point[] dirPixelPoints = pixelPoints[i];
Path path = new Path();
path.setFillType(FillType.WINDING);
path.moveto(dirPixelPoints[0].x,dirPixelPoints[0].y);
for (int j = 1; j < dirPixelPoints.length; j++)
path.lineto(dirPixelPoints[j].x,dirPixelPoints[j].y);
if (directions[i].isOutside(app.campus) && i != curDir) {
canvas.drawPath(path,paint);
} else if (!directions[i].isOutside(app.campus) && i != curDir) {
setDashPathInnerPaint(i);
canvas.drawPath(path,insidePaint);
}
}
}
项目:FMTech
文件:SVGAndroidRenderer.java
private Path.FillType getClipRuleFromState()
{
if (this.state.style.clipRule == null) {
return Path.FillType.WINDING;
}
switch (1.$SwitchMap$com$caverock$androidsvg$SVG$Style$FillRule[this.state.style.clipRule.ordinal()])
{
default:
return Path.FillType.WINDING;
}
return Path.FillType.EVEN_ODD;
}
项目:FMTech
文件:lpc.java
protected final void onMeasure(int paramInt1,int paramInt2)
{
int i1 = View.MeasureSpec.getSize(paramInt1);
int i2 = i1 - this.h.m - this.h.m;
if (this.a) {
i2 -= this.d + this.h.m;
}
TextPaint localTextPaint = efj.B(getContext(),aw.ei);
boolean bool = TextUtils.isEmpty(this.b);
int i3 = 0;
if (!bool)
{
lwj locallwj = this.m;
String str = this.b;
int i10 = this.n;
Point localPoint = new Point();
lxi locallxi = (lxi)locallwj.a(0,i2,null,str,localPoint,localTextPaint,true,i10,null);
locallxi.a(localPoint.x,localPoint.y);
this.i = locallxi;
i3 = this.i.getHeight();
}
int i4 = i3 + 3 * this.h.m;
this.l = (i4 - this.h.m);
if (!this.a)
{
int i5 = i1 - this.h.m - this.h.m / 2;
int i6 = i5 - this.h.aU;
int i7 = i6 + (i5 - i6) / 2;
int i8 = this.l - (int)this.h.u.getstrokeWidth();
int i9 = i8 + this.h.aV;
this.j.setFillType(Path.FillType.EVEN_ODD);
this.j.moveto(i6,i8);
this.j.lineto(i5,i8);
this.j.lineto(i7,i9);
this.j.lineto(i6,i8);
this.j.close();
}
setMeasuredDimension(i1,i4);
}
项目:QuizUpWinner
文件:Chart.java
private void ˊ(ナ paramナ,Canvas paramCanvas)
{
int i = -1 + this.ͺ;
Path localPath = new Path();
localPath.setFillType(Path.FillType.EVEN_ODD);
localPath.moveto(this.ˏ,i);
Paint localPaint = new Paint(1);
localPaint.setPathEffect(new CornerPathEffect(4.0F));
localPaint.setColor(this.ˈ.getResources().getColor(2131230763));
localPaint.setStyle(Paint.Style.FILL);
float f1 = this.ˊ / 160.0F;
for (int j = 0; j < this.ʿ.length; j++)
{
int k = j;
if (paramナ.ˊ[k] == -1.0F)
{
float f2 = 0.0F;
if (j > 0)
f2 = this.ʿ[(j - 1)];
localPath.lineto(f2,this.ͺ);
localPath.close();
paramCanvas.drawPath(localPath,localPaint);
return;
}
int m = j;
float f3 = paramナ.ˊ[m];
float f4 = this.ʿ[j];
float f5 = this.ͺ - f1 * f3;
if (f5 == this.ͺ)
localPath.moveto(f4,i);
else
localPath.lineto(f4,f5);
}
localPath.lineto(this.ʽ,this.ͺ);
localPath.close();
paramCanvas.drawPath(localPath,localPaint);
}
项目:accelerationExplorer
文件:GaugeVector.java
/**
* Draw the gauge.
*
* @param canvas
*/
private void drawAxis(Canvas canvas) {
// Draw the Y axis
canvas.drawLine(rimRect.centerX(),rimRect.top,rimRect.centerX(),rimRect.bottom,axisPaint);
// Draw the X axis
canvas.drawLine(rimRect.left,rimRect.centerY(),rimRect.right,axisPaint);
// Draw the Y axis arrow
Path yArrowPath = new Path();
yArrowPath.setFillType(FillType.EVEN_ODD);
yArrowPath.moveto(rimRect.centerX() - 0.002f,rimRect.top);
yArrowPath.lineto(rimRect.centerX() + 0.05f,rimRect.top + 0.05f);
yArrowPath.moveto(rimRect.centerX() + 0.002f,rimRect.top);
yArrowPath.lineto(rimRect.centerX() - 0.05f,rimRect.top + 0.05f);
canvas.drawPath(yArrowPath,axisPaint);
// Draw the Y axis arrow
Path xArrowPath = new Path();
xArrowPath.setFillType(FillType.EVEN_ODD);
xArrowPath.moveto(rimRect.right,rimRect.centerY() + 0.002f);
xArrowPath.lineto(rimRect.right - 0.05f,rimRect.centerY() - 0.05f);
xArrowPath.moveto(rimRect.right,rimRect.centerY() - 0.002f);
xArrowPath.lineto(rimRect.right - 0.05f,rimRect.centerY() + 0.05f);
canvas.drawPath(xArrowPath,axisPaint);
}
项目:FlexiCrop
文件:MainActivity.java
private void cropImageByPath() {
//closing the path Now.
clipPath.close();
//setting the fill type to inverse,so that the outer part of the selected path gets filled.
clipPath.setFillType(FillType.INVERSE_WINDING);
Paint xferPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
xferPaint.setColor(Color.BLACK);
canvas.drawPath(clipPath,xferPaint);
xferPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
canvas.drawBitmap(alteredBitmap,xferPaint);
}
项目:Mapyst
文件:RouteMapOverlay.java
public void drawPath(Canvas canvas) {
Point[] curPixelPoints = pixelPoints[curDir];
// setup gradient
paint.setShader(getPathShader(curPixelPoints));
// draw path
Path path = new Path();
path.setFillType(FillType.WINDING);
path.moveto(curPixelPoints[0].x,curPixelPoints[0].y);
for (int i = 1; i < curPixelPoints.length; i += 1)
path.lineto(curPixelPoints[i].x,curPixelPoints[i].y);
canvas.drawPath(path,paint);
}
项目:FMTech
文件:CardBubbleForegroundDrawable.java
protected final void buildComponents(Rect paramRect)
{
super.buildComponents(paramRect);
this.mFullOutlinePath.reset();
this.mFullOutlinePath.setFillType(Path.FillType.EVEN_ODD);
this.mFullOutlinePath.moveto(this.mCardBounds.left + this.mCornerRadius,this.mCardBounds.top);
if (this.mBubbleGravity == 48)
{
this.mFullOutlinePath.lineto(this.mBubbleCenterX - this.mBubbleTriangleBaseSize / 2.0F,this.mCardBounds.top);
this.mOutlineCornerRect.set(this.mBubbleCenterX - this.mCornerRadius,this.mCardBounds.top - this.mBubbleSize + this.mShadowSize / 2.0F,this.mBubbleCenterX + this.mCornerRadius,this.mCardBounds.top - this.mBubbleSize + this.mShadowSize / 2.0F + 2.0F * this.mCornerRadius);
this.mFullOutlinePath.lineto(this.mOutlineCornerRect.left,this.mOutlineCornerRect.top + this.mCornerRadius / 2.0F);
this.mFullOutlinePath.arcTo(this.mOutlineCornerRect,225.0F,90.0F,false);
this.mFullOutlinePath.lineto(this.mBubbleCenterX + this.mBubbleTriangleBaseSize / 2.0F,this.mCardBounds.top);
}
this.mFullOutlinePath.lineto(this.mCardBounds.right - this.mCornerRadius,this.mCardBounds.top);
if (this.mCornerRadius > 0.0F)
{
this.mOutlineCornerRect.set(this.mCardBounds.right - 2.0F * this.mCornerRadius,this.mCardBounds.top,this.mCardBounds.right,this.mCardBounds.top + 2.0F * this.mCornerRadius);
this.mFullOutlinePath.arcTo(this.mOutlineCornerRect,270.0F,false);
}
if (this.mBubbleGravity == 5)
{
this.mFullOutlinePath.lineto(this.mCardBounds.right,this.mBubbleCenterY - this.mBubbleTriangleBaseSize / 2.0F);
this.mOutlineCornerRect.set(this.mCardBounds.right + this.mBubbleSize - this.mShadowSize / 2.0F - 2.0F * this.mCornerRadius,this.mBubbleCenterY - this.mCornerRadius,this.mCardBounds.right + this.mBubbleSize - this.mShadowSize / 2.0F,this.mBubbleCenterY + this.mCornerRadius);
this.mFullOutlinePath.lineto(this.mOutlineCornerRect.right - this.mCornerRadius / 2.0F,this.mOutlineCornerRect.top);
this.mFullOutlinePath.arcTo(this.mOutlineCornerRect,315.0F,false);
this.mFullOutlinePath.lineto(this.mCardBounds.right,this.mBubbleCenterY + this.mBubbleTriangleBaseSize / 2.0F);
}
this.mFullOutlinePath.lineto(this.mCardBounds.right,this.mCardBounds.bottom - this.mCornerRadius);
if (this.mCornerRadius > 0.0F)
{
this.mOutlineCornerRect.set(this.mCardBounds.right - 2.0F * this.mCornerRadius,this.mCardBounds.bottom - 2.0F * this.mCornerRadius,this.mCardBounds.bottom);
this.mFullOutlinePath.arcTo(this.mOutlineCornerRect,0.0F,false);
}
if (this.mBubbleGravity == 80)
{
this.mFullOutlinePath.lineto(this.mBubbleCenterX + this.mBubbleTriangleBaseSize / 2.0F,this.mCardBounds.bottom);
this.mOutlineCornerRect.set(this.mBubbleCenterX - this.mCornerRadius,this.mCardBounds.bottom + this.mBubbleSize - this.mShadowSize / 2.0F - 2.0F * this.mCornerRadius,this.mCardBounds.bottom + this.mBubbleSize - this.mShadowSize / 2.0F);
this.mFullOutlinePath.lineto(this.mOutlineCornerRect.right,this.mOutlineCornerRect.bottom - this.mCornerRadius / 2.0F);
this.mFullOutlinePath.arcTo(this.mOutlineCornerRect,45.0F,false);
this.mFullOutlinePath.lineto(this.mBubbleCenterX - this.mBubbleTriangleBaseSize / 2.0F,this.mCardBounds.bottom);
}
this.mFullOutlinePath.lineto(this.mCardBounds.left + this.mCornerRadius,this.mCardBounds.bottom);
if (this.mCornerRadius > 0.0F)
{
this.mOutlineCornerRect.set(this.mCardBounds.left,this.mCardBounds.left + 2.0F * this.mCornerRadius,false);
}
if (this.mBubbleGravity == 3)
{
this.mFullOutlinePath.lineto(this.mCardBounds.left,this.mBubbleCenterY + this.mBubbleTriangleBaseSize / 2.0F);
this.mOutlineCornerRect.set(this.mCardBounds.left - this.mBubbleSize + this.mShadowSize / 2.0F,this.mCardBounds.left - this.mBubbleSize + this.mShadowSize / 2.0F + 2.0F * this.mCornerRadius,this.mBubbleCenterY + this.mCornerRadius);
this.mFullOutlinePath.lineto(this.mOutlineCornerRect.left + this.mCornerRadius / 2.0F,this.mOutlineCornerRect.bottom);
this.mFullOutlinePath.arcTo(this.mOutlineCornerRect,135.0F,false);
this.mFullOutlinePath.lineto(this.mCardBounds.left,this.mBubbleCenterY - this.mBubbleTriangleBaseSize / 2.0F);
}
this.mFullOutlinePath.lineto(this.mCardBounds.left,this.mCardBounds.top + this.mCornerRadius);
if (this.mCornerRadius > 0.0F)
{
this.mOutlineCornerRect.set(this.mCardBounds.left,180.0F,false);
}
this.mFullOutlinePath.close();
}
public StarratingBar(Context paramContext,paramAttributeSet);
Resources localResources = paramContext.getResources();
TypedArray localTypedArray = paramContext.obtainStyledAttributes(paramAttributeSet,R.styleable.StarratingBar);
this.mGap = localTypedArray.getDimensionPixelSize(R.styleable.StarratingBar_gap,0);
this.mrating = localTypedArray.getFloat(R.styleable.StarratingBar_rating,0.0F);
this.mStarHeight = localTypedArray.getDimensionPixelSize(R.styleable.StarratingBar_star_height,localResources.getDimensionPixelSize(R.dimen.play_star_height_default));
this.mRange = localTypedArray.getInt(R.styleable.StarratingBar_range,5);
this.mShowEmptyStars = localTypedArray.getBoolean(R.styleable.StarratingBar_show_empty_stars,true);
this.mIsInCompactMode = localTypedArray.getBoolean(R.styleable.StarratingBar_compact_mode,false);
this.mTextSize = localTypedArray.getDimensionPixelSize(R.styleable.StarratingBar_text_size,localResources.getDimensionPixelSize(R.dimen.play_medium_size));
int i = localTypedArray.getColor(R.styleable.StarratingBar_star_color,localResources.getColor(R.color.play_white));
int j = localTypedArray.getColor(R.styleable.StarratingBar_star_bg_color,localResources.getColor(R.color.play_transparent));
localTypedArray.recycle();
this.mStarPaint = new Paint(1);
this.mStarPaint.setColor(i);
this.mStarPaint.setStyle(Paint.Style.FILL);
this.mStarBackgroundPaint = new Paint(1);
this.mStarBackgroundPaint.setColor(j);
this.mStarBackgroundPaint.setStyle(Paint.Style.FILL);
this.mStarPath = new Path();
this.mStarPath.setFillType(Path.FillType.EVEN_ODD);
this.mLeftHalfStarPath = new Path();
this.mLeftHalfStarPath.setFillType(Path.FillType.EVEN_ODD);
this.mRightHalfStarPath = new Path();
this.mRightHalfStarPath.setFillType(Path.FillType.EVEN_ODD);
this.mRadius = (this.mStarHeight / (1.0D + Math.sin(0.9424777960769379D)));
this.mShorTradius = (Math.sin(0.3926990816987241D) * this.mRadius / Math.sin(2.12057504117311D));
this.mHalfStarWidth = ((float)(this.mRadius * Math.sin(1.256637061435917D)));
this.mVertices = new PointF[10];
for (int k = 0; k < 10; k++) {
this.mVertices[k] = new PointF();
}
this.mTextPaint = new TextPaint(1);
this.mTextPaint.density = localResources.getdisplayMetrics().density;
this.mTextPaint.setTextSize(this.mTextSize);
this.mTextPaint.setFakeBoldText(false);
Paint.FontMetrics localFontMetrics = this.mTextPaint.getFontMetrics();
this.mTextHeight = ((int)(Math.abs(localFontMetrics.top) + Math.abs(localFontMetrics.bottom)));
this.mTextBaseline = ((int)Math.abs(localFontMetrics.top));
updateratingDescription();
this.mVertices[0].x = 0.0F;
this.mVertices[0].y = (-1.0F * (float)this.mRadius);
this.mVertices[1].x = ((float)(this.mShorTradius * Math.sin(0.6283185307179586D)));
this.mVertices[1].y = (-1.0F * (float)(this.mShorTradius * Math.cos(0.6283185307179586D)));
this.mVertices[2].x = ((float)(this.mRadius * Math.sin(1.256637061435917D)));
this.mVertices[2].y = (-1.0F * (float)(this.mRadius * Math.cos(1.256637061435917D)));
this.mVertices[3].x = ((float)(this.mShorTradius * Math.sin(1.256637061435917D)));
this.mVertices[3].y = ((float)(this.mShorTradius * Math.cos(1.256637061435917D)));
this.mVertices[4].x = ((float)(this.mRadius * Math.sin(0.6283185307179586D)));
this.mVertices[4].y = ((float)((float)this.mRadius * Math.cos(0.6283185307179586D)));
this.mVertices[5].x = 0.0F;
this.mVertices[5].y = ((float)this.mShorTradius);
this.mVertices[6].x = (-1.0F * this.mVertices[4].x);
this.mVertices[6].y = this.mVertices[4].y;
this.mVertices[7].x = (-1.0F * this.mVertices[3].x);
this.mVertices[7].y = this.mVertices[3].y;
this.mVertices[8].x = (-1.0F * this.mVertices[2].x);
this.mVertices[8].y = this.mVertices[2].y;
this.mVertices[9].x = (-1.0F * this.mVertices[1].x);
this.mVertices[9].y = this.mVertices[1].y;
initializeStarPaths();
setwillNotDraw(false);
}
项目:FMTech
文件:MaterialProgressDrawable.java
public final void draw(Canvas paramCanvas)
{
Rect localRect = getBounds();
int i = paramCanvas.save();
paramCanvas.rotate(this.mRotation,localRect.exactCenterX(),localRect.exactCenterY());
Ring localRing = this.mRing;
RectF localRectF = localRing.mTempBounds;
localRectF.set(localRect);
localRectF.inset(localRing.mstrokeInset,localRing.mstrokeInset);
float f1 = 360.0F * (localRing.mStartTrim + localRing.mRotation);
float f2 = 360.0F * (localRing.mEndTrim + localRing.mRotation) - f1;
localRing.mPaint.setColor(localRing.mCurrentColor);
paramCanvas.drawArc(localRectF,f1,f2,false,localRing.mPaint);
if (localRing.mShowArrow)
{
if (localRing.mArrow != null) {
break label427;
}
localRing.mArrow = new Path();
localRing.mArrow.setFillType(Path.FillType.EVEN_ODD);
}
for (;;)
{
float f3 = (int)localRing.mstrokeInset / 2 * localRing.mArrowScale;
float f4 = (float)(localRing.mRingCenterRadius * Math.cos(0.0D) + localRect.exactCenterX());
float f5 = (float)(localRing.mRingCenterRadius * Math.sin(0.0D) + localRect.exactCenterY());
localRing.mArrow.moveto(0.0F,0.0F);
localRing.mArrow.lineto(localRing.mArrowWidth * localRing.mArrowScale,0.0F);
localRing.mArrow.lineto(localRing.mArrowWidth * localRing.mArrowScale / 2.0F,localRing.mArrowHeight * localRing.mArrowScale);
localRing.mArrow.offset(f4 - f3,f5);
localRing.mArrow.close();
localRing.mArrowPaint.setColor(localRing.mCurrentColor);
paramCanvas.rotate(f1 + f2 - 5.0F,localRect.exactCenterY());
paramCanvas.drawPath(localRing.mArrow,localRing.mArrowPaint);
if (localRing.mAlpha < 255)
{
localRing.mCirclePaint.setColor(localRing.mBackgroundColor);
localRing.mCirclePaint.setAlpha(255 - localRing.mAlpha);
paramCanvas.drawCircle(localRect.exactCenterX(),localRect.exactCenterY(),localRect.width() / 2,localRing.mCirclePaint);
}
paramCanvas.restoretoCount(i);
return;
label427:
localRing.mArrow.reset();
}
}
项目:FMTech
文件:hfb.java
public hfb(Context paramContext,AttributeSet paramAttributeSet,int paramInt)
{
super(paramContext,paramAttributeSet,paramInt);
setwillNotDraw(false);
Context localContext = getContext();
Resources localResources = localContext.getResources();
this.B = localResources.getDimensionPixelSize(aau.yx);
this.A = localResources.getDrawable(aau.yD);
this.w = localResources.getDimensionPixelSize(aau.yv);
this.g = localResources.getDimensionPixelSize(aau.yw);
this.b = localResources.getDimensionPixelSize(aau.yB);
this.l = localResources.getDimensionPixelSize(aau.yC);
int i1 = this.l;
int i2 = this.b;
int i3 = localResources.getColor(aau.yn);
Point localPoint1 = new Point(0,0);
Point localPoint2 = new Point(0,i2);
Point localPoint3 = new Point(i1,i2 / 2);
Path localPath = new Path();
localPath.setFillType(Path.FillType.EVEN_ODD);
localPath.lineto(localPoint2.x,localPoint2.y);
localPath.lineto(localPoint3.x,localPoint3.y);
localPath.lineto(localPoint1.x,localPoint1.y);
localPath.close();
ShapeDrawable localShapeDrawable = new ShapeDrawable(new PathShape(localPath,i1,i2));
localShapeDrawable.getPaint().setColor(i3);
this.a = localShapeDrawable;
this.u = localResources.getDimensionPixelSize(aau.ys);
this.v = localResources.getDimensionPixelOffset(aau.yr);
this.x = localResources.getDimensionPixelSize(aau.yp);
this.C = localResources.getDimensionPixelSize(aau.yu);
this.c = new Button(localContext,0);
TypedArray localTypedArray = localContext.obtainStyledAttributes(new int[] { 16843534 });
this.c.setBackgroundResource(localTypedArray.getResourceId(0,0));
localTypedArray.recycle();
this.c.setGravity(16);
this.c.setMaxLines(1);
this.c.setEllipsize(TextUtils.TruncateAt.END);
this.c.setVisibility(8);
addView(this.c);
this.e = new TextView(localContext);
this.e.setEllipsize(TextUtils.TruncateAt.END);
addView(this.e);
this.d = new TextView(localContext);
this.d.setMaxLines(1);
this.d.setEllipsize(TextUtils.TruncateAt.END);
addView(this.d);
this.f = new TextView(localContext);
this.f.setMaxLines(1);
this.f.setEllipsize(TextUtils.TruncateAt.END);
this.f.setTextAppearance(localContext,aau.yL);
addView(this.f);
this.i = new TextView(localContext);
this.i.setGravity(16);
this.i.setTextAppearance(localContext,aau.yL);
this.i.setAllCaps(true);
this.i.setText(localResources.getString(efj.Gq));
this.i.setVisibility(8);
addView(this.i);
}
@Override
public void draw(Canvas canvas) {
//must be located here
mPaint.setColor(mContext.getResources().getColor(android.R.color.holo_orange_light));
mPaint.setStyle(Style.stroke);
mPaint.setstrokeWidth(RateChartConst.slinewidth);
mPaint.setAntiAlias(true);
RateChartManager manager = mManager;
int columns = manager.getColumnNum();
double[] YValues = manager.getYValues();
if (YValues == null || YValues.length < columns) return;
double[] yValues = new double[YValues.length];
System.arraycopy(YValues,yValues,yValues.length);
double[] yCoordinates = manager.getYCoordinates();
double deltaYCoordinatemm = RateDataHelper.getAbsDeltaMaxMin(yCoordinates);
double maxYCoordinate = RateDataHelper.getMax(yCoordinates);
//draw y coordinate value.
float[] drawYValue = new float[YValues.length];
for (int m = 0; m < yValues.length; m++) {
drawYValue[m] =
(float) (mRegionHeight * (maxYCoordinate - yValues[m]) / deltaYCoordinatemm);
}
// line path
mLinePath.reset();
mLinePath.moveto(mMarginLeft,mMarginTop + drawYValue[0]);
mShaderPath.reset();
mShaderPath.moveto(mMarginLeft,mMarginTop + drawYValue[0]);
float deltaX = mRegionWidth / (columns - 1);
if (columns < RateChartConst.sColumnNum) {
deltaX = mRegionWidth / (RateChartConst.sColumnNum - 1);
}
for (int i = 1; i < columns; i++) {
mLinePath.lineto(mMarginLeft + deltaX * i,drawYValue[i] + mMarginTop);
mShaderPath.lineto(mMarginLeft + deltaX * i,drawYValue[i] + mMarginTop);
}
//draw shader
mShaderPath.lineto(mMarginLeft + deltaX * (columns - 1),mRegionHeight + mMarginTop);
mShaderPath.lineto(mMarginLeft,mMarginTop + drawYValue[0]);
mShaderPath.setFillType(FillType.EVEN_ODD);
canvas.drawPath(mShaderPath,mShaderPaint);
//draw line
canvas.drawPath(mLinePath,mPaint);
//draw orange circle
mPaint.setstrokeWidth(RateChartConst.sCircleWidth);
canvas.drawCircle(mMarginLeft + deltaX * (columns - 1),drawYValue[columns - 1] + mMarginTop,RateChartConst.sCircleOuterRadius,mPaint);
//draw inner circle.
mPaint.setColor(mContext.getResources().getColor(android.R.color.white));
mPaint.setStyle(Style.FILL);
canvas.drawCircle(mMarginLeft + deltaX * (columns - 1),RateChartConst.sCircleInnerRadius,mPaint);
//draw black pop window.
float mLatestX = mMarginLeft + deltaX * (columns - 1);
float mLatestY = mMarginTop + drawYValue[columns - 1];
showPopText(canvas,mDecimalFormat.format(manager.getYValues()[manager.getYValues().length - 1]),mLatestX,mLatestY);
}
项目:QuizUpWinner
文件:Chart.java
private void ˊ(ナ paramナ,Canvas paramCanvas,Paint paramPaint,int paramInt)
{
int i = -1 + this.ͺ;
float f1 = this.ˊ / 160.0F;
float f2 = this.ˈ.getResources().getDimension(2131558465);
Path localPath = new Path();
localPath.setFillType(Path.FillType.EVEN_ODD);
localPath.moveto(this.ˏ,i);
paramPaint.setPathEffect(null);
paramPaint.setColor(paramInt);
paramPaint.setStyle(Paint.Style.FILL_AND_stroke);
paramPaint.setstrokeWidth((int)(3.0F * Resources.getSystem().getdisplayMetrics().density));
Paint localPaint = new Paint(1);
localPaint.setPathEffect(new CornerPathEffect(4.0F));
localPaint.setColor(paramInt);
localPaint.setstrokeWidth((int)(3.0F * Resources.getSystem().getdisplayMetrics().density));
localPaint.setStyle(Paint.Style.stroke);
for (int j = 0; j < this.ʿ.length; j++)
{
int k = j;
if (paramナ.ˊ[k] == -1.0F)
{
float f6;
float f7;
if (j > 0)
{
f6 = this.ʿ[(j - 1)];
float f8 = this.ͺ;
int n = j - 1;
f7 = f8 - f1 * paramナ.ˊ[n];
}
else
{
f6 = 0.0F;
f7 = this.ͺ;
}
paramCanvas.drawCircle(f6 - 2.5F,f7,paramPaint);
break;
}
float f3 = this.ʿ[j];
float f4 = this.ͺ;
int m = j;
float f5 = f4 - f1 * paramナ.ˊ[m];
if (f5 == this.ͺ)
{
localPath.moveto(f3,i);
}
else
{
if (j == -1 + this.ʿ.length)
paramCanvas.drawCircle(f3,f5,paramPaint);
localPath.lineto(f3,f5);
}
}
paramCanvas.drawPath(localPath,localPaint);
}
项目:sauvignon
文件:SvgRenderer.java
private static void renderpolygon(SVGpolygon e,Canvas canvas)
{
Paint fill = e.getStyle().getFill();
if (fill != null)
{
fill.setStyle(Style.FILL);
}
Paint stroke = e.getStyle().getstroke();
if (stroke != null)
{
stroke.setStyle(Style.stroke);
stroke.setstrokeWidth(e.getStyle().getstrokeWidth());
}
FillType ft = null;
switch (e.getFillRule())
{
case EVENODD:
{
ft = FillType.EVEN_ODD;
break;
}
case NONZERO:
{
ft = FillType.WINDING;
break;
}
default:
{
break;
}
}
// Animation : fill
if (e.getAnimationColor() != null && e.getAnimationColor().getType() == EColorOperatorType.FILL)
{
fill = e.getAnimationColor().getResultingPaint();
fill.setStyle(Style.FILL);
}
// Animation : stroke
if (e.getAnimationColor() != null && e.getAnimationColor().getType() == EColorOperatorType.stroke)
{
stroke = e.getAnimationColor().getResultingPaint();
stroke.setstrokeWidth(e.getStyle().getstrokeWidth());
stroke.setStyle(Style.FILL);
}
// Animation : transformation
Matrix ctmElement = e.getElementMatrix();
Matrix ctmScale = e.getScaleMatrix();
e = e.applyCTM(ctmScale.multiply(ctmElement));
List<Vector2> points = e.getPoints();
Path path = new Path();
path.moveto(points.get(0).getX(),points.get(0).getY());
for (Vector2 point : points)
{
path.lineto(point.getX(),point.getY());
}
path.close();
path.setFillType(ft);
if (fill != null)
canvas.drawPath(path,fill);
if (stroke != null)
canvas.drawPath(path,stroke);
}
项目:PullToRefresh-Dropper
文件:Droplet.java
/**
* @Overrided method that handles the core portion,<br>
* @warning Dont change the implementation
* This method get called when ever a invalidate is invoked
*/
@Override
protected void onDraw(Canvas canvas) {
// Gets the whole available width to work on
width = canvas.getWidth();
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.reload);
// Create a mutable bitmap to work on. @warning dont load large images
Bitmap mutableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888,true);
// Set the radius based on image width
RADIUS = bitmap.getWidth() / 2;
calculatePoints();
// release unused bitmap memory
bitmap.recycle();
Path _path = new Path();
if(distance < REFRESH_POSITION && distance >= 0)
{
// Rough Y point which bend to pass through
BEND_POINT_Y = distance/2;
// Rough X point which bend to pass through
BEND_POINT_X = distance/5;
_path.moveto(top_X1,CENTER_POINT_Y);
_path.quadTo(top_X1 + BEND_POINT_X,CENTER_POINT_Y + BEND_POINT_Y,bottom_X1,CENTER_POINT_Y + distance);
/* Calculate the radius of the bottom arc */
int bottomradius = (bottom_X2 - bottom_X1)/2;
_path.quadTo(bottom_X1 + bottomradius,CENTER_POINT_Y + distance + bottomradius,bottom_X2,CENTER_POINT_Y + distance);
_path.quadTo(top_X2 - BEND_POINT_X,top_X2,CENTER_POINT_Y );
_path.lineto(top_X1,CENTER_POINT_Y);
_path.setFillType(FillType.WINDING);
}
_path.close();
// Draw on canvas
canvas.drawPath(_path,paint);
canvas.drawBitmap(mutableBitmap,(width/2) - RADIUS,CENTER_POINT_Y - RADIUS,paint);
refreshList();
mutableBitmap.recycle();
}
@Override
protected void onDraw(Canvas canvas) {
// Todo Auto-generated method stub
super.onDraw(canvas);
float mx = this.getWidth()/2;
float my = this.getHeight()/2;
float r = getBaseRadius();
int d = 0;
float veLocity = (value - valueOld1);
for (d = depth; d > 0; d--) {
Paint p = new Paint(knobColour);
int colour = p.getColor();
int green = (colour & 0x0000FF00) >> 8;
green += d * 10;
colour = (colour & 0xFFFF00FF) | ((green << 8) & 0x0000FF00);
p.setColor(colour);
float R = r*d;
float Rsub = r*d-r;
if (d == 1) {
Rsub = (float) (r*(d-0.75));
}
canvas.drawCircle(0,my,R,p);
Path arc = null;
float radVeLocity = (float) (Math.abs(veLocity) * Math.pow(power,d));
radVeLocity = radVeLocity/16;
radVeLocity = Math.min(10f/360f*2f*(float)Math.PI,radVeLocity);
radVeLocity = Math.max(1.0f/Rsub,radVeLocity); // minimum size
radVeLocity = radVeLocity/2;
float alpha = (float) ((0.7f/Rsub / radVeLocity));
alpha = Math.min(1.0f,alpha);
if (arcs) {
arc = new Path();
float lx1 = (float) ((R-10)*Math.cos(-radVeLocity));
float ly1 = (float) ((R-10)*Math.sin(-radVeLocity));
float lxSub1 = (float) ((Rsub+10)*Math.cos(-radVeLocity));
float lySub1 = (float) ((Rsub+10)*Math.sin(-radVeLocity));
float lx2 = (float) ((R-10)*Math.cos(radVeLocity));
float ly2 = (float) ((R-10)*Math.sin(radVeLocity));
float lxSub2 = (float) ((Rsub+10)*Math.cos(radVeLocity));
float lySub2 = (float) ((Rsub+10)*Math.sin(radVeLocity));
arc.moveto(lxSub1,lySub1);
arc.lineto(lx1,ly1);
arc.lineto(lx2,ly2);
arc.lineto(lxSub2,lySub2);
arc.close();
arc.setFillType(FillType.EVEN_ODD);
}
canvas.save();
canvas.rotate(value * 360.0f * ((float) Math.pow(power,d)) / 2 / (float) Math.PI,my);
Paint marksC = new Paint(marksColour);
marksC.setAlpha((int)(alpha * 255));
for (float a = 0; a < 359.8; a += 10f) {
canvas.save();
canvas.rotate(a,my);
canvas.translate(0,my);
if (arcs) {
canvas.drawPath(arc,marksC);
}
else {
canvas.drawLine(Rsub,marksC);
}
canvas.restore();
}
canvas.restore();
}
canvas.drawText("Value :" + value,this.getHeight(),textColour);
if (value != valueOld1) {
valueOld1 = value;
this.invalidate();
}
}
项目:dev
文件:TouchSink.java
@Override
public void draw(Canvas canvas) {
if (!isInitialized) {
calculateRegions();
connected = getResources().getDrawable(A.drawable.remote_control_connected);
disconnected = getResources().getDrawable(A.drawable.remote_control_disconnected);
isInitialized = true;
}
int width = this.getWidth();
int height = this.getHeight();
Paint paint = new Paint();
paint.setColor(Color.LTGRAY);
paint.setStyle(Style.stroke);
if (isScrollPadActive()) {
int sbLeft = width - (xScrollBar * 2 / 3);
int sbRight = width - (xScrollBar / 3);
Path path = new Path();
path.setFillType(FillType.EVEN_ODD);
path.moveto((sbLeft + sbRight) / 2,scrollPad.top);
path.lineto(sbLeft,scrollPad.top + yBorder / 2);
path.lineto(sbRight,scrollPad.top + yBorder / 2);
path.lineto((sbLeft + sbRight) / 2,scrollPad.top);
path.close();
canvas.drawPath(path,paint);
path = new Path();
path.setFillType(FillType.EVEN_ODD);
path.moveto((sbLeft + sbRight) / 2,scrollPad.bottom);
path.lineto(sbLeft,scrollPad.bottom - yBorder / 2);
path.lineto(sbRight,scrollPad.bottom - yBorder / 2);
path.lineto((sbLeft + sbRight) / 2,scrollPad.bottom);
path.close();
canvas.drawPath(path,paint);
for (int i = (2 * yBorder); i < height - (2 * yBorder); i += yScrollBarItem) {
canvas.drawRect(
new Rect(sbLeft,i,sbRight,Math.min((i + (yScrollBarItem / 2)),(height - (2 * yScrollBarItem)))),paint);
}
}
if (isButtonsActive()) {
canvas.drawRoundRect(leftButton,5,paint);
canvas.drawRoundRect(rightButton,paint);
}
if (isTouchPadActive()) {
canvas.drawLines(new float[] { touchPad.left,touchPad.top + yBorder,touchPad.left,touchPad.bottom - yBorder,touchPad.right,touchPad.left + xBorder,touchPad.top,touchPad.right - xBorder,touchPad.bottom,touchPad.bottom },paint);
}
if (isPointerStickActive()) {
canvas.drawoval(pointerStick,paint);
canvas.drawoval(pointerStickCenter,paint);
}
Drawable image = ((client != null) && client.isConnected()) ? connected : disconnected;
if (image instanceof BitmapDrawable) {
Bitmap bitmap = ((BitmapDrawable) image).getBitmap();
Matrix matrix = new Matrix();
matrix.setScale(0.5F,0.5F);
canvas.drawBitmap(bitmap,matrix,new Paint());
}
invalidate();
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。