Example #1
0
  private void createContent(String msg) {
    float wh = UI_Size_Base.that.getButtonWidth() * 4f;

    CB_RectF posRec =
        new CB_RectF(
            (UI_Size_Base.that.getWindowWidth() / 2) - (wh / 2),
            UI_Size_Base.that.getWindowHeight() - wh - Dialog.margin,
            wh,
            wh / 2);

    this.setRec(posRec);

    this.mTextField.setHeight(this.getHalfHeight());
    this.mTextField.setWidth(this.getWidth() * 0.8f);
    this.mTextField.setX(this.getHalfWidth() - mTextField.getHalfWidth());
    this.mTextField.setY(this.getHeight() - (mTextField.getHeight() + Dialog.margin));

    this.setWrappedText(Translation.Get("ConnectionError") + Global.br + msg);

    this.mIcon = new Image(0, 0, getWidth(), getHalfHeight(), "ImageIcon", false);
    this.mIcon.setSprite(Sprites.getSprite("connection-error"), false);
    float top = 300; // TODO set on the Top of Screen
    this.setY(top - this.getHeight());
    super.addChildToOverlay(mIcon);
  }
Example #2
0
  private Sprite getIcon(MessageBoxIcon msgIcon) {
    if (msgIcon == null) return null;

    Sprite icon;

    switch (msgIcon.ordinal()) {
      case 0:
        icon = Sprites.getSprite(IconName.infoIcon.name());
        break;
      case 1:
        icon = Sprites.getSprite(IconName.closeIcon.name());
        break;
      case 2:
        icon = Sprites.getSprite(IconName.warningIcon.name());
        break;
      case 3:
        icon = Sprites.getSprite(IconName.closeIcon.name());
        break;
      case 4:
        icon = Sprites.getSprite(IconName.infoIcon.name());
        break;
      case 5:
        icon = null;
        break;
      case 6:
        icon = Sprites.getSprite(IconName.helpIcon.name());
        break;
      case 7:
        icon = Sprites.getSprite(IconName.closeIcon.name());
        break;
      case 8:
        icon = Sprites.getSprite(IconName.warningIcon.name());
        break;
      case 9:
        icon = Sprites.getSprite(IconName.dayGcLiveIcon.name());
        break;
      case 10:
        icon = Sprites.getSprite(IconName.dayGcLiveIcon.name());
        break;

      default:
        icon = null;
    }

    return icon;
  }
 @Override
 public Sprite getIcon() {
   return Sprites.getSprite(IconName.trackListIcon.name());
 }