Search in sources :

Example 16 with MultiObjectAdapter

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

the class UserListDialog method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    defineEmptyText(R.string.empty_list_no_user);
    setEmptyViewVisible(false);
    setListAdapter(new MultiObjectAdapter(getListView()));
    getListView().setOnItemClickListener(this);
    setListVisible(false);
    if (list != null) {
        populate(list);
        setNoMoreData(true);
    }
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)

Example 17 with MultiObjectAdapter

use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter 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 18 with MultiObjectAdapter

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

the class PostPhotos method setImages.

public void setImages(List<String> uris) {
    MultiObjectAdapter adapter = new MultiObjectAdapter(getListView()) {

        @Override
        protected TypeAdapter<GraphObject> getAdapter(GraphObject object, int layoutType) {
            TypeAdapter<GraphObject> adapter = BaseAdapterSelector.getAdapter(object, layoutType);
            if (adapter != null)
                return adapter;
            if (object instanceof Picture)
                return new GalleryAdapter();
            return null;
        }
    };
    for (String uri : uris) {
        adapter.add(new Picture(uri));
    }
    getGridView().setAdapter(adapter);
    adapter.notifyDataSetChanged();
    setListVisible(true);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 19 with MultiObjectAdapter

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

the class StreamFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    defineEmptyText(R.string.cannot_find_post);
    adapter = new MultiObjectAdapter(getListView(), SpecialLayout.STREAM_DETAIL);
    setListAdapter(adapter);
    getListView().getAdapter().registerDataSetObserver(observer);
    sendButton = (ImageButton) view.findViewById(R.id.send_button);
    sendEditText = (EditText) view.findViewById(R.id.send_text_edit);
    sendButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            handlePostComment();
        }
    });
    setListVisible(false);
    super.onViewCreated(view, savedInstanceState);
    getGridView().setVerticalSpacing(1);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) View(android.view.View) KlyphGridView(com.abewy.android.apps.klyph.widget.KlyphGridView)

Example 20 with MultiObjectAdapter

use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter 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)

Aggregations

MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)32 View (android.view.View)7 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)7 ArrayList (java.util.ArrayList)5 List (java.util.List)4 Filter (android.widget.Filter)3 GoogleCardStyleAdapter (com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter)3 KlyphGridView (com.abewy.android.apps.klyph.widget.KlyphGridView)3 ImageView (android.widget.ImageView)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 Friend (com.abewy.android.apps.klyph.core.fql.Friend)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 Handler (android.os.Handler)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 SparseBooleanArray (android.util.SparseBooleanArray)1 KeyEvent (android.view.KeyEvent)1