private void setupView() {

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);

    mWeekView = (WeekView) findViewById(R.id.weekView);
    mWeekView.setOnEventClickListener(this);
    mWeekView.setMonthChangeListener(this);
    mWeekView.setEventLongPressListener(this);
    setupDateTimeInterpreter(false);
  }
예제 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Get a reference for the week view in the layout.
    mWeekView = (WeekView) findViewById(R.id.weekView);

    // Show a toast message about the touched event.
    mWeekView.setOnEventClickListener(this);

    // The week view has infinite scrolling horizontally. We have to provide the events of a
    // month every time the month changes on the week view.
    mWeekView.setMonthChangeListener(this);

    // Set long press listener for events.
    mWeekView.setEventLongPressListener(this);
  }