當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。