當前位置: 首頁>>代碼示例>>Java>>正文


Java DynamicDrawableSpan.getDrawable方法代碼示例

本文整理匯總了Java中android.text.style.DynamicDrawableSpan.getDrawable方法的典型用法代碼示例。如果您正苦於以下問題:Java DynamicDrawableSpan.getDrawable方法的具體用法?Java DynamicDrawableSpan.getDrawable怎麽用?Java DynamicDrawableSpan.getDrawable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.text.style.DynamicDrawableSpan的用法示例。


在下文中一共展示了DynamicDrawableSpan.getDrawable方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: release

import android.text.style.DynamicDrawableSpan; //導入方法依賴的package包/類
public void release() {
    mText = null;
    mReleased = true;
    if (lines != null)
        lines.clear();
    lineSpan = null;
    chars = null;
    for (int i = 0; i < mDynamicDrawableSpanSparseArray.size(); i++) {
        int key = mDynamicDrawableSpanSparseArray.keyAt(i);
        DynamicDrawableSpan span = mDynamicDrawableSpanSparseArray.get(key);
        Drawable dr = span.getDrawable();
        if (dr != null && dr instanceof LazyDrawable) {
            ((LazyDrawable) dr).Unload();
        }
    }
    mDynamicDrawableSpanSparseArray.clear();
}
 
開發者ID:suwhs,項目名稱:wATLlib,代碼行數:18,代碼來源:TextLayout.java

示例2: writeImageSpanData

import android.text.style.DynamicDrawableSpan; //導入方法依賴的package包/類
/**
 *
 * @param span
 * @param dos
 */

private void writeImageSpanData(DynamicDrawableSpan span, DataOutputStream dos) {
    Drawable d = span.getDrawable();
    Bitmap bitmap;
    if (d instanceof BitmapDrawable) {
        bitmap = ((BitmapDrawable)d).getBitmap();
    } else {
        bitmap = Bitmap.createBitmap(d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.RGB_565);
        Canvas canvas = new Canvas(bitmap);
        d.draw(canvas);
    }
    bitmap.compress(Bitmap.CompressFormat.JPEG, 90,dos);
    bitmap.recycle();
}
 
開發者ID:suwhs,項目名稱:wATLlib,代碼行數:20,代碼來源:SpannedSerializator.java

示例3: getDynamicDrawablePosition

import android.text.style.DynamicDrawableSpan; //導入方法依賴的package包/類
public int getDynamicDrawablePosition(DynamicDrawableSpan span) {
    Drawable dr = span.getDrawable();
    if (dr!=null) {
        DrawableInfo di = mDrawableInfos.get(dr);
        if (di!=null) {
            return di.position;
        }
    }
    return -1;
}
 
開發者ID:suwhs,項目名稱:wATLlib,代碼行數:11,代碼來源:TextLayout.java

示例4: getDynamicDrawableSpanRect

import android.text.style.DynamicDrawableSpan; //導入方法依賴的package包/類
/**
 * @param dds - DynamicDrawableSpan
 * @param out - Rect instance
 * @return true, if dds are visible on layout
 */

public boolean getDynamicDrawableSpanRect(DynamicDrawableSpan dds, Rect out) {
    Drawable dr = dds.getDrawable();
    if (dr != null && visibleDrawables.contains(dr)) {
        Point offset = visibleDrawableOffsets.get(dr);
        Rect bounds = visibleDrawableBounds.get(dr);
        if (out != null)
            out.set(offset.x, offset.y, offset.x + bounds.width(), offset.y + bounds.height());
        return true;
    }
    return false;
}
 
開發者ID:suwhs,項目名稱:wATLlib,代碼行數:18,代碼來源:TextLayout.java

示例5: registerDrawable

import android.text.style.DynamicDrawableSpan; //導入方法依賴的package包/類
@Override
public void registerDrawable(DynamicDrawableSpan dds, int placement, int position) {
    Drawable dr = dds.getDrawable();
    DrawableInfo di = new DrawableInfo();
    di.span = dds;
    di.width = dr.getIntrinsicWidth();
    di.height = dr.getIntrinsicHeight();
    di.placement = placement;
    di.position = position;
    mDrawableInfos.put(dr, di);
}
 
開發者ID:suwhs,項目名稱:wATLlib,代碼行數:12,代碼來源:TextLayout.java


注:本文中的android.text.style.DynamicDrawableSpan.getDrawable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。