Question

I am trying to build a custom android application for use within my company that encompasses multiple aspects of the android calendar. One such aspect is the agenda view shown here and here.

My application basically needs to replicate this agenda view/list view to show a customized set of events returned from an API. So far, I have got the data and am saving it into a local database to be displayed in a list view/agenda view.

I can create a list of these custom events just fine, but it is a simple listview, using a simplelistadapter with no headers to separate the dates. Trying to separate or group the items by date is proving rather troublesome. I have created a custom list adapter but examples I have seen only use pre defined group headings and minimal child information in each parent group.

@Override
public View getGroupView(int groupPosition, boolean IsExpanded, View convertView, ViewGroup parent) {
    String headerTitle = (String) getGroup(groupPosition);
    if (convertView == null) {
        LayoutInflater infalInflater = (LayoutInflater) this._context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = infalInflater.inflate(R.layout.event_header_listview, null);
    }

    TextView lblListHeader = (TextView) convertView
            .findViewById(R.id.eventListHeader);
    lblListHeader.setTypeface(null, Typeface.BOLD);
    lblListHeader.setText(headerTitle);
    //group by date? Set dynamic date based on today and going out one day at a time?

    return convertView;
}

Is there a way to create groups of list items, based on date, throw that date header on a header item (each one being an expandable listview), and create a list of these group headers identical to the default calendar listview/agenda view pictures I posted above?

While this seems like a lot of work to reproduce something that has already been created, are there preexisting list view controls I can use? I have also read into the CalendarContract class about how to create events, modify them, set attendees and reminders, which is also exactly what I want my application to do, but I have found nothing regarding displaying or porting the view of these built in calendar functions to my application. Am I missing something or can you only manage events in my app, entered by some dummy screens, to be viewed by the default calendar app, not my own?

Examples I have found include, http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/ http://developer.android.com/guide/topics/providers/calendar-provider.html

Should I stick it out and create a custom adapter and try to replicate the existing calendar app? Or find a way to bring the default calendar into my application? I eventually need to create this on both iOS and Android, and need to be able to create, update, view, notify, manage everything from within my application (billing).

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top