コード例 #1
0
  private void drawThermoMeter() {
    if (Settings.isShowThermometer()) {
      // SkalaBackground
      new ArchPart(
              center,
              maxRadius * 1.2f,
              maxRadius * 0.95f,
              -90,
              55,
              PaintProvider.getBackgroundPaint()) //
          .setOutline(outline) //
          .draw(bitmapCanvas);
      new ArchPart(
              center,
              maxRadius * 1.35f,
              maxRadius * 1.2f,
              -90,
              +55 / 2f,
              PaintProvider.getBackgroundPaint()) //
          .setOutline(outline) //
          .draw(bitmapCanvas);

      final SkalaPart s =
          Skala.getDefaultThermometerPart(
                  center,
                  maxRadius * 1.07f,
                  maxRadius * 1.10f,
                  -87,
                  49,
                  LevelLinesStyle.ZehnerFuenfer) //
              .setFontAttributesEbene1(
                  new FontAttributes(Align.CENTER, Typeface.DEFAULT, fontSizeScala * 0.85f)) //
              .setupDefaultBaseLineRadius() //
              .setDicke(strokeWidth * 0.5f) //
              .draw(bitmapCanvas);

      Skala.getZeigerPart(
              center,
              Settings.getBattTemperature(),
              maxRadius * 1.11f,
              maxRadius * 0.96f,
              s.getScala()) //
          .setDicke(strokeWidth) //
          .overrideColor(ColorHelper.changeBrightness(Settings.getZeigerColor(), -32)) //
          .setDropShadow(new DropShadow(strokeWidth * 3, Color.BLACK)) //
          .draw(bitmapCanvas);

      // Innen Fläche
      new TextOnCirclePart(center, maxRadius * 1.25f, -86, fontSizeArc * 1.2f, new Paint()) //
          .setColor(Settings.getBattStatusColor()) //
          .setAlign(Align.LEFT) //
          .draw(bitmapCanvas, Settings.getBattTemperature() + " °C");
    }
  }
コード例 #2
0
  private void drawVoltMeter() {
    if (Settings.isShowVoltmeter()) {
      // SkalaBackground
      new ArchPart(
              center,
              maxRadius * 1.2f,
              maxRadius * 0.95f,
              -90,
              -55,
              PaintProvider.getBackgroundPaint()) //
          .setOutline(outline) //
          .draw(bitmapCanvas);
      new ArchPart(
              center,
              maxRadius * 1.35f,
              maxRadius * 1.2f,
              -90,
              -55 / 2f,
              PaintProvider.getBackgroundPaint()) //
          .setOutline(outline) //
          .draw(bitmapCanvas);

      final SkalaPart s =
          Skala.getDefaultVoltmeterPart(
                  center,
                  maxRadius * 1.07f,
                  maxRadius * 1.10f,
                  -142,
                  49,
                  VoltLinesStyle.style_500_100_50) //
              .setFontAttributesEbene1(
                  new FontAttributes(Align.CENTER, Typeface.DEFAULT, fontSizeScala * 0.85f)) //
              .setupDefaultBaseLineRadius() //
              .setDicke(strokeWidth * 0.5f) //
              .draw(bitmapCanvas);
      Skala.getZeigerPart(
              center,
              Settings.getBattVoltage(),
              maxRadius * 1.11f,
              maxRadius * 0.96f,
              s.getScala()) //
          .setDicke(strokeWidth) //
          .overrideColor(ColorHelper.changeBrightness(Settings.getZeigerColor(), -32)) //
          .setDropShadow(new DropShadow(strokeWidth * 3, Color.BLACK)) //
          .draw(bitmapCanvas);

      // Innen Fläche
      new TextOnCirclePart(center, maxRadius * 1.25f, -94, fontSizeArc * 1.2f, new Paint()) //
          .setColor(Settings.getBattStatusColor()) //
          .setAlign(Align.RIGHT) //
          .setDropShadow(new DropShadow(strokeWidth * 2, Color.BLACK)) //
          .draw(bitmapCanvas, String.format(Locale.US, "%.2f V", Settings.getBattVoltage()));
    }
  }