示例#1
0
 private void seleccion() {
   if (opciones[menu.getSelectedIndex()].equals(MetodosGlobales.opciones[1])) { // Atracciones
     Estilos.pushScreen(new Atracciones());
   } else if (opciones[menu.getSelectedIndex()].equals(MetodosGlobales.opciones[2])) { // Nuevas
     Estilos.pushScreen(new MenuContactos());
   } else if (opciones[menu.getSelectedIndex()].equals(MetodosGlobales.opciones[3])) { // Buscar
     Estilos.pushScreen(new Establecidas(MetodosGlobales.establecidasTitulo()));
   } else if (opciones[menu.getSelectedIndex()].equals(
       MetodosGlobales.opciones[5])) { // Facturacion
     Estilos.pushScreen(new FacturaResumen());
   } else if (opciones[menu.getSelectedIndex()].equals(
       MetodosGlobales.opciones[6])) { // Indicadores
     Estilos.pushScreen(new IndicadorDetalle());
   }
 }
示例#2
0
 public void drawListRow(ListField listField, Graphics g, int index, int y, int w) {
   String sColapsado = "";
   Item item = (Item) get(listField, index);
   if (listField.getSelectedIndex() == index) {
     g.setColor(Color.WHITE);
     g.setBackgroundColor(Estilos.getBGSelected());
   } else {
     if (item.isCabecera()) {
       g.setColor(Estilos.getColorInterlinea(0));
       g.setBackgroundColor(Estilos.getBGInterlinea(0));
     } else {
       g.setColor(Estilos.getColorInterlinea(1));
       g.setBackgroundColor(Estilos.getBGInterlinea(1));
     }
     g.clear();
   }
   if (item.isCabecera()) {
     if (item.isColapsado()) {
       sColapsado = Characters.BLACK_RIGHT_POINTING_TRIANGLE + " ";
     } else {
       sColapsado = Characters.BLACK_DOWN_POINTING_TRIANGLE + " ";
     }
   } else {
     sColapsado = Characters.SPACE + "";
   }
   g.drawText(sColapsado + item.getDescripcion(), 0, y, DrawStyle.LEFT, w);
   g.drawText(item.getValor(), 0, y, DrawStyle.RIGHT, w);
 }
示例#3
0
  protected boolean navigationClick(int status, int time) {
    Field field = this.getFieldWithFocus();
    if (field == _listaConsulResumen) {
      int index = _listaConsulResumen.getSelectedIndex();
      Item item = (Item) get(_listaConsulResumen, index);
      if (item.isCabecera()) {
        item.setColapsado(!item.isColapsado());
        llenaLista();
        _listaConsulResumen.setSelectedIndex(index);
        return true;
      } else {
        item = (Item) jerarquia.elementAt(item.getIndexPadre());
        int op = getCategoria(index);
        if (op >= 0) {
          int cant = Integer.parseInt(((Item) get(_listaConsulResumen, index)).getValor());
          if (cant > 0) {
            String campana =
                item.getDescripcion().substring(4) + item.getDescripcion().substring(1, 3);
            progress.setTitle("Buscando... ");
            progress.open();
            progress.close();
            try {
              Estilos.pushScreen(new ConsultaSeccion(campana, "", "", "", "", "" + op));
            } catch (Exception e) {

            }
          }
        }
        return true;
      }
    }
    return super.navigationClick(status, time);
  }
示例#4
0
 protected boolean navigationMovement(int dx, int dy, int status, int time) {
   Field field = this.getFieldWithFocus();
   if (field == menu) {
     menu.invalidate(menu.getSelectedIndex() + dy);
     menu.invalidate(menu.getSelectedIndex());
   }
   return super.navigationMovement(dx, dy, status, time);
 }
示例#5
0
 protected boolean navigationMovement(int dx, int dy, int status, int time) {
   Field field = this.getFieldWithFocus();
   if (field == _listaConsulResumen) {
     _listaConsulResumen.invalidate(_listaConsulResumen.getSelectedIndex() + dy);
     _listaConsulResumen.invalidate(_listaConsulResumen.getSelectedIndex());
   }
   return super.navigationMovement(dx, dy, status, time);
 }
