本文整理匯總了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();
}