当前位置: 首页>>代码示例>>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;未经允许,请勿转载。