Skip to content
Swati Garg edited this page Jul 17, 2015 · 2 revisions

#Calendar

The Calendar module consists of :

  • Displaying Time Table (according to user's preferences)
  • Displaying Attendance with provision of adding and removing dates (missed/attended) for every subject.

###1. Fetching and Displaying Time table The user's preferences can be changed from Choose Class.The timtables are stored on google drive in this json format and the required timetable is fetching using the google drive api. The format of using this api is:

https://docs.google.com/uc?id=_file_id_&export=download

where, file_id indicates the id of the file to be fetched.

Then, the time table id displayed in a horizontal list view using Two way view. Also the list is made infinitely scrollable by adding notifydatasetchanged here :

    lvTest.setOnScrollListener(new TwoWayView.OnScrollListener() {
            @Override
            public void onScrollStateChanged(TwoWayView view, int scrollState) {
            }

            @Override
            public void onScroll(TwoWayView view, int firstVisibleItem,
                                 int visibleItemCount, int totalItemCount) {
                //what is the bottom item that is visible
                int lastInScreen = firstVisibleItem + visibleItemCount;
                //is the bottom item visible & not loading more already ? Load more !
                if ((lastInScreen == totalItemCount) && !(loadingMore)) {
                    load();
                }
                adapter2.notifyDataSetChanged();
            }
        });

###2. Displaying Attendance The dates are stored using [Android Sqlite] (http://developer.android.com/reference/android/database/sqlite/package-summary.html). The schema of database table is :

     public  abstract class TableEntry implements BaseColumns {
        public static final String TABLE_NAME = "subjects";
        public static final String COLUMN_NAME_SUBJECT = "subjectid";
        public static final String COLUMN_NAME_DATE = "date";
        public static final String COLUMN_NAME_STATUS = "status";
        public static final String COLUMN_NAME_NUMBER = "number";
    public static final String COLUMN_NAME_ATTENDANCE = "attendance";
    }

Using this database, the attendance of particular subject is calculated.

For any sort of questions/doubts you have regarding the documentation, please contact Swati Garg at swati4star@gmail.com.

Clone this wiki locally