Search in sources :

Example 1 with GoogleCardStyleAdapter

use of com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter in project Klyph by jonathangerbaud.

the class StreamListFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    MultiObjectAdapter adapter = /* KlyphPreferences.areBannerAdsEnabled() ? new NewsfeedAdapter(getListView()) : */
    new MultiObjectAdapter(getListView());
    if (KlyphPreferences.animateCards()) {
        GoogleCardStyleAdapter gcsAdapter = new GoogleCardStyleAdapter(adapter);
        gcsAdapter.setAbsListView(getListView());
        setListAdapter(gcsAdapter);
    } else {
        setListAdapter(adapter);
    }
    defineEmptyText(R.string.empty_list_no_stream);
    // getListView().setPadding(0, 8, 0, 0);
    // getListView().setDivider(getResources().getDrawable(R.drawable.hdivider_transparent));
    // getGridView().setVerticalSpacing(16);
    // getListView().setItemsCanFocus(false);
    getListView().setDrawSelectorOnTop(true);
    getListView().setSelector(AttrUtil.getResourceId(getActivity(), R.attr.streamSelector));
    setListVisible(false);
    if (KlyphData.getFriendLists() == null) {
        new AsyncRequest(Query.FRIEND_LISTS, "", "", new Callback() {

            @Override
            public void onComplete(Response response) {
                onRequestComplete(response);
            }
        }).execute();
    }
    super.onViewCreated(view, savedInstanceState);
}
Also used : Response(com.abewy.android.apps.klyph.core.request.Response) AsyncRequest(com.abewy.android.apps.klyph.request.AsyncRequest) Callback(com.abewy.android.apps.klyph.core.request.BaseAsyncRequest.Callback) MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) GoogleCardStyleAdapter(com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter)

Example 2 with GoogleCardStyleAdapter

use of com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter in project Klyph by jonathangerbaud.

the class UserTimeline method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    defineEmptyText(R.string.empty_list_no_stream);
    setListVisible(false);
    getListView().setDrawSelectorOnTop(true);
    getListView().setSelector(AttrUtil.getResourceId(getActivity(), R.attr.streamSelector));
    super.onViewCreated(view, savedInstanceState);
    MultiObjectAdapter adapter = /*KlyphPreferences.areBannerAdsEnabled() ? new NewsfeedAdapter(getListView(), SpecialLayout.ELEMENT_TIMELINE)
				: */
    new MultiObjectAdapter(getListView(), SpecialLayout.ELEMENT_TIMELINE);
    if (KlyphPreferences.animateCards()) {
        GoogleCardStyleAdapter gcsAdapter = new GoogleCardStyleAdapter(adapter);
        gcsAdapter.setAbsListView(getListView());
        setListAdapter(gcsAdapter);
    } else {
        setListAdapter(adapter);
    }
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) GoogleCardStyleAdapter(com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter)

Example 3 with GoogleCardStyleAdapter

use of com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter in project Klyph by jonathangerbaud.

the class EventFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    defineEmptyText(R.string.empty_list_no_data);
    setListVisible(false);
    attendButtonListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!event.isUserAttendingEvent()) {
                handleResponseClick(Query.POST_EVENT_ATTEND);
            }
        }
    };
    unsureButtonListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!event.isUserUnsureEvent()) {
                handleResponseClick(Query.POST_EVENT_UNSURE);
            }
        }
    };
    declinedButtonListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!event.isUserDeclinedEvent()) {
                handleResponseClick(Query.POST_EVENT_DECLINE);
            }
        }
    };
    invitedGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_invitee, event.getAll_members_count()));
            dialog.setRequestType(Query.EVENT_INVITED);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    goingGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_attending, event.getAttending_count()));
            dialog.setRequestType(Query.EVENT_GOING);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    unsureGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_unsure, event.getUnsure_count()));
            dialog.setRequestType(Query.EVENT_MAYBE);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    declinedGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_declined, event.getDeclined_count()));
            dialog.setRequestType(Query.EVENT_DECLINED);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    setRequestType(Query.EVENT_TIMELINE);
    setNewestRequestType(Query.EVENT_TIMELINE);
    super.onViewCreated(view, savedInstanceState);
    MultiObjectAdapter adapter = /*KlyphPreferences.areBannerAdsEnabled() ? new NewsfeedAdapter(getListView(), SpecialLayout.EVENT_ABOUT)
				: */
    new MultiObjectAdapter(getListView(), SpecialLayout.EVENT_ABOUT);
    if (KlyphPreferences.animateCards()) {
        GoogleCardStyleAdapter gcsAdapter = new GoogleCardStyleAdapter(adapter);
        gcsAdapter.setAbsListView(getListView());
        setListAdapter(gcsAdapter);
    } else {
        setListAdapter(adapter);
    }
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) GoogleCardStyleAdapter(com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter) OnClickListener(android.view.View.OnClickListener) View(android.view.View) KlyphGridView(com.abewy.android.apps.klyph.widget.KlyphGridView)

Aggregations

MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)3 GoogleCardStyleAdapter (com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter)3 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 Callback (com.abewy.android.apps.klyph.core.request.BaseAsyncRequest.Callback)1 Response (com.abewy.android.apps.klyph.core.request.Response)1 AsyncRequest (com.abewy.android.apps.klyph.request.AsyncRequest)1 KlyphGridView (com.abewy.android.apps.klyph.widget.KlyphGridView)1