@SuppressLint("InflateParams") @Override public View getInfoContents(Marker marker) { if (popup == null) { popup=inflater.inflate(R.layout.popup, null); } if (lastMarker == null || !lastMarker.getId().equals(marker.getId())) { lastMarker=marker; TextView tv=(TextView)popup.findViewById(R.id.title); tv.setText(marker.getTitle()); tv=(TextView)popup.findViewById(R.id.snippet); tv.setText(marker.getSnippet()); Uri image=images.get(marker.getId()); ImageView icon=(ImageView)popup.findViewById(R.id.icon); if (image == null) { icon.setVisibility(View.GONE); } else { icon.setVisibility(View.VISIBLE); Picasso.with(ctxt).load(image).resize(iconWidth, iconHeight) .centerCrop().noFade() .placeholder(R.drawable.placeholder) .into(icon, new MarkerCallback(marker)); } } return(popup); }
public static void loadMovie(@NonNull ImageView imageView, @NonNull String posterPath, @NonNull String size) { String url = BuildConfig.IMAGES_BASE_URL + size + posterPath; Picasso.with(imageView.getContext()) .load(url) .noFade() .into(imageView); }
public static void loadMovie(@NonNull ImageView imageView, @NonNull String posterPath, @NonNull String size) { String url = BuildConfig.IMAGES_BASE_URL + size + posterPath; Picasso.with(imageView.getContext()) .load(url) .noFade() .into(imageView); }
/** * Load the item's thumbnail image into our {@link ImageView}. */ private void loadThumbnail() { Picasso.with(mHeaderImageView.getContext()) .load(mItem.getThumbnailUrl()) .noFade() .into(mHeaderImageView); }
/** * Load the item's full-size image into our {@link ImageView}. */ private void loadFullSizeImage() { Picasso.with(mHeaderImageView.getContext()) .load(mItem.getPhotoUrl()) .noFade() .noPlaceholder() .into(mHeaderImageView); }
@Override public void showMovieDetail(Movie movie) { activity.getSupportActionBar().setTitle(movie.title); tvOverview.setText(movie.plot); Picasso.with(getContext()) .load(movie.poster) .noFade() .placeholder(R.drawable.placeholder) .networkPolicy(NetworkPolicy.OFFLINE) .into(imPoster); }
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ImageView imageView = (ImageView) view.findViewById(R.id.picasso_fragment_b_image); Picasso.with(getContext()) .load(PicassoFragmentA.GIRAFFE_PIC_URL) .fit() .noFade() .centerCrop() .into(imageView, new Callback() { @Override public void onSuccess() { startPostponedEnterTransition(); } @Override public void onError() { startPostponedEnterTransition(); } }); } }
.noFade() .into(imageView, new Callback() { @Override
public void exitWithAnimation() { runOnUiThread(() -> { Picasso.with(EmulationActivity.this) .invalidate(mScreenPath); Picasso.with(EmulationActivity.this) .load(mScreenPath) .noFade() .noPlaceholder() .into(mImageView, new Callback() { @Override public void onSuccess() { showScreenshot(); } @Override public void onError() { finish(); } }); }); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_details, container, false); mAlbumImage = (ImageView) rootView.findViewById(R.id.details_album_image); final ImageView backgroundImage = (ImageView) rootView.findViewById(R.id.details_background_image); View textContainer = rootView.findViewById(R.id.details_text_container); TextView albumTitleText = (TextView) textContainer.findViewById(R.id.details_album_title); String albumImageUrl = ALBUM_IMAGE_URLS[mAlbumPosition]; String backgroundImageUrl = BACKGROUND_IMAGE_URLS[mAlbumPosition]; String albumName = ALBUM_NAMES[mAlbumPosition]; albumTitleText.setText(albumName); mAlbumImage.setTransitionName(albumName); RequestCreator albumImageRequest = Picasso.with(getActivity()).load(albumImageUrl); RequestCreator backgroundImageRequest = Picasso.with(getActivity()).load(backgroundImageUrl).fit().centerCrop(); if (mIsTransitioning) { albumImageRequest.noFade(); backgroundImageRequest.noFade(); backgroundImage.setAlpha(0f); getActivity().getWindow().getSharedElementEnterTransition().addListener(new TransitionListenerAdapter() { @Override public void onTransitionEnd(Transition transition) { backgroundImage.animate().setDuration(mBackgroundImageFadeMillis).alpha(1f); } }); } albumImageRequest.into(mAlbumImage, mImageCallback); backgroundImageRequest.into(backgroundImage); return rootView; }
public void updateCurrentBackground(String imageUrl) { this.currentAnimationDirection = AnimationDirection.RIGHT; ImageView image = (ImageView) this.getNextView(); image.setImageDrawable(null); showNext(); if(imageUrl == null) return; Picasso.get().load(imageUrl) .noFade().noPlaceholder() .into(new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { setImageBitmapWithAnimation(bitmap, currentAnimationDirection); } @Override public void onBitmapFailed(Exception e, Drawable errorDrawable) { System.out.println("@#@#@#@#@" + e.getMessage()); } @Override public void onPrepareLoad(Drawable placeHolderDrawable) { } }); }
.noFade() .into(imageView, new Callback() { @Override
@Override public void call(final Subscriber<? super Bitmap> subscriber) { Preconditions.checkUiThread(); final Target target = new TargetAdapter() { @Override public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) { if (!subscriber.isUnsubscribed()) { FutureTask<Bitmap> futureTask = new FutureTask<>(PaintBlurOnSubscribe.this.futureRunnable(bitmap, subscriber), null); ioExecutor.execute(futureTask); subscriber.add(Subscriptions.from(futureTask)); } } @Override public void onBitmapFailed(Drawable errorDrawable) { if (!subscriber.isUnsubscribed()) subscriber.onError(new PicassoError(errorDrawable)); } }; Picasso.with(context)// .load(resId)// .noFade()// .config(Bitmap.Config.ARGB_8888)// .memoryPolicy(NO_CACHE, NO_STORE).into(target); subscriber.add(new MainThreadSubscription() { @Override protected void onUnsubscribe() { Picasso.with(context).cancelRequest(target); PaintBlurOnSubscribe.this.context = null; } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.picasso_activity_b); ImageView imageView = (ImageView) findViewById(R.id.picasso_activity_b_image); supportPostponeEnterTransition(); Picasso.with(this) .load(PicassoActivityA.TIGER_PIC_URL) .fit() .noFade() .centerCrop() .into(imageView, new Callback() { @Override public void onSuccess() { supportStartPostponedEnterTransition(); } @Override public void onError() { supportStartPostponedEnterTransition(); } }); } }
@Override public void call(final Subscriber<? super Bitmap> subscriber) { Preconditions.checkUiThread(); final Target target = new TargetAdapter() { @Override public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) { if (!subscriber.isUnsubscribed()) { FutureTask<Bitmap> futureTask = new FutureTask<>(FastBlurOnSubscribe.this.futureRunnable(bitmap, subscriber), null); ioExecutor.execute(futureTask); subscriber.add(Subscriptions.from(futureTask)); } } @Override public void onBitmapFailed(Drawable errorDrawable) { if (!subscriber.isUnsubscribed()) subscriber.onError(new PicassoError(errorDrawable)); } }; Picasso .with(context) .load(resId) .noFade() .config(Bitmap.Config.ARGB_8888) .memoryPolicy(NO_CACHE, NO_STORE) .into(target); subscriber.add(new MainThreadSubscription() { @Override protected void onUnsubscribe() { Picasso.with(context).cancelRequest(target); FastBlurOnSubscribe.this.context = null; } }); }
private void loadImage(final ViewHolder holder, final int position, final NetworkPolicy networkPolicy) { final WeakReference<CircularLoaderDrawable> xx = new WeakReference<>(holder.getCircularLoaderDrawable()); Picasso.with(holder.getImageView().getContext()) .load(photoList.get(position).getUrl()) .resize(mColumnWidth, (int) (photoList.get(position).getAspectRatio() * mColumnWidth)) .placeholder(xx.get()) .noFade() .networkPolicy(networkPolicy) .into(holder.getImageView(), new com.squareup.picasso.Callback() { @Override public void onSuccess() { // xx.get().clearAnimation(); // AnimationUtils.fadeIn(holder.getImageView()); } @Override public void onError() { if (!networkPolicy.equals(NetworkPolicy.OFFLINE)) { holder.getCircularLoaderDrawable().setError(); } else { loadImage(holder, position, NetworkPolicy.NO_CACHE); } } }); }
/** * Load a {@link android.graphics.Bitmap} asynchronously * * @param context the context needed for fetching resources * @param imageView the {@link ImageView}, which will be used to show the {@link * android.graphics.Bitmap} * @param image the path to load the image from * @param width the width in density independent pixels to scale the image down to */ public static void loadBlurredImageIntoImageView(Context context, ImageView imageView, Image image, int width, int placeHolderResId, Callback callback) { RequestCreator creator; if (image != null && !TextUtils.isEmpty(image.getImagePath())) { String imagePath = buildImagePath(image, width); creator = Picasso.with(context) .load(ImageUtils.preparePathForPicasso(imagePath)) .resize(width, width) .transform(new BlurTransformation(context, 16)); } else { creator = Picasso.with(context).load(placeHolderResId); } if (placeHolderResId > 0) { creator.error(placeHolderResId); } if (callback != null) { creator.noFade(); } creator.into(imageView, callback); }
.with(context) .load(resId) .noFade() .memoryPolicy(NO_CACHE, NO_STORE) .config(Bitmap.Config.ARGB_8888)
@Override public void onInject(final Package pack, IViewInjector view) { view .text(R.id.name, pack.name) .text(R.id.version, pack.info.version) .text(R.id.author, pack.info.author) .text(R.id.description, pack.description) .clicked(R.id.item, new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.npmjs.com" + pack.link))); } }); Picasso .with(MainActivity.this) .load(pack.icon) .noFade() .placeholder(R.drawable.box) .error(R.drawable.box) .into((ImageView) view.findViewById(R.id.icon)); } })