Update tests

This commit is contained in:
2016-04-30 12:30:20 -04:00
parent d77c78249c
commit f172c69eed
19 changed files with 30 additions and 28 deletions

View File

@@ -123,7 +123,6 @@ public class CheckmarkWidgetView extends HabitWidgetView implements HabitDataVie
}
ring.setPercentage(percentage);
ring.setPrecision(0.125f);
ring.setColor(foregroundColor);
ring.setBackgroundColor(backgroundColor);
ring.setText(text);

View File

@@ -175,11 +175,14 @@ public class HabitScoreView extends ScrollableDataView implements HabitDataView
pGrid.setStrokeWidth(baseSize * 0.025f);
if(isTransparencyEnabled)
{
if (drawingCache != null) drawingCache.recycle();
drawingCache = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
cacheCanvas = new Canvas(drawingCache);
}
initCache(width, height);
}
private void initCache(int width, int height)
{
if (drawingCache != null) drawingCache.recycle();
drawingCache = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
cacheCanvas = new Canvas(drawingCache);
}
public void refreshData()
@@ -222,6 +225,8 @@ public class HabitScoreView extends ScrollableDataView implements HabitDataView
if(isTransparencyEnabled)
{
if(drawingCache == null) initCache(getWidth(), getHeight());
activeCanvas = cacheCanvas;
drawingCache.eraseColor(Color.TRANSPARENT);
}

View File

@@ -19,7 +19,6 @@
package org.isoron.uhabits.views;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@@ -41,22 +40,22 @@ public class RingView extends View
public static final PorterDuffXfermode XFERMODE_CLEAR =
new PorterDuffXfermode(PorterDuff.Mode.CLEAR);
private float precision;
private boolean enableFontAwesome;
private int color;
private float precision;
private float percentage;
private TextPaint pRing;
private RectF rect;
private int diameter;
private float textSize;
private float thickness;
private RectF rect;
private TextPaint pRing;
private Integer backgroundColor;
private Integer inactiveColor;
private float em;
private String text;
private float textSize;
private boolean enableFontAwesome;
private Bitmap drawingCache;
private Canvas cacheCanvas;
@@ -65,6 +64,14 @@ public class RingView extends View
public RingView(Context context)
{
super(context);
percentage = 0.0f;
precision = 0.01f;
color = ColorHelper.CSV_PALETTE[0];
thickness = UIHelper.dpToPixels(getContext(), 2);
text = "";
textSize = context.getResources().getDimension(R.dimen.smallTextSize);
init();
}
@@ -149,7 +156,6 @@ public class RingView extends View
}
@Override
@SuppressLint("DrawAllocation")
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{
super.onMeasure(widthMeasureSpec, heightMeasureSpec);