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


Java GlideDrawable.start方法代码示例

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


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

示例1: onResourceReady

import com.bumptech.glide.load.resource.drawable.GlideDrawable; //导入方法依赖的package包/类
@Override
public void onResourceReady(GlideDrawable resource,
                            GlideAnimation<? super GlideDrawable> glideAnimation) {
    this.mResource = resource;
    setDrawable(resource);
    resource.setLoopCount(GlideDrawable.LOOP_FOREVER);
    resource.start();
}
 
开发者ID:YiiGuxing,项目名称:CompositionAvatar,代码行数:9,代码来源:BindingUtil.java

示例2: onResourceReady

import com.bumptech.glide.load.resource.drawable.GlideDrawable; //导入方法依赖的package包/类
@Override public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> glideAnimation) {
    if (container != null && container.get() != null) {
        TextView textView = container.get();
        float width;
        float height;
        if (resource.getIntrinsicWidth() >= this.width) {
            float downScale = (float) resource.getIntrinsicWidth() / this.width;
            width = (float) (resource.getIntrinsicWidth() / downScale / 1.3);
            height = (float) (resource.getIntrinsicHeight() / downScale / 1.3);
        } else {
            float multiplier = (float) this.width / resource.getIntrinsicWidth();
            width = (float) resource.getIntrinsicWidth() * multiplier;
            height = (float) resource.getIntrinsicHeight() * multiplier;
        }
        Rect rect = new Rect(0, 0, Math.round(width), Math.round(height));
        resource.setBounds(rect);
        urlDrawable.setBounds(rect);
        urlDrawable.setDrawable(resource);
        if (resource.isAnimated() && !PrefGetter.isGistDisabled()) {
            urlDrawable.setCallback((Drawable.Callback) textView.getTag(R.id.drawable_callback));
            resource.setLoopCount(GlideDrawable.LOOP_FOREVER);
            resource.start();
        }
        textView.setText(textView.getText());
        textView.invalidate();
    }
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:28,代码来源:GlideDrawableTarget.java

示例3: onResourceReady

import com.bumptech.glide.load.resource.drawable.GlideDrawable; //导入方法依赖的package包/类
@Override public void onResourceReady(GlideDrawable resource,
    GlideAnimation<? super GlideDrawable> glideAnimation) {
    Rect rect;
    if (resource.getIntrinsicWidth() > 100) {
        float width;
        float height;
        System.out.println("Image width is " + resource.getIntrinsicWidth());
        System.out.println("View width is " + view.getWidth());
        if (resource.getIntrinsicWidth() >= getView().getWidth()) {
            float downScale = (float) resource.getIntrinsicWidth() / getView().getWidth();
            width = (float) resource.getIntrinsicWidth() / (float) downScale;
            height = (float) resource.getIntrinsicHeight() / (float) downScale;
        } else {
            float multiplier = (float) getView().getWidth() / resource.getIntrinsicWidth();
            width = (float) resource.getIntrinsicWidth() * (float) multiplier;
            height = (float) resource.getIntrinsicHeight() * (float) multiplier;
        }
        System.out.println("New Image width is " + width);

        rect = new Rect(0, 0, Math.round(width), Math.round(height));
    } else {
        rect = new Rect(0, 0, resource.getIntrinsicWidth() * 2,
            resource.getIntrinsicHeight() * 2);
    }
    resource.setBounds(rect);

    mDrawable.setBounds(rect);
    mDrawable.setDrawable(resource);

    if (resource.isAnimated()) {
        mDrawable.setCallback(get(getView()));
        resource.setLoopCount(GlideDrawable.LOOP_FOREVER);
        resource.start();
    }

    getView().setText(getView().getText());
    getView().invalidate();
}
 
开发者ID:plusend,项目名称:DiyCode,代码行数:39,代码来源:GlideImageGetter.java

示例4: onResourceReady

import com.bumptech.glide.load.resource.drawable.GlideDrawable; //导入方法依赖的package包/类
@Override
public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> glideAnimation) {
    // Resize images - Scale image proportionally to fit TextView width
    float width;
    float height;
    if (resource.getIntrinsicWidth() >= getView().getWidth()) {
        float downScale = (float) resource.getIntrinsicWidth() / getView().getWidth();
        width = (float) resource.getIntrinsicWidth() / downScale;
        height = (float) resource.getIntrinsicHeight() / downScale;
    } else {
        float multiplier = (float) getView().getWidth() / resource.getIntrinsicWidth();
        width = (float) resource.getIntrinsicWidth() * multiplier;
        height = (float) resource.getIntrinsicHeight() * multiplier;
    }
    Rect rect = new Rect(0, 0, Math.round(width), Math.round(height));

    resource.setBounds(rect);

    mDrawable.setBounds(rect);
    mDrawable.setDrawable(resource);

    if (resource.isAnimated()) {
        // set callback to drawable in order to
        // signal its container to be redrawn
        // to show the animated GIF

        mDrawable.setCallback(get(getView()));
        resource.setLoopCount(GlideDrawable.LOOP_FOREVER);
        resource.start();
    }

    getView().setText(getView().getText());
    getView().invalidate();
}
 
开发者ID:fusion44,项目名称:galactic-tavern-android,代码行数:35,代码来源:GlideImageGetter.java

示例5: onResourceReady

import com.bumptech.glide.load.resource.drawable.GlideDrawable; //导入方法依赖的package包/类
@Override public void onResourceReady(GlideDrawable glideDrawable, GlideAnimation glideAnimation) {
	// start GlideDrawable, even if it's not animated (these methods are No-op in that case)
	glideDrawable.setLoopCount(GlideDrawable.LOOP_FOREVER);
	glideDrawable.start();
	setDrawable(glideDrawable);
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:7,代码来源:WrapperTarget.java

示例6: onResourceReady

import com.bumptech.glide.load.resource.drawable.GlideDrawable; //导入方法依赖的package包/类
@Override public void onResourceReady(GlideDrawable resource, GlideAnimation<? super GlideDrawable> animation) {
	super.onResourceReady(resource, animation);
	this.resource = resource;
	resource.setLoopCount(maxLoopCount);
	resource.start();
}
 
开发者ID:TWiStErRob,项目名称:glide-support,代码行数:7,代码来源:GlideDrawableViewBackgroundTarget.java


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