SearchResultHandler.java 文件源码

java
阅读 47 收藏 0 点赞 0 评论 0

项目:DeepImagePreview-Project 作者:
private void saveResultAndLoadPreview(final SearchResultContainer container, final String text) {

        // If i don't have items then just save it into the config, it will be ignored on the screen
        if (container != null && !container.getImages().isEmpty()) {
            container.setCreatedAt(System.currentTimeMillis());

            // Load first image as bitmap and save search results
            Picasso.with(mContext)
                    .load(container.getFirstThumbnailLink())
                    .resize(50, 50)
                    .centerCrop()
                    .fetch(new Callback() {
                        @Override
                        public void onSuccess() {
                            saveSearchResultAndRemoveFromLoadingDetections(container, text);
                        }

                        @Override
                        public void onError() {
                            saveSearchResultAndRemoveFromLoadingDetections(container, text);
                        }
                    });
        } else {
            saveSearchResultAndRemoveFromLoadingDetections(new SearchResultContainer(), text);
        }
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号