當前位置: 首頁>>代碼示例>>Java>>正文


Java GlideAnimation類代碼示例

本文整理匯總了Java中com.bumptech.glide.request.animation.GlideAnimation的典型用法代碼示例。如果您正苦於以下問題:Java GlideAnimation類的具體用法?Java GlideAnimation怎麽用?Java GlideAnimation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GlideAnimation類屬於com.bumptech.glide.request.animation包,在下文中一共展示了GlideAnimation類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showWhenPictureReady

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
public void showWhenPictureReady (final int id) {
    Glide.with(getCenter().getContext()).load(url)
            .asBitmap().into(new SimpleTarget<Bitmap>() {
        @Override
        public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
            Log.v(TAG, "showWhenPictureReady onResourceReady");
            bigPicture(resource).show(id);
        }

        @Override
        public void onLoadFailed(Exception e, Drawable errorDrawable) {
            super.onLoadFailed(e, errorDrawable);
            getCenter().show(id);
            Log.v(TAG, "showWhenPictureReady onLoadFailed " + e.getMessage());
        }
    });
}
 
開發者ID:boybeak,項目名稱:NotificationStyles,代碼行數:18,代碼來源:AsyncBigPicture.java

示例2: setImgBackGround

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
private void setImgBackGround() {
    String[] images = getResources().getStringArray(R.array.splash_background);
    int position = new Random().nextInt(images.length - 1) % (images.length);

    Glide.with(this)
            .load(images[position])
            .into(mImgBackGround);

    String path = SpUtil.getString(this, "path");
    Glide.with(this)
            .load(path)
            .asBitmap()
            .error(R.drawable.def_avatar)
            .into(new SimpleTarget<Bitmap>() {
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                    mCircleImageView.setImageBitmap(resource);
                }
            });

    //設置圖像的透明度
    AlphaAnimation animation = new AlphaAnimation(0.1f, 1.0f);
    animation.setDuration(800);
    mCircleImageView.startAnimation(animation);
    animation.setAnimationListener(this);
}
 
開發者ID:haihaio,項目名稱:AmenEye,代碼行數:27,代碼來源:SplashActivity.java

示例3: showAdPacket

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
private void showAdPacket() {
    adaptationADBanner();
    Glide.with(mContext).load(mBannerUrl).into(new GlideDrawableImageViewTarget(mAdBg) {
        @Override
        public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
            super.onResourceReady(resource, animation);
            mPresenter.sendADStatistics(RPConstant.STATISTICS_TYPE_VIEW_AD, mRedPacketInfo.redPacketId);
        }
    });
    Glide.with(mContext).load(mRedPacketInfo.logoURL).transform(new CircleTransform(mContext)).into(mAdIcon);
    mLayoutBom.setBackgroundColor(Color.parseColor(mRedPacketInfo.adBgColor));
    mTVSponsor.setText(String.format(getString(R.string.money_sponsor_username_format), mRedPacketInfo.ownerName));
    if (mRedPacketInfo.status == RPConstant.RED_PACKET_STATUS_RECEIVABLE) {//未領取
        mTVMoney.setText(mRedPacketInfo.redPacketGreeting);
    } else if (mRedPacketInfo.status == RPConstant.RED_PACKET_STATUS_RECEIVED) {//已被領取
        //myAmount大於0,說明當前用戶領取到了紅包
        if (Double.parseDouble(mRedPacketInfo.myAmount) > 0) {
            receiveSuccess();
        } else {//紅包搶完了
            redPacketOut(getString(R.string.money_is_out));
        }
    } else if (mRedPacketInfo.status == RPConstant.RED_PACKET_STATUS_EXPIRED) {//紅包過期
        redPacketOut(getString(R.string.ad_packet_out));
    }
}
 
開發者ID:YunzhanghuOpen,項目名稱:redpacketui-open,代碼行數:26,代碼來源:ADPacketFragment.java

示例4: onCreateView

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View contentView = inflater.inflate(R.layout.fragment_image_preview, container, false);
    final ImageView imageView = (ImageView) contentView.findViewById(R.id.preview_image);
    final PhotoViewAttacher mAttacher = new PhotoViewAttacher(imageView);
    Glide.with(container.getContext())
            .load(new File(getArguments().getString(PATH)))
            .asBitmap()
            .into(new SimpleTarget<Bitmap>(480, 800) {
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                    imageView.setImageBitmap(resource);
                    mAttacher.update();
                }
            });
    mAttacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() {
        @Override
        public void onViewTap(View view, float x, float y) {
            ImagePreviewActivity activity = (ImagePreviewActivity) getActivity();
            activity.switchBarVisibility();
        }
    });
    return contentView;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:26,代碼來源:ImagePreviewFragment.java