示例#6
0
 public void run() {
   int index = _listaConsulResumen.getSelectedIndex();
   Item item = (Item) get(_listaConsulResumen, index);
   if (!item.isCabecera()) {
     item = (Item) jerarquia.elementAt(item.getIndexPadre());
   }
   UiApplication.getUiApplication()
       .pushScreen(new FacturacionDetalle(item.getDescripcion()));
 }
示例#7
0
 public void drawListRow(ListField list, Graphics g, int index, int y, int w) {
   if (list.getSelectedIndex() == index) {
   } else {
     g.setColor(Color.WHITE);
     if (get(index).equals("Consultoras") || get(index).equals("Pedidos")) {
       g.setBackgroundColor(Estilos.getBGModulo());
     } else {
       g.setBackgroundColor(Estilos.getBGSubModulo());
     }
     g.clear();
   }
   g.drawText(get(index), 0, y, 0, w);
 }
示例#8
0
  public void drawListRow(ListField listField, Graphics g, int index, int y, int width) {
    if (isMoreButton(index)) {
      Font bold = Font.getDefault().derive(Font.BOLD);
      g.setFont(bold);
      String strMore = "More";
      int xx = (width - bold.getAdvance(strMore)) / 2;
      int yy = y + (ScheduleScreen.LIST_HEIGHT - bold.getHeight()) / 2;
      if (listField.getSelectedIndex() == index) {
        g.setColor(0);
        g.drawText(strMore, xx + 1, yy + 1);
        g.setColor(0xffffff);
        g.drawText(strMore, xx, yy);
      } else {
        g.setColor(0);
        g.drawText(strMore, xx, yy);
      }
      return;
    }
    ProgramData data = (ProgramData) listData.elementAt(index);
    //		if(!listField.isFocus() || index!=listField.getSelectedIndex()){
    //			for(int x=0; x<Display.getWidth(); x+= ScheduleScreen.LIST_BACKGROUND.getWidth())
    //				g.drawBitmap(x, y, ScheduleScreen.LIST_BACKGROUND.getWidth(),
    // ScheduleScreen.LIST_BACKGROUND.getHeight(), ScheduleScreen.LIST_BACKGROUND, 0, 0);
    //		}
    if (!listField.isFocus() || index != listField.getSelectedIndex()) {
      for (int x = 0; x < Display.getWidth(); x += ScheduleScreen.LIST_BACKGROUND.getWidth())
        g.drawBitmap(
            x,
            y,
            ScheduleScreen.LIST_BACKGROUND.getWidth(),
            ScheduleScreen.LIST_BACKGROUND.getHeight(),
            ScheduleScreen.LIST_BACKGROUND,
            0,
            0);
    }
    Bitmap thumb = TVApi.getChannelThumbnail(data.channelId);
    if (thumb != null) {
      int padding = (ScheduleScreen.LIST_HEIGHT - thumb.getHeight()) / 2;
      int ty = y + padding;
      int tx = padding;
      g.drawBitmap(tx, ty, thumb.getWidth(), thumb.getHeight(), thumb, 0, 0);
      g.setColor(0);
      g.drawText(data.beginTime + " - " + data.endTime, tx + thumb.getWidth() + tx, ty);
      Bitmap favorite =
          data.isFavorite ? ScheduleScreen.LIST_FAVORITE_ON : ScheduleScreen.LIST_FAVORITE_OFF;
      int titleMaxWidth = width - thumb.getWidth() - favorite.getWidth() - (padding * 4);
      g.drawText(
          data.title,
          tx + thumb.getWidth() + tx,
          ty + thumb.getHeight(),
          DrawStyle.BASELINE | DrawStyle.ELLIPSIS,
          titleMaxWidth);

      g.drawBitmap(
          width - padding - favorite.getWidth(),
          y + (ScheduleScreen.LIST_HEIGHT - favorite.getHeight()) / 2,
          favorite.getWidth(),
          favorite.getHeight(),
          favorite,
          0,
          0);
    }
  }