Search in sources :

Example 1 with SimpleListener

use of com.abewy.android.apps.klyph.core.imageloader.SimpleListener in project Klyph by jonathangerbaud.

the class UserActivity method initComponentsOnRequestSucces.

@Override
protected void initComponentsOnRequestSucces(List<GraphObject> result) {
    user = (User) result.get(0);
    if (result.size() > 1) {
        FriendRequest fr = (FriendRequest) result.get(1);
        setFriendButtonState(user.isFriend(), fr.getUid_to().equals(KlyphSession.getSessionUserId()), fr.getUid_from().equals(KlyphSession.getSessionUserId()));
    } else {
        setFriendButtonState(user.isFriend(), hasReceivedFriendRequest, hasSentFriendRequest);
    }
    headerName.setText(user.getName());
    // ImageLoader.display((ImageView) mHeaderPicture, ImageLoader.FAKE_URI, true, KlyphUtil.getPlaceHolder(this));
    ImageLoader.display(getHeaderPicture(), user.getPic_cover().getSource(), true, R.drawable.cover_place_holder, new SimpleListener() {

        @Override
        public void onSuccess() {
            super.onSuccess();
            // that would destroy the view
            if (getHeaderPicture() != null)
                ((UserCoverImageView) getHeaderPicture()).setOffset(user.getPic_cover().getOffset_y());
        }
    });
    ImageLoader.display(getHeaderLogo(), user.getPic(), true, KlyphUtil.getProfilePlaceHolder(this));
    Log.d("UserActivity", "initComponentsOnRequestSucces: " + listGridHeaderHeight);
    ((TabsAdapter) getPagerAdapter()).setUser(user);
    ((TabsAdapter) getPagerAdapter()).init(listGridHeaderHeight);
    ;
    ((TabsAdapter) getPagerAdapter()).setInitialPositionAndShow();
}
Also used : FriendRequest(com.abewy.android.apps.klyph.core.fql.FriendRequest) SimpleListener(com.abewy.android.apps.klyph.core.imageloader.SimpleListener) UserCoverImageView(com.abewy.android.apps.klyph.widget.coverImage.UserCoverImageView)

Example 2 with SimpleListener

use of com.abewy.android.apps.klyph.core.imageloader.SimpleListener in project Klyph by jonathangerbaud.

the class ImageFragment method loadImage.

private void loadImage() {
    progress.setVisibility(View.VISIBLE);
    ImageLoader.display(imageView, getLargestImageURL(), true, 0, new SimpleListener() {

        @Override
        public void onError() {
            Log.d("ImageFragment", "Failed to load image ");
        }

        @Override
        public void onSuccess() {
            Log.d("ImageFragment", "onSuccess: ");
            setProgressVisibility(false);
        }
    });
}
Also used : SimpleListener(com.abewy.android.apps.klyph.core.imageloader.SimpleListener)

Example 3 with SimpleListener

use of com.abewy.android.apps.klyph.core.imageloader.SimpleListener in project Klyph by jonathangerbaud.

the class PageActivity method initComponentsOnRequestSucces.

@Override
protected void initComponentsOnRequestSucces(List<GraphObject> result) {
    page = (Page) result.get(0);
    headerName.setText(page.getName());
    // ImageLoader.display((ImageView) mHeaderPicture, ImageLoader.FAKE_URI, true, KlyphUtil.getPlaceHolder(this));
    ImageLoader.display(getHeaderPicture(), page.getPic_cover().getSource(), true, R.drawable.cover_place_holder, new SimpleListener() {

        @Override
        public void onSuccess() {
            super.onSuccess();
            // that would destroy the view
            if (getHeaderPicture() != null)
                ((UserCoverImageView) getHeaderPicture()).setOffset(page.getPic_cover().getOffset_y());
        }
    });
    ImageLoader.display(getHeaderLogo(), page.getPic(), true, KlyphUtil.getProfilePlaceHolder(this));
    ((TabsAdapter) getPagerAdapter()).setPage(page);
    ((TabsAdapter) getPagerAdapter()).init(listGridHeaderHeight);
    ;
    ((TabsAdapter) getPagerAdapter()).setInitialPositionAndShow();
}
Also used : SimpleListener(com.abewy.android.apps.klyph.core.imageloader.SimpleListener) UserCoverImageView(com.abewy.android.apps.klyph.widget.coverImage.UserCoverImageView)

Example 4 with SimpleListener

use of com.abewy.android.apps.klyph.core.imageloader.SimpleListener in project Klyph by jonathangerbaud.

the class GroupActivity method initComponentsOnRequestSucces.

@Override
protected void initComponentsOnRequestSucces(List<GraphObject> result) {
    group = (Group) result.get(0);
    headerName.setText(group.getName());
    // ImageLoader.display((ImageView) mHeaderPicture, ImageLoader.FAKE_URI, true, KlyphUtil.getPlaceHolder(this));
    ImageLoader.display(getHeaderPicture(), group.getPic_cover().getSource(), true, R.drawable.cover_place_holder, new SimpleListener() {

        @Override
        public void onSuccess() {
            super.onSuccess();
            // that would destroy the view
            if (getHeaderPicture() != null)
                ((GroupCoverImageView) getHeaderPicture()).setOffset(group.getPic_cover().getOffset_y());
        }
    });
    ((TabsAdapter) getPagerAdapter()).setGroup(group);
    ((TabsAdapter) getPagerAdapter()).init(listGridHeaderHeight);
    ((TabsAdapter) getPagerAdapter()).setInitialPositionAndShow();
}
Also used : GroupCoverImageView(com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView) SimpleListener(com.abewy.android.apps.klyph.core.imageloader.SimpleListener)

Aggregations

SimpleListener (com.abewy.android.apps.klyph.core.imageloader.SimpleListener)4 UserCoverImageView (com.abewy.android.apps.klyph.widget.coverImage.UserCoverImageView)2 FriendRequest (com.abewy.android.apps.klyph.core.fql.FriendRequest)1 GroupCoverImageView (com.abewy.android.apps.klyph.widget.coverImage.GroupCoverImageView)1