com.bumptech.glide.load.DataSource Java Examples

The following examples show how to use com.bumptech.glide.load.DataSource. 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 Project: GlidePalette   Author: florent37   File: GlidePalette.java    License: Apache License 2.0 6 votes vote down vote up
@Override public boolean onResourceReady(TranscodeType resource, Object model, Target<TranscodeType> target, DataSource dataSource, boolean isFirstResource) {
    boolean callbackResult = this.callback != null && this.callback.onResourceReady(resource, model, target, dataSource, isFirstResource);

    Bitmap b = null;
    if (resource instanceof BitmapDrawable) {
        b = ((BitmapDrawable) resource).getBitmap();
    } else if (resource instanceof GifDrawable) {
        b = ((GifDrawable) resource).getFirstFrame();
    } else if (target instanceof BitmapHolder) {
        b = ((BitmapHolder) target).getBitmap();
    }

    if (b != null) {
        start(b);
    }

    return callbackResult;
}
 
Example #2
Source Project: mollyim-android   Author: mollyim   File: GiphyAdapter.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
  synchronized (this) {
    if (new ChunkedImageUrl(image.getGifUrl(), image.getGifSize()).equals(model)) {
      this.modelReady = true;
      notifyAll();
    }
  }

  return false;
}
 
Example #3
Source Project: GlideToVectorYou   Author: corouteam   File: SvgSoftwareLayerSetter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(PictureDrawable resource, Object model,
                               Target<PictureDrawable> target, DataSource dataSource, boolean isFirstResource) {
    ImageView view = ((ImageViewTarget<?>) target).getView();
    view.setLayerType(ImageView.LAYER_TYPE_SOFTWARE, null);

    if (customListener != null) {
        customListener.onResourceReady();
    }

    return false;
}
 
Example #4
Source Project: Android-App-Architecture-MVVM-Databinding   Author: BrianSpace   File: ImageLoader.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(final Drawable resource, final Object model, final Target<Drawable> target,
        final DataSource dataSource, final boolean isFirstResource) {
    if (BuildConfig.DEBUG) {
        Log.i(TAG, String.format(Locale.ROOT,
                "GLIDE onResourceReady(%s, %s, %s, %s, %s)", resource, model,
                target, dataSource, isFirstResource));
    }

    return false;
}
 
Example #5
Source Project: ShareBox   Author: Kerr1Gan   File: FileExpandableAdapter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
    if (model instanceof String) {
        CacheUtil.makeCache((String) model, ImageUtil.drawable2Bitmap(resource), resource.getIntrinsicWidth(),
                resource.getIntrinsicHeight(), mContext);
    }
    return false;
}
 
Example #6
Source Project: glide-support   Author: TWiStErRob   File: LoggingListener.java    License: The Unlicense 5 votes vote down vote up
@Override public boolean onResourceReady(R resource, Object model, Target<R> target, DataSource dataSource,
		boolean isFirstResource) {
	String resourceString = strip(getResourceDescription(resource));
	String targetString = strip(getTargetDescription(target));
	android.util.Log.println(level, "GLIDE", String.format(Locale.ROOT,
			"%s.onResourceReady(%s, %s, %s, %s, %s)",
			name, resourceString, model, targetString, dataSource, isFirst(isFirstResource)));
	return delegate.onResourceReady(resource, model, target, dataSource, isFirstResource);
}
 
Example #7
Source Project: PainlessMusicPlayer   Author: Doctoror   File: NowPlayingActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(
        @NonNull final Drawable resource,
        @NonNull final Object model,
        @NonNull final Target<Drawable> target,
        @NonNull final DataSource dataSource,
        final boolean isFirstResource) {
    onArtProcessed();
    return false;
}
 
Example #8
Source Project: PainlessMusicPlayer   Author: Doctoror   File: QueueActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(
        @NonNull final Drawable resource,
        @NonNull final Object model,
        @NonNull final Target<Drawable> target,
        @NonNull final DataSource dataSource,
        final boolean isFirstResource) {
    onImageSet();
    return false;
}
 