示例5: initEventAndData

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
@Override
protected void initEventAndData() {
    setToolBar(toolBar,"");
    mRealmHelper = App.getAppComponent().realmHelper();
    Intent intent = getIntent();
    url = intent.getExtras().getString(Constants.IT_GANK_GRIL_URL);
    id = intent.getExtras().getString(Constants.IT_GANK_GRIL_ID);
    if (url != null) {
        Glide.with(mContext).load(url).asBitmap().into(new SimpleTarget<Bitmap>() {
            @Override
            public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                bitmap = resource;
                ivGirlDetail.setImageBitmap(resource);
                mAttacher = new PhotoViewAttacher(ivGirlDetail);
            }
        });
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:GirlDetailActivity.java

示例6: setupDetailsOverviewRow

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
private DetailsOverviewRow setupDetailsOverviewRow(Object event) {
		final DetailsOverviewRow row = new DetailsOverviewRow(event);
		String thumbUrl;
		if (event instanceof Event) {
			thumbUrl = ((Event) event).getThumbUrl();
		} else {
			thumbUrl = ((Room) event).getThumb();
		}
		Glide.with(getActivity())
				.load(thumbUrl)
				.asBitmap()
				.into(new SimpleTarget<Bitmap>(DETAIL_THUMB_WIDTH, DETAIL_THUMB_HEIGHT) {
					@Override
					public void onResourceReady(Bitmap resource,
												GlideAnimation<? super Bitmap> glideAnimation) {
						row.setImageBitmap(getActivity(), resource);
					}

					@Override
					public void onLoadFailed(Exception e, Drawable errorDrawable) {
//						super.onLoadFailed(e, errorDrawable);
						row.setImageDrawable(getResources().getDrawable(DEFAULT_DRAWABLE));
					}
				});
		return row;
	}
 
開發者ID:NiciDieNase,項目名稱:chaosflix-leanback,代碼行數:27,代碼來源:EventsDetailsFragment.java

示例7: onUpdateMusicNotification

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
/**
 * 更新通知
 */
public void onUpdateMusicNotification(MusicBean bean, boolean isplay){
    Log.e(TAG,"更新通知--歌曲名稱:"+ bean.getSongname()+"--isplay:"+isplay);
    if (null == bean) return;
    //更新歌曲名稱
    remoteViews.setTextViewText(R.id.tv_song_name,(bean.getSongname() == null ? "" : bean.getSongname()));
    //更新歌手名字
    remoteViews.setTextViewText(R.id.tv_singer,(bean.getSingername() == null ? "" : bean.getSingername()));
    //更新歌曲圖片
    Glide.with(context).load(bean.getAlbumpic_big()).asBitmap().into(new SimpleTarget<Bitmap>() {
        @Override
        public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
            remoteViews.setImageViewBitmap(R.id.img_song, resource);
        }
    });

    //更新播放狀態:播放或者暫停
    if (isplay){
        remoteViews.setImageViewResource(R.id.img_play,R.mipmap.play);
    }else {
        remoteViews.setImageViewResource(R.id.img_play,R.mipmap.pause);
    }
    onCreateMusicNotification();//彈出更新的通知
}
 
開發者ID:popo1379,項目名稱:popomusic,代碼行數:27,代碼來源:MusicNotification.java

示例8: initEventAndData

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
@Override
protected void initEventAndData() {
    setToolBar(toolBar,"");
    mRealmHelper = App.getAppComponent().realmHelper();
    Intent intent = getIntent();
    url = intent.getExtras().getString("url");
    id = intent.getExtras().getString("id");
    if (url != null) {
        Glide.with(mContext).load(url).asBitmap().into(new SimpleTarget<Bitmap>() {
            @Override
            public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                bitmap = resource;
                ivGirlDetail.setImageBitmap(resource);
                mAttacher = new PhotoViewAttacher(ivGirlDetail);
            }
        });
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:GirlDetailActivity.java

示例9: onActivityResult

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
@Override
public void onActivityResult(int reqCode, int resultCode, final Intent data) {
  super.onActivityResult(reqCode, resultCode, data);
  Uri outputFile = Uri.fromFile(new File(getCacheDir(), "cropped"));

  if (data == null || resultCode != Activity.RESULT_OK)
    return;

  switch (reqCode) {
    case PICK_CONTACT:
      List<String> selected = data.getStringArrayListExtra("contacts");
      for (String contact : selected) {
        final Recipient recipient = RecipientFactory.getRecipientsFromString(this, contact, false).getPrimaryRecipient();
        if (recipient != null) addSelectedContacts(recipient);
      }
      break;

    case Crop.REQUEST_PICK:
      new Crop(data.getData()).output(outputFile).asSquare().start(this);
      break;
    case Crop.REQUEST_CROP:
      Glide.with(this).load(Crop.getOutput(data)).asBitmap()
           .skipMemoryCache(true)
           .diskCacheStrategy(DiskCacheStrategy.NONE)
           .centerCrop().override(AVATAR_SIZE, AVATAR_SIZE)
           .into(new SimpleTarget<Bitmap>() {
             @Override
             public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
               setAvatar(Crop.getOutput(data), resource);
             }
           });
  }
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:34,代碼來源:GroupCreateActivity.java

示例10: updateBackground

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
protected void updateBackground(String uri) {
    int width = mMetrics.widthPixels;
    int height = mMetrics.heightPixels;
    Glide.with(getActivity())
            .load(uri)
            .centerCrop()
            .error(mDefaultBackground)
            .into(new SimpleTarget<GlideDrawable>(width, height) {
                @Override
                public void onResourceReady(GlideDrawable resource,
                                            GlideAnimation<? super GlideDrawable>
                                                    glideAnimation) {
                    mBackgroundManager.setDrawable(resource);
                }
            });
    mBackgroundTimer.cancel();
}
 
開發者ID:bassaer,項目名稱:HelloTV,代碼行數:18,代碼來源:MainFragment.java

示例11: updateMetadata

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
private void updateMetadata(final Movie movie) {
    final MediaMetadata.Builder metadataBuilder = new MediaMetadata.Builder();

    String title = movie.getTitle().replace("_", " -");

    metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_TITLE, title);
    metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_SUBTITLE,
            movie.getDescription());
    metadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_ICON_URI,
            movie.getCardImageUrl());

    // And at minimum the title and artist for legacy support
    metadataBuilder.putString(MediaMetadata.METADATA_KEY_TITLE, title);
    metadataBuilder.putString(MediaMetadata.METADATA_KEY_ARTIST, movie.getStudio());

    Glide.with(this)
            .load(Uri.parse(movie.getCardImageUrl()))
            .asBitmap()
            .into(new SimpleTarget<Bitmap>(500, 500) {
                @Override
                public void onResourceReady(Bitmap bitmap, GlideAnimation anim) {
                    metadataBuilder.putBitmap(MediaMetadata.METADATA_KEY_ART, bitmap);
                    mSession.setMetadata(metadataBuilder.build());
                }
            });
}
 
