Java Code Examples for com.squareup.picasso.RequestCreator#noFade()

The following examples show how to use com.squareup.picasso.RequestCreator#noFade() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImageLoader.java    From Contacts with MIT License 6 votes vote down vote up
public static void displayNoScaling(ImageView imageView, String uri, boolean fadeIn, int stubImage, ImageLoaderListener listener)
{
	if (uri == null || uri.length() == 0)
		uri = FAKE_URI;

	Picasso picasso = Picasso.with(imageView.getContext());
	RequestCreator requestCreator = picasso.load(uri);

	if (stubImage != 0)
	{
		requestCreator.placeholder(stubImage);
		requestCreator.error(stubImage);
	}

	if (!(fadeIn && FADE_ENABLED))
		requestCreator.noFade();

	requestCreator.into(imageView, listener);
}
 
Example 2
Source File: ImageLoader.java    From Klyph with MIT License 6 votes vote down vote up
public static void displayNoScaling(ImageView imageView, String uri, boolean fadeIn, int stubImage, ImageLoaderListener listener)
{
	if (uri == null || uri.length() == 0)
		uri = FAKE_URI;

	Picasso picasso = Picasso.with(imageView.getContext());
	RequestCreator requestCreator = picasso.load(uri);

	if (stubImage != 0)
	{
		requestCreator.placeholder(stubImage);
		requestCreator.error(stubImage);
	}

	if (!(fadeIn && FADE_ENABLED))
		requestCreator.noFade();

	requestCreator.into(imageView, listener);
}
 
Example 3
Source File: ImageLoader.java    From KlyphMessenger with MIT License 6 votes vote down vote up
public static void displayNoScaling(ImageView imageView, String uri, boolean fadeIn, int stubImage, ImageLoaderListener listener)
{
	if (uri == null || uri.length() == 0)
		uri = FAKE_URI;

	Picasso picasso = Picasso.with(imageView.getContext());
	RequestCreator requestCreator = picasso.load(uri);

	if (stubImage != 0)
	{
		requestCreator.placeholder(stubImage);
		requestCreator.error(stubImage);
	}

	if (!(fadeIn && FADE_ENABLED))
		requestCreator.noFade();

	requestCreator.into(imageView, listener);
}
 
Example 4
Source File: ImageLoader.java    From Contacts with MIT License 5 votes vote down vote up
public static void display(ImageView imageView, Uri uri, boolean fadeIn, int stubImage, ImageLoaderListener listener)
{
	/*if (uri == null || uri.length() == 0)
		uri = FAKE_URI;
	
	//uri = Uri.encode(uri, ALLOWED_URI_CHARS);*/

	Picasso picasso = Picasso.with(imageView.getContext());
	RequestCreator requestCreator = picasso.load(uri);

	if (stubImage != 0)
	{
		requestCreator.placeholder(stubImage);
		requestCreator.error(stubImage);
	}

	if (!(fadeIn && FADE_ENABLED))
		requestCreator.noFade();

	LayoutParams params = imageView.getLayoutParams();

	if (params.width > 0 && params.height > 0)
	{
		requestCreator.resize(params.width, params.height, true);
	}

	requestCreator.inSampleSize(true);
	requestCreator.into(imageView, listener);
}
 
Example 5
Source File: ImageLoader.java    From Contacts with MIT License 5 votes vote down vote up
public static void display(ImageView imageView, String uri, boolean fadeIn, int stubImage, ImageLoaderListener listener)
{
	if (uri == null || uri.length() == 0)
		uri = FAKE_URI;
	
	uri = Uri.encode(uri, ALLOWED_URI_CHARS);

	Picasso picasso = Picasso.with(imageView.getContext());
	RequestCreator requestCreator = picasso.load(uri);

	if (stubImage != 0)
	{
		requestCreator.placeholder(stubImage);
		requestCreator.error(stubImage);
	}

	if (!(fadeIn && FADE_ENABLED))
		requestCreator.noFade();

	LayoutParams params = imageView.getLayoutParams();

	if (params.width > 0 && params.height > 0)
	{
		requestCreator.resize(params.width, params.height, true);
	}

	requestCreator.inSampleSize(true);
	requestCreator.into(imageView, listener);
}
 
