Beispiel #1
0
  private void postToFacebook(String comment) {

    Bundle extras = new Bundle();

    extras.putString("link", currentEvent.getUri());
    extras.putString("name", currentEvent.getName());
    facebook.dialog(
        this,
        "feed",
        extras,
        new Facebook.DialogListener() {

          public void onFacebookError(FacebookError e) {
            // TODO Auto-generated method stub

          }

          public void onError(DialogError e) {
            // TODO Auto-generated method stub

          }

          public void onComplete(Bundle values) {
            // TODO Auto-generated method stub

          }

          public void onCancel() {
            // TODO Auto-generated method stub

          }
        });
  }
Beispiel #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(
        savedInstanceState,
        R.layout.eventdetails,
        getResources().getString(R.string.eventsDetailsTitle));

    if ((currentEvent = (Event) this.getIntent().getSerializableExtra("event")) != null) {

      gigPrefs = getPreferences(MODE_PRIVATE);

      mapObjects();
      fillData(currentEvent);

      eventsPersist = new EventDataSource(this);

      getRightButton().setText("+");

      eventsPersist.open();
      if (eventsPersist.getEventByID(currentEvent.getEventID()) != null) {
        this.scheduled = true;
        getRightButton().setText("-");
      }
      eventsPersist.close();

      getRightButton().setVisibility(Button.VISIBLE);
      getRightButton().setEnabled(true);

      getRightButton()
          .setOnClickListener(
              new View.OnClickListener() {

                public void onClick(View v) {
                  swapFollow();
                }
              });

      getLeftButton().setVisibility(TextView.VISIBLE);
      getLeftButton().setText(this.getIntent().getStringExtra("backActiv"));
      getLeftButton()
          .setOnClickListener(
              new View.OnClickListener() {
                public void onClick(View v) {
                  onBackPressed();
                }
              });
      getLeftButton().setEnabled(true);
    } else this.finish();
  }
Beispiel #3
0
  private void fillData(Event e) {

    title.setText(e.getName());
    link.setText(
        Html.fromHtml(
            "<a href=\"" + link + "\">" + getResources().getString(R.string.hiperLink) + "</a>"));
    link.setMovementMethod(LinkMovementMethod.getInstance());

    if (!((e.getStartDate() == null)
        || e.getStartDate().equalsIgnoreCase("null")
        || e.getStartDate().equalsIgnoreCase(""))) start.setText(e.getStartDate());
    if (((e.getStartTime() == null)
        || e.getStartTime().equalsIgnoreCase("null")
        || e.getStartTime().equalsIgnoreCase("")))
      start.setText(start.getText() + " " + e.getStartTime());

    if (((e.getEndDate() == null)
            || e.getEndDate().equalsIgnoreCase("null")
            || e.getEndDate().equalsIgnoreCase(""))
        && ((e.getEndTime() == null)
            || e.getEndTime().equalsIgnoreCase("null")
            || e.getEndTime().equalsIgnoreCase(""))) {
      endLabel.setVisibility(TextView.GONE);
      end.setVisibility(TextView.GONE);
    } else {
      if (!((e.getEndDate() == null)
          || e.getEndDate().equalsIgnoreCase("null")
          || e.getEndDate().equalsIgnoreCase(""))) {
        end.setText(e.getEndDate());
      }
      if (((e.getEndTime() == null)
          || e.getEndTime().equalsIgnoreCase("null")
          || e.getEndTime().equalsIgnoreCase(""))) {
        end.setText(end.getText() + " " + e.getEndTime());
      }
    }

    location.setText(e.getLocationName());

    listOfArtists = e.getPerformers();

    if (listOfArtists != null) {

      Log.i("Gigstar", "Number of performers: " + listOfArtists.size());

      artistList.setAdapter(new iOSAdapter(this, R.layout.ios_list, listOfArtists));
      artistList.setOnItemClickListener(
          new OnItemClickListener() {
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
              if (listOfArtists.get(arg2).getMbid() != null) {
                Intent tmp = new Intent(GigEventDetails.this, GigArtistDetails.class);
                tmp.putExtra("backActiv", getResources().getString(R.string.eventLabel));
                tmp.putExtra("artist", listOfArtists.get(arg2));
                startActivity(tmp);
              } else {
                Toast.makeText(
                        GigEventDetails.this, getResources().getString(R.string.noMBIDError), 200)
                    .show();
              }
            }
          });
    }
  }