Search in sources :

Example 6 with MultiObjectAdapter

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

the class KlyphFragment method populate.

protected void populate(List<GraphObject> data) {
    if (getView() != null) {
        MultiObjectAdapter adapter = getAdapter();
        for (GraphObject graphObject : data) {
            adapter.add(graphObject);
        }
        // adapter.addAll(data); is only available in api 11
        endLoading();
        boolean requestHasMoreData = request != null && request.hasMoreData();
        if (data.size() == 0 || !requestHasMoreData)
            noMoreData = true;
        offset = String.valueOf(adapter.getCount());
    }
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 7 with MultiObjectAdapter

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

the class AlbumPhotos method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    setListVisible(false);
    setRequestType(tagged ? Query.ALBUM_TAGGED_PHOTOS : Query.ALBUM_PHOTOS);
    getGridView().setAdapter(new MultiObjectAdapter(getListView(), SpecialLayout.GRID));
    defineEmptyText(R.string.empty_list_no_photo);
    //getGridView().setStretchMode(GridView.NO_STRETCH);
    super.onViewCreated(view, savedInstanceState);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)

Example 8 with MultiObjectAdapter

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

the class GroupPhotos method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    setListVisible(false);
    setRequestType(Query.GROUP_PHOTOS);
    super.onViewCreated(view, savedInstanceState);
    defineEmptyText(R.string.empty_list_no_photo);
    getGridView().setAdapter(new MultiObjectAdapter(getListView(), SpecialLayout.GRID));
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)

Example 9 with MultiObjectAdapter

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

the class ImageFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    progress = (ProgressBar) view.findViewById(R.id.progress);
    emptyView = (ListEmptyView) view.findViewById(R.id.emptyView);
    imageView = (ImageViewTouch) view.findViewById(R.id.image);
    slidingDrawer = (KlyphSlidingDrawer) view.findViewById(R.id.sliding_drawer);
    captionInfo = (ViewGroup) view.findViewById(R.id.caption_info);
    profileImage = (ImageView) view.findViewById(R.id.author_profile_image);
    authorName = (TextView) view.findViewById(R.id.author_name);
    postTime = (TextView) view.findViewById(R.id.post_time);
    sendTextEdit = (EditText) view.findViewById(R.id.send_text_edit);
    sendButton = (ImageButton) view.findViewById(R.id.send_button);
    emptyView.setText(R.string.cannot_find_photo);
    getListView().setCacheColorHint(AttrUtil.getColor(getActivity(), android.R.attr.windowBackground));
    // imageView.setOnScaleListener(this);
    imageView.setSingleTapListener(new ImageViewTouch.OnImageViewTouchSingleTapListener() {

        @Override
        public void onSingleTapConfirmed() {
            toggleBarVisibility();
        }
    });
    sendButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            handlePostComment();
        }
    });
    defineEmptyText(R.string.no_comment);
    adapter = new MultiObjectAdapter(getListView(), SpecialLayout.PHOTO);
    setListAdapter(adapter);
    // setRequestType(Query.PHOTO_AND_COMMENTS);
    setRequestType(Query.PHOTO);
    super.onViewCreated(view, savedInstanceState);
    //Crash if before super.onViewCreated(view, savedInstanceState);
    getListView().getAdapter().registerDataSetObserver(observer);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) ImageViewTouch(it.sephiroth.android.library.imagezoom.ImageViewTouch) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView) ListEmptyView(com.abewy.android.apps.klyph.view.ListEmptyView)

Example 10 with MultiObjectAdapter

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

the class Notifications method onActivityCreated.

/*
	 * @Override
	 * protected KlyphPullToRefreshListView onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState)
	 * {
	 * return (KlyphPullToRefreshListView) inflater.inflate(R.layout.list_notifications, null);
	 * }
	 */
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    NotificationSwipeDismissAdapter swAdapter = new NotificationSwipeDismissAdapter(new MultiObjectAdapter(getListView()), new OnDismissCallback() {

        @Override
        public void onDismiss(AbsListView arg0, int[] positions) {
            for (int i : positions) {
                if (getAdapter().getItem(i) instanceof Notification) {
                    Notification notification = (Notification) getAdapter().getItem(i);
                    setNotificationRead(notification);
                }
            }
            List<GraphObject> list = new ArrayList<GraphObject>();
            for (GraphObject o : getAdapter().getItems()) {
                if (!(o instanceof Header)) {
                    list.add(o);
                }
            }
            populate(list);
        }
    });
    swAdapter.setAbsListView(getListView());
    setListAdapter(swAdapter);
    // setListAdapter(new MultiObjectAdapter(getListView()));
    defineEmptyText(R.string.empty_list_no_notification);
    setListVisible(false);
    setRequestType(Query.NOTIFICATIONS);
    loggedIn = true;
    new Handler().postDelayed(new Runnable() {

        public void run() {
            loadNotifications();
        }
    }, 2000);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) OnDismissCallback(com.haarman.listviewanimations.itemmanipulation.OnDismissCallback) AbsListView(android.widget.AbsListView) Handler(android.os.Handler) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject) Notification(com.abewy.android.apps.klyph.core.fql.Notification) KlyphNotification(com.abewy.android.apps.klyph.KlyphNotification) Header(com.abewy.klyph.items.Header) ArrayList(java.util.ArrayList) List(java.util.List)

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