当前位置: 首页>>代码示例>>Java>>正文


Java Picasso.LoadedFrom方法代码示例

本文整理汇总了Java中com.squareup.picasso.Picasso.LoadedFrom方法的典型用法代码示例。如果您正苦于以下问题:Java Picasso.LoadedFrom方法的具体用法?Java Picasso.LoadedFrom怎么用?Java Picasso.LoadedFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.squareup.picasso.Picasso的用法示例。


在下文中一共展示了Picasso.LoadedFrom方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadStreamerInfoAlbumArt

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
private void loadStreamerInfoAlbumArt() {
	Target loadArtTarget = new Target() {
		@Override
		public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
			if (mediaSession != null && mediaSession.isActive()) {
				mediaSession.setMetadata(getMediaSessionData(bitmap));
			}
			mChannelInfo.setLogoImage(bitmap);
			if (lastNotificationAction != null) {
				buildNotification(lastNotificationAction);
			}
		}

		@Override
		public void onBitmapFailed(Drawable errorDrawable) {

		}

		@Override
		public void onPrepareLoad(Drawable placeHolderDrawable) {

		}
	};
	Picasso.with(this).load(mChannelInfo.getLogoURLString()).into(loadArtTarget);
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:26,代码来源:PlayerService.java

示例2: getNightThemeTarget

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
private Target getNightThemeTarget() {
	return new Target() {
		@Override
		public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
			streamerImage.setImageBitmap(bitmap);
		}

		@Override
		public void onBitmapFailed(Drawable errorDrawable) {

		}

		@Override
		public void onPrepareLoad(Drawable placeHolderDrawable) {

		}
	};
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:19,代码来源:ChannelActivity.java

示例3: loadImage

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
private void loadImage(Uri uri, final MD360BitmapTexture.Callback callback){
    mTarget = new Target() {
        @Override
        public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
            // notify if size changed
            mVRLibrary.onTextureResize(bitmap.getWidth(), bitmap.getHeight());
            // texture
            callback.texture(bitmap);
            imagenCargada();
        }
        @Override
        public void onBitmapFailed(Drawable errorDrawable) {}

        @Override
        public void onPrepareLoad(Drawable placeHolderDrawable) {}
    };
    //Cargo la imagen con Picasso, me aseguro de que no la guarde en cache
    //que la reescale para ser más pequeña, que la centre y que la ponga
    //en el target
    Picasso.with(getApplicationContext())
            .load(uri)
            .resize(callback.getMaxTextureSize(),callback.getMaxTextureSize())
            .onlyScaleDown()
            .centerInside()
            .memoryPolicy(NO_CACHE, NO_STORE)
            .into(mTarget);
}
 
开发者ID:nen155,项目名称:TFG-SmartU-La-red-social,代码行数:28,代码来源:Imagen360Activity.java

示例4: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    Drawable drawable = new BitmapDrawable(getContext().getResources(), bitmap);
    drawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
    urlDrawable.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
    urlDrawable.setDrawable(drawable);
    RichTextView.this.setText(getText());
}
 
开发者ID:shenhuanet,项目名称:OpenEyesReading-android,代码行数:9,代码来源:RichTextView.java

示例5: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) {
    Drawable bitmapDrawable = new BitmapDrawable(mContext.getResources(), bitmap);
    mImageCardView.setMainImageScaleType(ImageView.ScaleType.CENTER_CROP);

    // Do not fade-in when loading from cache memory (because it is most likely instantaneous in that case)
    boolean fade = (loadedFrom!= Picasso.LoadedFrom.MEMORY);
    mImageCardView.setMainImage(bitmapDrawable, fade);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:10,代码来源:ScraperSearchResultPresenter.java

示例6: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    fetchColors(bitmap);
    art.setImageBitmap(bitmap);
}
 
开发者ID:architjn,项目名称:YAAB,代码行数:6,代码来源:PlayerPresenter.java

示例7: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    ch.setIcon(bitmap);
    invalidate();
}
 
开发者ID:PacktPublishing,项目名称:Building-Android-UIs-with-Custom-Views,代码行数:6,代码来源:EPG.java

示例8: onCreateView

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_details, container, false);
    ButterKnife.bind(this, view);

    if (getActivity() instanceof BaseActivity) {
        baseActivity = (BaseActivity) getActivity();
        data = baseActivity.getData();
    } else {
        watchLaterActivity = (WatchLaterActivity) getActivity();
        data = watchLaterActivity.getData();
    }

    detailsPresenter = new DetailsPresenter(this);
    setupRecyclerView();

    Object dataObject = data.getParcelable("ITEM");
    if (dataObject instanceof Movie) {
        isMovie = true;
        this.movie = (Movie) dataObject;
    } else {
        this.tvSeries = (TvSeries) dataObject;
    }

    backdropTarget = new Target() {
        @Override
        public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
            ivBackdropPoster.setImageBitmap(bitmap);
            if (Build.VERSION.SDK_INT >= 21) {
                createPaletteAsync(bitmap);
            }
        }

        @Override
        public void onBitmapFailed(Drawable errorDrawable) {
        }

        @Override
        public void onPrepareLoad(Drawable placeHolderDrawable) {
        }
    };

    initTransitionViews();

    if (getContext() != null) {
        if (Util.isConnected(getContext())) {
            if (isMovie) {
                detailsPresenter.fetchMovieDetails(movie.getMovieId());
            } else {
                detailsPresenter.fetchTvSeriesDetails(tvSeries.getTvId());
            }
        } else {
            Toast.makeText(getContext(), "No Internet Connection", Toast.LENGTH_SHORT).show();
        }
    }

    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (getActivity() != null) {
                getActivity().onBackPressed();
            }
        }
    });

    return view;
}
 