Example 6
Source File: ImageLoader.java    From Klyph with MIT License 5 votes vote down vote up
public static void display(ImageView imageView, String uri, boolean fadeIn, int stubImage, ImageLoaderListener listener)
{
	if (uri == null || uri.length() == 0)
		uri = FAKE_URI;
	
	/*uri = uri.replace("�", URLEncoder.encode("�"));
	uri = uri.replace("�", URLEncoder.encode("�"));
	uri = uri.replace("'", URLEncoder.encode("'"));
	uri = uri.replace("�", URLEncoder.encode("�"));*/
	
	uri = Uri.encode(uri, ALLOWED_URI_CHARS);

	Picasso picasso = Picasso.with(imageView.getContext());
	RequestCreator requestCreator = picasso.load(uri);

	if (stubImage != 0)
	{
		requestCreator.placeholder(stubImage);
		requestCreator.error(stubImage);
	}

	if (!(fadeIn && FADE_ENABLED))
		requestCreator.noFade();

	LayoutParams params = imageView.getLayoutParams();

	if (params.width > 0 && params.height > 0)
	{
		requestCreator.resize(params.width, params.height, true);
	}

	requestCreator.inSampleSize(true);
	requestCreator.into(imageView, listener);
}
 
Example 7
Source File: ImageLoader.java    From KlyphMessenger with MIT License 5 votes vote down vote up
public static void display(ImageView imageView, String uri, boolean fadeIn, int stubImage, ImageLoaderListener listener)
{
	if (uri == null || uri.length() == 0)
		uri = FAKE_URI;
	
	/*uri = uri.replace("�", URLEncoder.encode("�"));
	uri = uri.replace("�", URLEncoder.encode("�"));
	uri = uri.replace("'", URLEncoder.encode("'"));
	uri = uri.replace("�", URLEncoder.encode("�"));*/
	
	uri = Uri.encode(uri, ALLOWED_URI_CHARS);

	Picasso picasso = Picasso.with(imageView.getContext());
	RequestCreator requestCreator = picasso.load(uri);

	if (stubImage != 0)
	{
		requestCreator.placeholder(stubImage);
		requestCreator.error(stubImage);
	}

	if (!(fadeIn && FADE_ENABLED))
		requestCreator.noFade();

	LayoutParams params = imageView.getLayoutParams();

	if (params.width > 0 && params.height > 0)
	{
		requestCreator.resize(params.width, params.height, true);
	}

	requestCreator.inSampleSize(true);
	requestCreator.into(imageView, listener);
}
 
Example 8
Source File: MovieDetailsFragment.java    From udacity-p1-p2-popular-movies with MIT License 4 votes vote down vote up
private void updateMovieDetails() {
    Picasso picasso = Picasso.with(getActivity());

    mToolbar.setTitle(mMovie.getTitle());

    if (mAnimBackdropAnimateAlpha) {
        mBackdrop.setAlpha(0f); // wait for enter animation
    }
    mBackdrop.setTranslationY(0);
    int backdropWidth = mBackdrop.getWidth();   // this will be correct because this function is
                                                // only called after layout is complete
    int backdropHeight = getResources().getDimensionPixelSize(R.dimen.details_backdrop_height);
    RequestCreator backdropRequest = picasso
            .load(TMDbUtil.buildBackdropUrl(mMovie.getBackdropPath(), backdropWidth))
            .resize(backdropWidth, backdropHeight)
            .centerCrop()
            .transform(PaletteTransformation.instance());
    if (! mAnimBackdropAnimateAlpha) {
        backdropRequest.noFade();
    }
    backdropRequest.into(mBackdrop, new PaletteTransformationCallback(mBackdrop));

    if (mAnimBackdropAnimateAlpha) {
        mPoster.setAlpha(0f); // wait for enter animation
    }
    mPoster.setTranslationY(0);
    int posterWidth = getResources().getDimensionPixelSize(R.dimen.details_poster_width);
    int posterHeight = getResources().getDimensionPixelSize(R.dimen.details_poster_height);
    RequestCreator posterRequest = picasso
            .load(TMDbUtil.buildPosterUrl(mMovie.getPosterPath(), posterWidth))
            .resize(posterWidth, posterHeight)
            .centerCrop();
    if (! mAnimBackdropAnimateAlpha) {
        posterRequest.noFade();
    }
    posterRequest.into(mPoster);

    mTitle.setText(mMovie.getTitle());

    Calendar calendar = Calendar.getInstance();
    calendar.setTime(mMovie.getReleaseDate());
    mReleaseDate.setText(String.valueOf(calendar.get(Calendar.YEAR)));

    mRating.setText(String.format("%1$2.1f", mMovie.getRating()));
    mSynopsis.setText(mMovie.getSynopsis());
}