本文整理了Java中android.widget.ListView.dispatchDraw()
方法的一些代码示例,展示了ListView.dispatchDraw()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.dispatchDraw()
方法的具体详情如下:
包路径:android.widget.ListView
类名称:ListView
方法名:dispatchDraw
暂无
代码示例来源:origin: rey5137/material
@Override
protected void dispatchDraw(Canvas canvas) {
final boolean drawSelectorOnTop = false;
if (!drawSelectorOnTop) {
drawSelectorCompat(canvas);
}
super.dispatchDraw(canvas);
}
@Override
代码示例来源:origin: beworker/pinned-section-listview
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (mPinnedSection != null) {
// prepare variables
int pLeft = getListPaddingLeft();
int pTop = getListPaddingTop();
View view = mPinnedSection.view;
// draw child
canvas.save();
int clipHeight = view.getHeight() +
(mShadowDrawable == null ? 0 : Math.min(mShadowHeight, mSectionsDistanceY));
canvas.clipRect(pLeft, pTop, pLeft + view.getWidth(), pTop + clipHeight);
canvas.translate(pLeft, pTop + mTranslateY);
drawChild(canvas, mPinnedSection.view, getDrawingTime());
if (mShadowDrawable != null && mSectionsDistanceY > 0) {
mShadowDrawable.setBounds(mPinnedSection.view.getLeft(),
mPinnedSection.view.getBottom(),
mPinnedSection.view.getRight(),
mPinnedSection.view.getBottom() + mShadowHeight);
mShadowDrawable.draw(canvas);
}
canvas.restore();
}
}
代码示例来源:origin: novoda/android-demos
/**
* Draws an extra divider at the top and bottom of the list.
*/
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
Drawable divider = getDivider();
if (divider == null) {
return;
}
Rect bounds = new Rect();
bounds.left = getPaddingLeft();
bounds.right = getRight() - getLeft() - getPaddingRight();
// Top.
bounds.top = getPaddingTop();
bounds.bottom = getPaddingTop() + getDividerHeight();
divider.setBounds(bounds);
divider.draw(canvas);
// Bottom.
bounds.top = getBottom() - getTop() - getPaddingBottom() - getDividerHeight();
bounds.bottom = getBottom() - getTop() - getPaddingBottom();
divider.setBounds(bounds);
divider.draw(canvas);
}
}
代码示例来源:origin: tianshaojie/AndroidFine
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it
* when using Header/Footer Views and the list is empty. This masks
* the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
代码示例来源:origin: huxq17/XRefreshView
@Override
protected void dispatchDraw(Canvas canvas) {
positionSelectorRect();
if (mTopClippingLength != 0) {
canvas.save();
Rect clipping = canvas.getClipBounds();
clipping.top = mTopClippingLength;
canvas.clipRect(clipping);
super.dispatchDraw(canvas);
canvas.restore();
} else {
super.dispatchDraw(canvas);
}
mLifeCycleListener.onDispatchDrawOccurred(canvas);
}
代码示例来源:origin: UweTrottmann/SeriesGuide
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
代码示例来源:origin: Dawish/BriskTVLauncher
/**
* 崩溃了.
*/
@Override
protected void dispatchDraw(Canvas canvas) {
try {
super.dispatchDraw(canvas);
} catch (Exception e) {
e.printStackTrace();
}
}
代码示例来源:origin: 1993hzw/Androids
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
// 绘制拖拽的itemView
if (mBitmap != null && !mBitmap.isRecycled()) {
canvas.drawBitmap(mBitmap, 0, mLastY - mDragViewOffset, null);
}
}
代码示例来源:origin: gdpancheng/LoonAndroid3
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it when using Header/Footer Views and the list is empty. This masks the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
代码示例来源:origin: TobiasBielefeld/Simple-Solitaire
/**
* dispatchDraw gets invoked when all the child views are about to be drawn.
* By overriding this method, the hover cell (BitmapDrawable) can be drawn
* over the listview's items whenever the listview is redrawn.
*/
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (mHoverCell != null) {
mHoverCell.draw(canvas);
}
}
代码示例来源:origin: xbmc/Kore
/**
* dispatchDraw gets invoked when all the child views are about to be drawn.
* By overriding this method, the hover cell (BitmapDrawable) can be drawn
* over the listview's items whenever the listview is redrawn.
*/
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (mHoverCell != null) {
mHoverCell.draw(canvas);
}
}
代码示例来源:origin: Catrobat/Paintroid
@Override
public void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (hoveringListItem != null) {
hoveringListItem.draw(canvas);
}
}
代码示例来源:origin: com.nhaarman.listviewanimations/lib-manipulation
@Override
protected void dispatchDraw(@NonNull final Canvas canvas) {
super.dispatchDraw(canvas);
if (mDragAndDropHandler != null) {
mDragAndDropHandler.dispatchDraw(canvas);
}
}
代码示例来源:origin: huangfangyi/FanXin
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it
* when using Header/Footer Views and the list is empty. This masks
* the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
代码示例来源:origin: shanyao0/SimpleApp
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it
* when using Header/Footer Views and the list is empty. This masks
* the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
代码示例来源:origin: myxh/CoolShopping
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it
* when using Header/Footer Views and the list is empty. This masks
* the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
代码示例来源:origin: wjie2014/DoubleListViewLinkage
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (mAdapter == null || !mShouldPin || mCurrentHeader == null)
return;
int saveCount = canvas.save();
canvas.translate(0, mHeaderOffset);
canvas.clipRect(0, 0, getWidth(), mCurrentHeader.getMeasuredHeight()); // needed
// for
// <
// HONEYCOMB
mCurrentHeader.draw(canvas);
canvas.restoreToCount(saveCount);
}
代码示例来源:origin: AndroidHensen/YaNi
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it
* when using Header/Footer Views and the list is empty. This masks
* the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
代码示例来源:origin: alienjun/AJWaveRefreshForAndroid
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it
* when using Header/Footer Views and the list is empty. This masks
* the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
代码示例来源:origin: open-android/PullToRefresh
@Override
protected void dispatchDraw(Canvas canvas) {
/**
* This is a bit hacky, but Samsung's ListView has got a bug in it
* when using Header/Footer Views and the list is empty. This masks
* the issue so that it doesn't cause an FC. See Issue #66.
*/
try {
super.dispatchDraw(canvas);
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
内容来源于网络,如有侵权,请联系作者删除!