开发者ID:hsm59,项目名称:WatchIt,代码行数:69,代码来源:DetailsFragment.java

示例9: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    bitmapList.put(index, bitmap);
    setBitmapShaders(index, bitmap);
    postInvalidate();
}
 
开发者ID:stockx,项目名称:bubble-rank,代码行数:7,代码来源:BubbleRank.java

示例10: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    mBitmapCover = bitmap;
    createShader();
    postInvalidate();
}
 
开发者ID:dmllr,项目名称:IdealMedia,代码行数:7,代码来源:MusicPlayerView.java

示例11: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    setDrawable(new BitmapDrawable(context.getResources(), bitmap));
}
 
开发者ID:schul-cloud,项目名称:schulcloud-mobile-android,代码行数:5,代码来源:PicassoImageGetter.java

示例12: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) {
    mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
    mImageView.setImageBitmap(bitmap);
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:6,代码来源:ListPresenter.java

示例13: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) {
    if (this.mBackgroundManager.isAttached()) { // try to fix some cases of "java.lang.IllegalStateException: Must attach before setting background drawable"
        this.mBackgroundManager.setBitmap(bitmap);
    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:7,代码来源:PicassoBackgroundManagerTarget.java

示例14: onBitmapLoaded

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
@Override
public final void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    final Palette palette = getPalette(bitmap);
    onBitmapLoaded(bitmap, from, palette);
}
 
开发者ID:SalmanTKhan,项目名称:MyAnimeViewer,代码行数:6,代码来源:PaletteTransformation.java

示例15: getLightThemeTarget

import com.squareup.picasso.Picasso; //导入方法依赖的package包/类
private Target getLightThemeTarget() {
	return new Target() {
		@Override
		public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
			streamerImage.setImageBitmap(bitmap);

			Palette palette = 		Palette.from(bitmap).generate();
			int defaultColor = 		Service.getColorAttribute(R.attr.colorPrimary, R.color.primary, getBaseContext());
			int defaultDarkColor = 	Service.getColorAttribute(R.attr.colorPrimaryDark, R.color.primaryDark, getBaseContext());

			int vibrant = 		palette.getVibrantColor(defaultColor);
			int vibrantDark = 	palette.getDarkVibrantColor(defaultColor);
			int vibrantLight = 	palette.getLightVibrantColor(defaultColor);

			int muted = 	 palette.getMutedColor(defaultColor);
			int mutedDark =  palette.getDarkMutedColor(defaultColor);
			int mutedLight = palette.getLightMutedColor(defaultColor);

			Palette.Swatch swatch = null;

			if (vibrant != defaultColor) {
				swatch = palette.getVibrantSwatch();
			} else if (vibrantDark != defaultColor) {
				swatch = palette.getDarkVibrantSwatch();
			} else if (vibrantLight != defaultColor){
				swatch = palette.getLightVibrantSwatch();
			} else if (muted != defaultColor) {
				swatch = palette.getMutedSwatch();
			} else if (mutedDark != defaultColor) {
				swatch = palette.getDarkMutedSwatch();
			} else {
				swatch = palette.getLightMutedSwatch();
			}

			if (swatch != null) {
				float[] swatchValues = swatch.getHsl();
				float[] newSwatch = {swatchValues[0], (float) 0.85, (float) 0.85};
				float[] newSwatchComposite = {(swatchValues[0] + 180) % 360, newSwatch[1], newSwatch[2]};
				float[] newSwatchDark = {newSwatch[0], newSwatch[1], (float) 0.6};

				int newColorDark = Color.HSVToColor(newSwatchDark);
				int newColor = Color.HSVToColor(newSwatch);
				int compositeNewColor = Color.HSVToColor(newSwatchComposite);

				int primaryColor = Service.getBackgroundColorFromView(toolbar, defaultColor);
				int primaryColorDark = Service.getBackgroundColorFromView(mTabs, defaultDarkColor);

				Service.animateBackgroundColorChange(toolbar, newColor, primaryColor, COLOR_FADE_DURATION);
				Service.animateBackgroundColorChange(additionalToolbar, newColor, primaryColor, COLOR_FADE_DURATION);
				Service.animateBackgroundColorChange(mTabs, newColorDark, primaryColorDark, COLOR_FADE_DURATION);
				mFab.setBackgroundTintList(ColorStateList.valueOf(compositeNewColor));
				mTabs.setSelectedTabIndicatorColor(compositeNewColor);

				if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
					Window window = getWindow();
					window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
					window.setStatusBarColor(newColorDark);
				}
			}
		}

		@Override
		public void onBitmapFailed(Drawable errorDrawable) {}

		@Override
		public void onPrepareLoad(Drawable placeHolderDrawable) {}
	};
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:69,代码来源:ChannelActivity.java


注:本文中的com.squareup.picasso.Picasso.LoadedFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。