本文整理汇总了Java中com.squareup.picasso.RequestCreator.noFade方法的典型用法代码示例。如果您正苦于以下问题:Java RequestCreator.noFade方法的具体用法?Java RequestCreator.noFade怎么用?Java RequestCreator.noFade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.squareup.picasso.RequestCreator
的用法示例。
在下文中一共展示了RequestCreator.noFade方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayNoScaling
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
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);
}
示例2: onPrepareRequestCreator
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
/**
* Prepares loading request creator with configuration based on this task's parameters.
*
* @param loader Loader used to obtain the creator.
* @return Prepared image loading request creator to be executed.
*/
@NonNull
protected RequestCreator onPrepareRequestCreator(@NonNull Picasso loader) {
final RequestCreator creator = loader.load(mTarget);
if (mPlaceholderRes != NO_RESOURCE_ID) creator.error(mPlaceholderRes);
if (mPlaceholder != null) creator.error(mPlaceholder);
if (mErrorRes != NO_RESOURCE_ID) creator.placeholder(mErrorRes);
if (mError != null) creator.placeholder(mError);
if (mTransformation != null) creator.transform(mTransformation);
if (hasRequest(REQUEST_DO_NOT_ANIMATE)) creator.noFade();
return creator;
}
示例3: display
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
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);
}
示例4: updateMovieDetails
import com.squareup.picasso.RequestCreator; //导入方法依赖的package包/类
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());
}