Example #1
0
 @Override
 public void onPause() {
   super.onPause();
   try {
     this.selectedDate = view.getDisplayedDate();
   } catch (Exception e) {
     Log.i(TAG, "Catchable error in YearView", e);
   }
 }
Example #2
0
  /**
   * Called when Activity is first created. Initialises all appropriate fields and Constructs the
   * Views for display. (non-Javadoc)
   *
   * @see android.app.Activity#onCreate(android.os.Bundle)
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.todo_list_view);

    Bundle b = this.getIntent().getExtras();
    if (b != null && b.containsKey("InvokedFromView")) invokedFromView = true;

    // make sure aCalService is running
    this.startService(new Intent(this, aCalService.class));

    // Set up buttons
    this.setupButton(R.id.todo_add_button, ADD, "+");
    this.setSelections();
  }
Example #3
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);
  }
Example #4
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    gestureDetector = new GestureDetector(this);
    Intent ourIntent = this.getIntent();
    int year = ourIntent.getIntExtra(KEY_START_YEAR, -1);
    if (year == -1) {
      long selectedMillis = ourIntent.getLongExtra(KEY_SELECTED_MILLIS, -1L);
      if (selectedMillis == -1L) selectedDate = AcalDateTime.getInstance();
      else selectedDate = AcalDateTime.getInstance().setMillis(selectedMillis);
    } else {
      this.selectedDate = new AcalDateTime(year, 1, 1, 0, 0, 0, null);
    }
    this.setContentView(R.layout.year_view);
    view = (CustomYearDrawable) this.findViewById(R.id.year_view_custom);

    // Set up buttons
    this.setupButton(R.id.year_today_button, TODAY);
    this.setupButton(R.id.year_month_button, MONTH);
    this.setupButton(R.id.year_add_button, ADD);
  }
Example #5
0
 @Override
 public void onResume() {
   super.onResume();
   updateLayout();
 }
Example #6
0
 @Override
 public void onPause() {
   super.onPause();
   rememberCurrentPosition();
   todoList = null;
 }