Search in sources :

Example 6 with DrawableTransitionOptions

use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.

the class UnLimit91Adapter method convert.

@Override
protected void convert(BaseViewHolder helper, UnLimit91PornItem item) {
    helper.setText(R.id.tv_91porn_item_title, item.getTitleWithDuration());
    helper.setText(R.id.tv_91porn_item_info, item.getInfo());
    ImageView simpleDraweeView = helper.getView(R.id.iv_91porn_item_img);
    Uri uri = Uri.parse(item.getImgUrl());
    GlideApp.with(helper.itemView).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).into(simpleDraweeView);
}
Also used : DrawableTransitionOptions(com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions) ImageView(android.widget.ImageView) Uri(android.net.Uri)

Example 7 with DrawableTransitionOptions

use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.

the class UserLoginActivity method loadCaptcha.

/**
 * 加载验证码,目前似乎是非必须,不填也是可以登录的
 */
private void loadCaptcha() {
    String url = addressHelper.getVideo91PornAddress() + "captcha.php";
    Logger.t(TAG).d("验证码链接:" + url);
    Uri uri = Uri.parse(url);
    GlideApp.with(this).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(simpleDraweeView);
}
Also used : DrawableTransitionOptions(com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions) Uri(android.net.Uri)

Example 8 with DrawableTransitionOptions

use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.

the class UserRegisterActivity method loadCaptcha.

/**
 * 加载验证码,目前似乎是非必须,不填也是可以登录的
 */
private void loadCaptcha() {
    String url = addressHelper.getVideo91PornAddress() + "captcha2.php";
    Logger.t(TAG).d("验证码链接:" + url);
    Uri uri = Uri.parse(url);
    GlideApp.with(this).load(uri).placeholder(R.drawable.placeholder).transition(new DrawableTransitionOptions().crossFade(300)).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(wbCaptcha);
}
Also used : DrawableTransitionOptions(com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions) Uri(android.net.Uri)

Example 9 with DrawableTransitionOptions

use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project 91Pop by DanteAndroid.

the class ExoMediaPlayerActivity method playVideo.

@Override
public void playVideo(String title, String videoUrl, String name, String thumImgUrl) {
    if (isPauseByActivityEvent) {
        isPauseByActivityEvent = false;
        videoPlayer.reset();
    }
    videoControlsMobile.setOnBackButtonClickListener(new ExoVideoControlsMobile.OnBackButtonClickListener() {

        @Override
        public void onBackClick(View view) {
            onBackPressed();
        }
    });
    if (!TextUtils.isEmpty(thumImgUrl)) {
        GlideApp.with(this).load(Uri.parse(thumImgUrl)).transition(new DrawableTransitionOptions().crossFade(300)).into(videoPlayer.getPreviewImageView());
    }
    // 加载本地下载好的视频
    if (unLimit91PornItem.getStatus() == FileDownloadStatus.completed) {
        File downloadFile = new File(unLimit91PornItem.getDownLoadPath(dataManager));
        if (downloadFile.exists()) {
            videoPlayer.setVideoPath(downloadFile.getAbsolutePath());
        } else {
            String proxyUrl = httpProxyCacheServer.getProxyUrl(videoUrl);
            videoPlayer.setVideoURI(Uri.parse(proxyUrl));
        }
    } else {
        String proxyUrl = httpProxyCacheServer.getProxyUrl(videoUrl);
        videoPlayer.setVideoURI(Uri.parse(proxyUrl));
    }
    videoControlsMobile.setTitle(title);
}
Also used : DrawableTransitionOptions(com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions) ExoVideoControlsMobile(com.flymegoc.exolibrary.widget.ExoVideoControlsMobile) ExoVideoView(com.flymegoc.exolibrary.widget.ExoVideoView) View(android.view.View) File(java.io.File)

Example 10 with DrawableTransitionOptions

use of com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions in project glide by bumptech.

the class GlideContextTest method getDefaultTransitionOptions_withSuperClassRegistered_returnsSuperClassOptions.

@Test
public void getDefaultTransitionOptions_withSuperClassRegistered_returnsSuperClassOptions() {
    DrawableTransitionOptions expected = new DrawableTransitionOptions();
    transitionOptions.put(Drawable.class, expected);
    assertThat(context.getDefaultTransitionOptions(BitmapDrawable.class)).isEqualTo(expected);
    assertThat(context.getDefaultTransitionOptions(GifDrawable.class)).isEqualTo(expected);
}
Also used : DrawableTransitionOptions(com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions) Test(org.junit.Test)

Aggregations

DrawableTransitionOptions (com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions)12 Uri (android.net.Uri)6 ImageView (android.widget.ImageView)5 Drawable (android.graphics.drawable.Drawable)2 View (android.view.View)2 Bitmap (android.graphics.Bitmap)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 AppCompatImageView (android.support.v7.widget.AppCompatImageView)1 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 LinearLayout (android.widget.LinearLayout)1 ProgressBar (android.widget.ProgressBar)1 DataSource (com.bumptech.glide.load.DataSource)1 GlideException (com.bumptech.glide.load.engine.GlideException)1 BitmapTransitionOptions (com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions)1 RequestListener (com.bumptech.glide.request.RequestListener)1 RequestOptions (com.bumptech.glide.request.RequestOptions)1 Target (com.bumptech.glide.request.target.Target)1 TouchImageView (com.dante.custom.TouchImageView)1 ExoVideoControlsMobile (com.flymegoc.exolibrary.widget.ExoVideoControlsMobile)1