示例#1
0
  /** @param canvas */
  private void drawTFR(Canvas canvas) {
    mPaint.setColor(Color.RED);
    mPaint.setShadowLayer(0, 0, 0, 0);

    /*
     * Draw TFRs, weather
     */
    if (mPref.shouldTFRAndMETARShow()) {

      LinkedList<TFRShape> shapes = null;
      if (null != mService) {
        shapes = mService.getTFRShapes();
      }
      if (null != shapes) {
        mPaint.setColor(Color.RED);
        mPaint.setStrokeWidth(8);
        mPaint.setShadowLayer(0, 0, 0, 0);
        for (int shape = 0; shape < shapes.size(); shape++) {
          TFRShape cshape = shapes.get(shape);
          if (cshape.isVisible()) {
            /*
             * Find offsets of TFR then draw it
             */
            cshape.drawShape(canvas, mOrigin, mScale, mMovement, mPaint, mFace);
          }
        }
      }
    }
  }
示例#2
0
 /** @param canvas */
 private void drawMETARText(Canvas canvas) {
   /*
    * Draw TFRs, weather
    */
   if (mPref.shouldTFRAndMETARShow()) {
     /*
      * Write weather report
      * Use a static layout for showing as overlay and formatted to fit
      */
     float top = getHeight() / mTextDiv * 2 + mFontHeight;
     if (null != mWeatherLayout) {
       mPaint.setColor(mWeatherColor);
       mPaint.setShadowLayer(SHADOW, SHADOW, SHADOW, Color.BLACK);
       canvas.drawRect(SHADOW, top, getWidth() - SHADOW, mWeatherLayout.getHeight() + top, mPaint);
       canvas.save();
       canvas.translate(SHADOW + 2, top);
       mPaint.setShadowLayer(0, 0, 0, Color.BLACK);
       mWeatherLayout.draw(canvas);
       canvas.restore();
     }
   }
 }