Exemple #1
0
 @Override
 public void onPause() {
   super.onPause();
   try {
     this.selectedDate = view.getDisplayedDate();
   } catch (Exception e) {
     Log.i(TAG, "Catchable error in YearView", e);
   }
 }
Exemple #2
0
  @Override
  public void onResume() {
    super.onResume();
    if (view == null) {
      view = (CustomYearDrawable) this.findViewById(R.id.year_view_custom);
      if (view == null) return;
    }
    int width = getWindowManager().getDefaultDisplay().getWidth();
    int height = getWindowManager().getDefaultDisplay().getHeight();

    if (width > height) {
      // Landscape
      view.initialise(selectedDate, CustomYearDrawable.LANDSCAPE);
    } else {
      // portrait
      view.initialise(selectedDate, CustomYearDrawable.PORTRAIT);
    }

    view.setOnTouchListener(this);
  }
Exemple #3
0
 /** Handles button Clicks */
 @Override
 public void onClick(View clickedView) {
   int button = (int) ((Integer) clickedView.getTag());
   switch (button) {
     case TODAY:
       view.setSelectedDate(new AcalDateTime());
       view.invalidate();
       break;
     case ADD:
       Bundle bundle = new Bundle();
       bundle.putParcelable("DATE", this.selectedDate);
       Intent eventEditIntent = new Intent(this, EventEdit.class);
       eventEditIntent.putExtras(bundle);
       this.startActivity(eventEditIntent);
       break;
     case MONTH:
       this.finish();
       break;
     default:
       Log.w(TAG, "Unrecognised button was pushed in MonthView.");
   }
 }