開發者ID:cleaninsights,項目名稱:cleaninsights-android-sdk,代碼行數:27,代碼來源:PlaybackOverlayActivity.java

示例12: DebouncedImageLoader

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
public DebouncedImageLoader(Context context, BackgroundManager backgroundManager, int width, int height) {
    mBackgroundManager = backgroundManager;
    Observable.create(this)
            .debounce(1, TimeUnit.SECONDS)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(posterProvider -> {
                Glide.with(context)
                        .load(posterProvider.providePosterURL())
                        .asBitmap()
                        .centerCrop()
                        .into(new SimpleTarget<Bitmap>(width, height) {
                            @Override
                            public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap>
                                    glideAnimation) {
                                mBackgroundManager.setBitmap(resource);
                            }
                        });
            });
}
 
開發者ID:CrazyDude1994,項目名稱:lostfilm-android-client,代碼行數:20,代碼來源:DebouncedImageLoader.java

示例13: loadImageWithProgress

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
/**
 * 顯示加載進度
 *
 * @param path       圖片地址
 * @param mImageView 圖片控件
 * @param loadView   加載view
 */
public static void loadImageWithProgress(String path, final ImageView mImageView, final View loadView, int errorRes) {
    Glide.with(mImageView.getContext()).load(path).error(errorRes).into(new GlideDrawableImageViewTarget(mImageView) {
        @Override
        public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
            super.onResourceReady(resource, animation);
            loadView.setVisibility(View.GONE);
        }

        @Override
        public void onLoadFailed(Exception e, Drawable errorDrawable) {
            super.onLoadFailed(e, errorDrawable);
            loadView.setVisibility(View.GONE);
        }
    });
}
 
開發者ID:guiying712,項目名稱:AndroidModulePattern,代碼行數:23,代碼來源:ImageUtils.java

示例14: loadGif

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
/**
 * 加載gif
 */
private void loadGif() {
    Glide.with(ImageBrowseActivity.this)
            .load(mImageUrl)
            .fitCenter()
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .into(new GlideDrawableImageViewTarget(pvPic) {
                @Override
                public void onResourceReady(GlideDrawable resource, GlideAnimation<?
                        super GlideDrawable> animation) {
                    super.onResourceReady(resource, animation);
                    //在這裏添加一些圖片加載完成的操作
                    pbPicBrowse.setVisibility(View.GONE);
                }
            });
}
 
開發者ID:Horrarndoo,項目名稱:YiZhi,代碼行數:19,代碼來源:ImageBrowseActivity.java

示例15: initializeBackground

import com.bumptech.glide.request.animation.GlideAnimation; //導入依賴的package包/類
private void initializeBackground(Movie data) {
    mDetailsBackground.enableParallax();
    Glide.with(getActivity())
            .load(data.getBackgroundImageUrl())
            .asBitmap()
            .centerCrop()
            .error(R.drawable.default_background)
            .into(new SimpleTarget<Bitmap>() {
                @Override
                public void onResourceReady(Bitmap bitmap,
                                            GlideAnimation<? super Bitmap> glideAnimation) {
                    mDetailsBackground.setCoverBitmap(bitmap);
                    mAdapter.notifyArrayItemRangeChanged(0, mAdapter.size());
                }
            });
}
 
開發者ID:alphater,項目名稱:garras,代碼行數:17,代碼來源:VideoDetailsFragment.java


注:本文中的com.bumptech.glide.request.animation.GlideAnimation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。