Search in sources :

Example 1 with IFbPermissionWorker

use of com.abewy.android.apps.klyph.facebook.IFbPermissionWorker in project Klyph by jonathangerbaud.

the class UserTimeline method handleNewPostClick.

private void handleNewPostClick() {
    pendingAnnounce = false;
    Session session = Session.getActiveSession();
    List<String> permissions = session.getPermissions();
    if (!permissions.containsAll(PERMISSIONS)) {
        pendingAnnounce = true;
        ((IFbPermissionWorker) getActivity()).requestPublishPermissions(this, PERMISSIONS);
        return;
    }
    if (getIntentParam() == KlyphBundleExtras.USER_ID) {
        if (getElementId().equals(KlyphSession.getSessionUserId())) {
            Intent intent = new Intent(getActivity(), PostActivity.class);
            intent.putExtra(getIntentParam(), getElementId());
            startActivityForResult(intent, POST_CODE);
        } else {
            publishFeedDialog();
        }
    } else {
        Intent intent = new Intent(getActivity(), PostActivity.class);
        intent.putExtra(getIntentParam(), getElementId());
        startActivityForResult(intent, POST_CODE);
    }
}
Also used : IFbPermissionWorker(com.abewy.android.apps.klyph.facebook.IFbPermissionWorker) Intent(android.content.Intent) KlyphSession(com.abewy.android.apps.klyph.core.KlyphSession) Session(com.facebook.Session)

Aggregations

Intent (android.content.Intent)1 KlyphSession (com.abewy.android.apps.klyph.core.KlyphSession)1 IFbPermissionWorker (com.abewy.android.apps.klyph.facebook.IFbPermissionWorker)1 Session (com.facebook.Session)1