gt:         float dateCircleWidth = res.getTinyBackground().getWidth();
context: /*
   * Copyright (C) 2015-2016 longri.de
   *
   * Licensed under the : GNU General Public License (GPL);
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.gnu.org/licenses/gpl.html
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package de.longri.watchface;
  
  import android.content.Context;
  import android.content.res.Resources;
  import android.graphics.*;
  import android.graphics.drawable.BitmapDrawable;
  import android.graphics.drawable.Drawable;
  import de.longri.watchface.loging.Log;
  import de.longri.watchface.loging.LogType;
  import de.longri.weather.Info;
  
  import java.text.SimpleDateFormat;
  import java.util.Date;
  import java.util.Locale;
  
  /**
   * Created by Longri on 17.11.15.
   */
  public class TinyWeatherDrawable extends TinyDrawable {
  
      protected final Matrix WEATHER_ICON_MATRIX = new Matrix();
  
      private static final String WEATHER_NA = "w25";
      private static final String WEATHER_00 = "w00";
      private static final String WEATHER_WEATHER_1_2_12_40 = "w01";
      private static final String WEATHER_05 = "w05";
      private static final String WEATHER_06 = "w06";
      private static final String WEATHER_07 = "w07";
      private static final String WEATHER_08_10 = "w08";
      private static final String WEATHER_09_11 = "w09";
      private static final String WEATHER_16 = "w16";
      private static final String WEATHER_19_22 = "w22";
      private static final String WEATHER_20 = "w20";
      private static final String WEATHER_26 = "w26";
      private static final String WEATHER_27 = "w27";
      private static final String WEATHER_28 = "w28";
      private static final String WEATHER_29 = "w29";
      private static final String WEATHER_30 = "w30";
      private static final String WEATHER_31 = "w31";
      private static final String WEATHER_32 = "w32";
      private static final String WEATHER_33 = "w33";
      private static final String WEATHER_34 = "w34";
      private static final String WEATHER_36 = "w36";
      private static final String WEATHER_37 = "w37";
      private static final String WEATHER_39 = "w39";
      private static final String WEATHER_41 = "w41";
      private static final String WEATHER_42 = "w42";
      private static final String WEATHER_43 = "w43";
      private static final String WEATHER_45 = "w45";
      private static final String WEATHER_46 = "w46";
      private static final String WEATHER_47 = "w47";
      private final Paint mTxtPaint;
      private final Paint mDatePaint;
  
      private Info mWeatherInfo;
      private Info mWeatherForecast1;
      private Info mWeatherForecast2;
      private Bitmap mWeatherIconBitmap[] = new Bitmap[3];
      private String mLastWeatherIconName[] = new String[]{"", "", ""};
      private int mLastWeatherIconId[] = new int[]{-1, -1, -1};
      private String mDegrease;
  
      public TinyWeatherDrawable(Context context) {
          super(context);
  
          float scale = Theme.scaleFactor;
  
          mTxtPaint = new Paint();
          mTxtPaint.setColor(Color.WHITE);
          mTxtPaint.setTextSize(30 * scale);
          mTxtPaint.setAntiAlias(true);
          mDatePaint = new Paint();
          mDatePaint.setColor(Color.WHITE);
          mDatePaint.setTextSize(21 * scale);
          mDatePaint.setAntiAlias(true);
  
          WEATHER_ICON_MATRIX.setScale(0.5f * scale, 0.5f * scale);
          WEATHER_ICON_MATRIX.postTranslate(20 * scale, 5 * scale);
      }
  
      Bitmap bufferBitmap;
  
      public boolean mustRedraw() {
          if (bufferBitmap == null || mWeatherIconBitmap[0] == null) return true;
          return super.mustRedraw();
      }
  
      @Override
      public boolean hasFullDraw() {
          return true;
      }
  
      @Override
      public boolean draw(Canvas canvas, Matrix matrix) {
  
          boolean fromBuffer = true;
  
          if (this.mustRedraw() || bufferBitmap == null) {
  
              //create BufferBitmap?
              if (bufferBitmap == null) {
                  bufferBitmap = Bitmap.createBitmap(
                          RES.getTinyBackground().getWidth(), RES.getTinyBackground().getHeight(),
                          Bitmap.Config.ARGB_8888);
              }
  
              Canvas bufferCanvas = new Canvas(bufferBitmap);
              boolean error = mWeatherInfo == null;
  
              if (error) mDegrease = "--";
              else
                  mDegrease = mWeatherInfo.getTemp();
  
  
              drawTinyBackground(bufferCanvas, EMPTY_MATRIX);
  
              if (!error) {
                  try {
                      setWeatherIcon(0, mWeatherInfo.getActualIconID());
                  } catch (Exception e) {
                      e.printStackTrace();
                      mWeatherIconBitmap[0] = null;
                      mDegrease = "E " + Integer.toString(mWeatherInfo.getActualIconID());
                  }
              }
              if (mWeatherIconBitmap[0] != null) {
                  bufferCanvas.drawBitmap(mWeatherIconBitmap[0], WEATHER_ICON_MATRIX, RES.mAntiAliasPaint);
              } else {
                  if (Log.isLoggable(LogType.WEATHER)) {
                      Log.d(Consts.TAG_WEAR, "Weather icon are null, ID=" + Integer.toString(mWeatherInfo != null ? mWeatherInfo.getActualIconID() : -1));
                  }
              }
  
              float dateCircleWidth = res.getTinyBackground().getWidth();
              float PositionDegrese = dateCircleWidth / 2 - mTxtPaint.measureText(mDegrease) / 2;
              bufferCanvas.drawText(mDegrease, PositionDegrese, 90 * Theme.scaleFactor, mTxtPaint);
  
              fromBuffer = false;
          }
  
  
          canvas.drawBitmap(bufferBitmap, matrix, RES.mAntiAliasPaint_noGreyScale);
          return fromBuffer;
      }
  
      @Override
      public boolean drawFull(Canvas canvas, Matrix matrix) {
  
          float scale = Theme.scaleFactor;
  
          if (nowMatrix == null) {
              nowMatrix = new Matrix();
              nowMatrix.setTranslate(20 * scale, 80 * scale);
  
  
              forecast1Matrix = new Matrix();
              forecast1Matrix.setTranslate(230 * scale, 70 * scale);
              forecast1Matrix.postScale(0.7f, 0.7f);
  
  
              forecast2Matrix = new Matrix();
              forecast2Matrix.setTranslate(230 * scale, 240 * scale);
              forecast2Matrix.postScale(0.7f, 0.7f);
          }
  
          if (mWeatherInfo != null) {
              setWeatherIcon(0, mWeatherInfo.getActualIconID());
              drawWeather(0, canvas, mWeatherInfo, nowMatrix, false);
          }
  
          if (mWeatherForecast1 != null) {
              setWeatherIcon(1, mWeatherForecast1.getActualIconID());
              drawWeather(1, canvas, mWeatherForecast1, forecast1Matrix, true);
          }
  
          if (mWeatherForecast2 != null) {
              setWeatherIcon(2, mWeatherForecast2.getActualIconID());
              drawWeather(2, canvas, mWeatherForecast2, forecast2Matrix, true);
          }
          return false; //TODO draw into Buffer
      }
  
      @Override
      public void onTapCommand(int tapType, int x, int y, long eventTime) {
          if (tapType != 2L) return;
          if (listener != null) {
              listener.resetFullDraw();
              listener.setAmbientMode(true);
          }
  
      }
  
      Matrix nowMatrix;
      Matrix forecast1Matrix;
      Matrix forecast2Matrix;
  
  
      private void drawWeather(int index, Canvas canvas, Info info, Matrix matrix, boolean withDate) {
  
          if (mWeatherIconBitmap[index] != null)
              canvas.drawBitmap(mWeatherIconBitmap[index], matrix, RES.mAntiAliasPaint);
  
          canvas.setMatrix(matrix);
  
  
          float scale = Theme.scaleFactor;
  
          if (withDate) {
              SimpleDateFormat dateFormatter = new SimpleDateFormat("HH:mm", Locale.ENGLISH);
              Date date = info.getDate();
              String dateString = dateFormatter.format(date);
              canvas.drawText(dateString, 130 * scale, 60 * scale, mDatePaint);
          }
  
          String degreeString = info.getTemp();
  