private void ensureExpandedTexture() {
if (this.mExpandedTitleTexture == null && !this.mExpandedBounds.isEmpty() && !TextUtils.isEmpty(this.mTextToDraw)) {
calculateOffsets(0.0f);
this.mTextureAscent = this.mTextPaint.ascent();
this.mTextureDescent = this.mTextPaint.descent();
int w = Math.round(this.mTextPaint.measureText(this.mTextToDraw, 0, this.mTextToDraw.length()));
int h = Math.round(this.mTextureDescent - this.mTextureAscent);
if (w > 0 && h > 0) {
this.mExpandedTitleTexture = Bitmap.createBitmap(w, h, Config.ARGB_8888);
new Canvas(this.mExpandedTitleTexture).drawText(this.mTextToDraw, 0, this.mTextToDraw.length(), 0.0f, ((float) h) - this.mTextPaint.descent(), this.mTextPaint);
if (this.mTexturePaint == null) {
this.mTexturePaint = new Paint(3);
}
}
}
}
CollapsingTextHelper.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:boohee_v5.6
作者:
评论列表
文章目录