Search in sources :

Example 1 with EventResponse

use of com.abewy.android.apps.klyph.core.fql.Event.EventResponse in project Klyph by jonathangerbaud.

the class EventFragment method sendRequest.

private void sendRequest(int query) {
    final EventResponse eventResponse;
    switch(query) {
        case Query.POST_EVENT_ATTEND:
            {
                eventResponse = EventResponse.ATTENDING;
                break;
            }
        case Query.POST_EVENT_UNSURE:
            {
                eventResponse = EventResponse.UNSURE;
                break;
            }
        case Query.POST_EVENT_DECLINE:
            {
                eventResponse = EventResponse.DECLINED;
                break;
            }
        default:
            {
                eventResponse = EventResponse.NOT_REPLIED;
                break;
            }
    }
    final AlertDialog publishing = new AlertDialog.Builder(getActivity()).setTitle(R.string.event_response_dialog_title).setMessage(R.string.event_response_dialog_message).setCancelable(false).create();
    publishing.show();
    new AsyncRequest(query, event.getEid(), "", new AsyncRequest.Callback() {

        @Override
        public void onComplete(Response response) {
            publishing.dismiss();
            onRequestComplete(response, eventResponse);
        }
    }).execute();
}
Also used : AlertDialog(android.app.AlertDialog) Response(com.abewy.android.apps.klyph.core.request.Response) EventResponse(com.abewy.android.apps.klyph.core.fql.Event.EventResponse) AsyncRequest(com.abewy.android.apps.klyph.request.AsyncRequest) IFbPermissionCallback(com.abewy.android.apps.klyph.facebook.IFbPermissionCallback) EventResponse(com.abewy.android.apps.klyph.core.fql.Event.EventResponse)

Aggregations

AlertDialog (android.app.AlertDialog)1 EventResponse (com.abewy.android.apps.klyph.core.fql.Event.EventResponse)1 Response (com.abewy.android.apps.klyph.core.request.Response)1 IFbPermissionCallback (com.abewy.android.apps.klyph.facebook.IFbPermissionCallback)1 AsyncRequest (com.abewy.android.apps.klyph.request.AsyncRequest)1