1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-23 00:33:09 +02:00

Merge pull request #168 from erijo/minor

Minor GUI changes
This commit is contained in:
OliE
2018-01-31 16:23:44 +01:00
committed by GitHub
3 changed files with 5 additions and 6 deletions

View File

@@ -268,7 +268,7 @@ public abstract class FloatMeasurementView extends MeasurementView {
color = "grey"; color = "grey";
} }
return String.format( return String.format(
"<font color='%s'>%s</font><font color='grey'><small>%s</small></font>", "<font color='%s'>%s</font> <font color='grey'><small>%s</small></font>",
color, symbol, formatValue(diff)); color, symbol, formatValue(diff));
} }

View File

@@ -188,13 +188,12 @@ public class LinearGaugeView extends View {
drawCenteredText(canvas, toText(maxValue), getWidth(), textY, textPaint); drawCenteredText(canvas, toText(maxValue), getWidth(), textY, textPaint);
// Indicator // Indicator
final float indicatorBottom = limitRect.bottom + 10.0f; final float indicatorBottom = limitRect.bottom + 15.0f;
Path path = new Path(); Path path = new Path();
path.setFillType(Path.FillType.EVEN_ODD); path.setFillType(Path.FillType.EVEN_ODD);
path.moveTo(valuePos, barTop); path.moveTo(valuePos, barBottom);
path.lineTo(valuePos + 10.0f, indicatorBottom); path.lineTo(valuePos + 10.0f, indicatorBottom);
path.lineTo(valuePos - 10.0f, indicatorBottom); path.lineTo(valuePos - 10.0f, indicatorBottom);
path.lineTo(valuePos, barTop);
path.close(); path.close();
canvas.drawPath(path, indicatorPaint); canvas.drawPath(path, indicatorPaint);
@@ -203,7 +202,7 @@ public class LinearGaugeView extends View {
final String valueStr = String.format(Locale.getDefault(), "%.2f", value); final String valueStr = String.format(Locale.getDefault(), "%.2f", value);
indicatorPaint.getTextBounds(valueStr, 0, valueStr.length(), bounds); indicatorPaint.getTextBounds(valueStr, 0, valueStr.length(), bounds);
drawCenteredText(canvas, valueStr, valuePos, drawCenteredText(canvas, valueStr, valuePos,
indicatorBottom + bounds.height() + textOffset, indicatorPaint); indicatorBottom + bounds.height(), indicatorPaint);
} }
@Override @Override

View File

@@ -185,7 +185,7 @@ public abstract class MeasurementView extends TableLayout {
valueView.setGravity(Gravity.RIGHT | Gravity.CENTER); valueView.setGravity(Gravity.RIGHT | Gravity.CENTER);
if (!isEditable()) { if (!isEditable()) {
editModeView.setVisibility(View.GONE); editModeView.setVisibility(View.INVISIBLE);
} }
showEvaluatorRow(false); showEvaluatorRow(false);