android.widget.ListView.draw()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中android.widget.ListView.draw()方法的一些代码示例,展示了ListView.draw()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.draw()方法的具体详情如下:
包路径:android.widget.ListView
类名称:ListView
方法名:draw

ListView.draw介绍

暂无

代码示例

代码示例来源:origin: seven332/EhViewer

@Override
  public void draw(@NonNull Canvas canvas) {
    super.draw(canvas);

    final int restoreCount = canvas.save();
    canvas.translate(getScrollX(), getScrollY());

    // Draw top indicator
    if (needShowTopIndicator()) {
      fillTopIndicatorDrawRect();
      canvas.drawRect(mTemp, mPaint);
    }
    // Draw bottom indicator
    if (needShowBottomIndicator()) {
      fillBottomIndicatorDrawRect();
      canvas.drawRect(mTemp, mPaint);
    }

    canvas.restoreToCount(restoreCount);
  }
}

代码示例来源:origin: zzz40500/ThemeDemo

@Override
public void superDraw(Canvas canvas) {
  super.draw(canvas);
}

代码示例来源:origin: com.albedinsky.android.support/support-dialogs-collection

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  mEdgeShadowHelper.drawShadows(canvas);
}

代码示例来源:origin: com.albedinsky.android.support/support-dialogs

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  mEdgeShadowHelper.drawShadows(canvas);
}

代码示例来源:origin: com.albedinsky.android.support/support-dialogs-collection-base

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  mEdgeShadowHelper.drawShadows(canvas);
}

代码示例来源:origin: com.albedinsky.android/dialogs-collection-base

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  mEdgeShadowHelper.drawShadows(canvas);
}

代码示例来源:origin: com.albedinsky.android/dialogs-collection

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  mEdgeShadowHelper.drawShadows(canvas);
}

代码示例来源:origin: com.albedinsky.android/dialogs

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  mEdgeShadowHelper.drawShadows(canvas);
}

代码示例来源:origin: mtotschnig/MyExpenses

@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  if (mSticky != null) {
    final int saveCount = canvas.save();
    // The view to draw when sticking to the top
    final View drawTarget = mStickyContainer != null ? mStickyContainer : mSticky;
    // The offset to draw the view at when sticky
    final int drawOffset = mStickyContainer != null ? mSticky.getTop() : 0;
    // Position of the draw target, relative to the outside of the scrollView
    final int drawTop = drawTarget.getTop();
    if (drawTop + drawOffset < mStatusBarInset || !drawTarget.isShown()) {
      // ListView does not translate the canvas, so we can simply draw at the top
      mStickyRect.set(0, -drawOffset + mStatusBarInset, drawTarget.getWidth(),
          drawTarget.getHeight() - drawOffset + mStatusBarInset);
      canvas.translate(0, mStickyRect.top);
      canvas.clipRect(0, 0, drawTarget.getWidth(), drawTarget.getHeight());
      drawTarget.draw(canvas);
    } else {
      mStickyRect.setEmpty();
    }
    canvas.restoreToCount(saveCount);
  }
}

代码示例来源:origin: com.albedinsky.android/ui-widget-collection

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  this.ensureDecorator();
  mDecorator.draw(canvas);
}

代码示例来源:origin: com.albedinsky.android/ui

/**
 */
@Override
public void draw(Canvas canvas) {
  super.draw(canvas);
  this.ensureDecorator();
  mDecorator.draw(canvas);
}

代码示例来源:origin: luhaoaimama1/zone-sdk

/**
   * 截图listview
   **/
  public static Bitmap getBitmapByListView(ListView listView) {
    int h = 0;
    Bitmap bitmap = null;
    // 获取listView实际高度
    for (int i = 0; i < listView.getChildCount(); i++) {
      h += listView.getChildAt(i).getHeight();
    }
    Log.d(TAG, "实际高度:" + h);
    Log.d(TAG, "list 高度:" + listView.getHeight());
    // 创建对应大小的bitmap
    bitmap = Bitmap.createBitmap(listView.getWidth(), h,
        Bitmap.Config.ARGB_8888);
    final Canvas canvas = new Canvas(bitmap);
    listView.draw(canvas);
    return bitmap;
  }
}

代码示例来源:origin: 18Gray/CommonUtils

/**
 * ListView截屏
 * @param listView
 * @param activity
 * @param fileName
 * @return
 */
public static Bitmap screenShotListView(ListView listView, Activity activity, String fileName)
{
  int h = 0;
  Bitmap bitmap = null;
  // 获取listView实际高度
  for (int i = 0; i < listView.getChildCount(); i++)
  {
    h += listView.getChildAt(i).getHeight();
  }
  // 创建对应大小的bitmap
  bitmap = Bitmap.createBitmap(listView.getWidth(), h, Config.ARGB_8888);
  final Canvas canvas = new Canvas(bitmap);
  listView.draw(canvas);
  return bitmap;
}

相关文章

ListView类方法