Example #9
Source Project: PainlessMusicPlayer   Author: Doctoror   File: ConditionalAlbumListFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(
        @NonNull final Drawable resource,
        @NonNull final Object model,
        @NonNull final Target<Drawable> target,
        @NonNull final DataSource dataSource,
        final boolean isFirstResource) {
    final FragmentActivity activity = getActivity();
    if (activity != null) {
        activity.supportStartPostponedEnterTransition();
    }
    return false;
}
 
Example #10
Source Project: GestureViews   Author: alexvasilkov   File: DemoGlideHelper.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(T resource, Object model, Target<T> target,
        DataSource dataSource, boolean isFirstResource) {
    if (listener != null) {
        listener.onSuccess();
    }
    return false;
}
 
Example #11
Source Project: Simple-Dilbert   Author: smarek   File: DilbertFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
    if (progress != null) {
        progress.setVisibility(View.GONE);
    }
    applyZoomLevel();
    return false;
}
 
Example #12
Source Project: mollyim-android   Author: mollyim   File: StickerRemoteUriFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public @NonNull DataSource getDataSource() {
  return DataSource.REMOTE;
}
 
Example #13
Source Project: mollyim-android   Author: mollyim   File: OkHttpStreamFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public @NonNull DataSource getDataSource() {
  return DataSource.REMOTE;
}
 
Example #14
Source Project: mollyim-android   Author: mollyim   File: ChunkedImageUrlFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
  return DataSource.REMOTE;
}
 
Example #15
Source Project: mollyim-android   Author: mollyim   File: ContactPhotoFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public @NonNull DataSource getDataSource() {
  return DataSource.LOCAL;
}
 
Example #16
Source Project: mollyim-android   Author: mollyim   File: AttachmentStreamLocalUriFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public @NonNull DataSource getDataSource() {
  return DataSource.LOCAL;
}
 
Example #17
Source Project: mollyim-android   Author: mollyim   File: BlurHashModelLoader.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public @NonNull DataSource getDataSource() {
  return DataSource.LOCAL;
}
 
Example #18
Source Project: SoloPi   Author: alipay   File: AppIconGlideModule.java    License: Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.LOCAL;
}
 
Example #19
Source Project: bcm-android   Author: bcmapp   File: OkHttpStreamFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
  return DataSource.REMOTE;
}
 
Example #20
Source Project: bcm-android   Author: bcmapp   File: ContactPhotoFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
  return DataSource.LOCAL;
}
 
Example #21
Source Project: bcm-android   Author: bcmapp   File: AttachmentStreamLocalUriFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
  return DataSource.LOCAL;
}
 
Example #22
Source Project: zom-android-matrix   Author: zom   File: GlideVFSLoader.java    License: Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.LOCAL;
}
 
Example #23
Source Project: AndroidProject   Author: getActivity   File: OkHttpFetcher.java    License: Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.REMOTE;
}
 
Example #24
Source Project: NewFastFrame   Author: HelloChenJinJun   File: OkHttpStreamFetcher.java    License: Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return null;
}
 
Example #25
Source Project: MusicPlayer   Author: dtrung98   File: AudioFileCoverFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.LOCAL;
}
 
Example #26
Source Project: MusicPlayer   Author: dtrung98   File: ArtistImageFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.REMOTE;
}
 
Example #27
Source Project: CrazyDaily   Author: crazysunj   File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public boolean onResourceReady(File resource, Object model, Target<File> target, DataSource dataSource, boolean isFirstResource) {
    return false;
}
 
Example #28
Source Project: FastAndroid   Author: shengjunhu   File: OkHttpStreamFetcher.java    License: Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.REMOTE;
}
 
Example #29
Source Project: Aurora   Author: Zweihui   File: OkHttpStreamFetcher.java    License: Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.REMOTE;
}
 
Example #30
Source Project: VinylMusicPlayer   Author: AdrienPoupa   File: AudioFileCoverFetcher.java    License: GNU General Public License v3.0 4 votes vote down vote up
@NonNull
@Override
public DataSource getDataSource() {
    return DataSource.LOCAL;
}