Android Open Source - BonetCalendarView Custom Grid Calendar Activity






From Project

Back to project page BonetCalendarView.

License

The source code is released under:

Apache License

If you think the Android project BonetCalendarView listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.bonet.example.bonetcalendarviewactivity;
/* www.j  ava 2  s .  c o  m*/
import com.bonet.views.OnDateSelectedListener;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.Toast;

public class CustomGridCalendarActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    
    super.onCreate(savedInstanceState);
    
    setContentView(R.layout.empty_layout);
    
    int minDay,minMonth,minYear;
    int maxDay,maxMonth,maxYear;
    
    minDay = getIntent().getIntExtra("MIN_DAY", 1);
    minMonth = getIntent().getIntExtra("MIN_MONTH", 0);
    minYear = getIntent().getIntExtra("MIN_YEAR", 2014);
    
    maxDay = getIntent().getIntExtra("MAX_DAY", 31);
    maxMonth = getIntent().getIntExtra("MAX_MONTH", 11);
    maxYear = getIntent().getIntExtra("MAX_YEAR", 2015);
    
    CustomGridCalendar cv = new CustomGridCalendar(this);

    ((LinearLayout) findViewById(R.id.main_layout)).addView(cv);
    
    cv.setMinDate(minYear, minMonth, minDay);
    cv.setMaxDate(maxYear, maxMonth, maxDay);
    
    cv.setOnDateSelectedListener(new OnDateSelectedListener() {
      @Override
      public void onDateSelected(int year, int month, int day) {
        Toast.makeText(getApplicationContext(), year+"/"+month+"/"+day, Toast.LENGTH_LONG).show();
      }
    });
  }
}




Java Source Code List

com.bonet.example.bonetcalendarviewactivity.CustomDayGridAdapter.java
com.bonet.example.bonetcalendarviewactivity.CustomGridCalendarActivity.java
com.bonet.example.bonetcalendarviewactivity.CustomGridCalendar.java
com.bonet.example.bonetcalendarviewactivity.CustomMonthProvider.java
com.bonet.example.bonetcalendarviewactivity.CustomYearAdapter.java
com.bonet.example.bonetcalendarviewactivity.CustomYearProvider.java
com.bonet.example.bonetcalendarviewactivity.ExampleActivity.java
com.bonet.example.bonetcalendarviewactivity.GridCalendarActivity.java
com.bonet.example.bonetcalendarviewactivity.ListCalendarActivity.java
com.bonet.views.BtCalendarView.java
com.bonet.views.BtCalendar.java
com.bonet.views.BtDate.java
com.bonet.views.BtMonthViewProvider.java
com.bonet.views.BtMonth.java
com.bonet.views.BtYearViewProvider.java
com.bonet.views.DayGridAdapter.java
com.bonet.views.DayListAdapter.java
com.bonet.views.GridBtMonthViewProvider.java
com.bonet.views.ListBtMonthViewProvider.java
com.bonet.views.ListBtYearViewProvider.java
com.bonet.views.MonthListAdapter.java
com.bonet.views.OnDateSelectedListener.java
com.bonet.views.package-info.java