Exemple #1
0
 public void bind(EventoDto evento) {
   this.evento = evento;
   thumbnail.setImageUrl(Constants.PATH_IMAGE + evento.getImagemUrl(), imageLoader);
   nomeEvento.setText(evento.getNomeEvento());
   localEvento.setText(evento.getNomeInstituicao());
   dataEvento.setText(
       TreatDate.formatTime(TreatDate.parseDateTime(evento.getDataInicio()))
           + " - "
           + TreatDate.formatTime(TreatDate.parseDateTime(evento.getDataInicio())));
   likeView.setLikeViewStyle(LikeView.Style.BOX_COUNT);
   likeView.setObjectIdAndType(evento.getUrlFacebookEvento(), LikeView.ObjectType.DEFAULT);
 }
  @Override
  protected void afterViews() {
    txvNomeEvento.setText("Bruno e Barreto");
    txvDataEvento.setText(TreatDate.formatString("dd/MM/yyyy", new Date()));
    txvLocalEvento.setText("Santarena");

    // ImageView to display the QR code in.  This should be defined in
    // your Activity's XML layout file
    ImageView imageView = (ImageView) findViewById(R.id.img_qrcode);

    String qrData = "Data I want to encode in QR code";
    int qrCodeDimention = 500;

    QRCodeEncoder qrCodeEncoder =
        new QRCodeEncoder(
            qrData, null, Contents.Type.TEXT, BarcodeFormat.QR_CODE.toString(), qrCodeDimention);

    try {
      Bitmap bitmap = qrCodeEncoder.encodeAsBitmap();
      imageView.setImageBitmap(bitmap);
    } catch (WriterException e) {
      e.printStackTrace();
    }
  }