本文整理汇总了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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}