android.widget.GridView.dispatchDraw()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(131)

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

GridView.dispatchDraw介绍

暂无

代码示例

代码示例来源:origin: TonicArtos/StickyGridHeaders

super.dispatchDraw(canvas);

代码示例来源:origin: UweTrottmann/SeriesGuide

super.dispatchDraw(canvas);

代码示例来源:origin: WeAreFairphone/FP2-Launcher

@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: macdidi5/Android-Things-Tutorial

@Override
protected void dispatchDraw(Canvas canvas) {
  super.dispatchDraw(canvas);
  if (mHoverCell != null) {
    mHoverCell.draw(canvas);
  }
}

代码示例来源:origin: julesbond007/android-jigsaw-puzzle

@Override
protected void dispatchDraw(@NonNull Canvas canvas) {
  super.dispatchDraw(canvas);
  if (mHoverCell != null) {
    mHoverCell.draw(canvas);
  }
}

代码示例来源:origin: q805699513/PhotoPicker

@Override
protected void dispatchDraw(Canvas canvas){
  super.dispatchDraw(canvas);
  View localView1 = getChildAt(0);
  int column = getWidth() / localView1.getWidth();
  int childCount = getChildCount();
  Paint localPaint;
  localPaint = new Paint();
  localPaint.setStyle(Paint.Style.STROKE);
  localPaint.setColor(getContext().getResources().getColor(R.color.view_color));
  for(int i = 0;i < childCount;i++){
    View cellView = getChildAt(i);
    if((i + 1) % column == 0){
      canvas.drawLine(cellView.getLeft(), cellView.getBottom(), cellView.getRight(), cellView.getBottom(), localPaint);
    }else if((i + 1) > (childCount - (childCount % column))){
      canvas.drawLine(cellView.getRight(), cellView.getTop(), cellView.getRight(), cellView.getBottom(), localPaint);
    }else{
        canvas.drawLine(cellView.getRight(), cellView.getTop(), cellView.getRight(), cellView.getBottom(), localPaint);
        canvas.drawLine(cellView.getLeft(), cellView.getBottom(), cellView.getRight(), cellView.getBottom(), localPaint);
    }
  }
  if(childCount % column != 0){
    for(int j = 0 ;j < (column-childCount % column) ; j++){
      View lastView = getChildAt(childCount - 1);
      canvas.drawLine(lastView.getRight() + lastView.getWidth() * j, lastView.getTop(), lastView.getRight() + lastView.getWidth()* j, lastView.getBottom(), localPaint);
    }
  }
}

代码示例来源:origin: PrivacyApps/document-viewer

@Override
protected void dispatchDraw(final Canvas canvas) {
  final int count = getChildCount();
  int top = count > 0 ? getChildAt(0).getTop() : 0;
  final int shelfWidth = mShelfWidth;
  final int shelfHeight = mShelfHeight;
  final int width = getWidth();
  final int height = getHeight();
  for (int y = top; y < height; y += shelfHeight) {
    for (int x = 0; x < width; x += shelfWidth) {
      canvas.drawBitmap(mShelfBackground, x, y, null);
    }
    canvas.drawBitmap(mShelfBackgroundLeft, 0, y, null);
    canvas.drawBitmap(mShelfBackgroundRight, width - 15, y, null);
  }
  top = (count > 0) ? getChildAt(count - 1).getTop() + shelfHeight : 0;
  drawDecorations(canvas, top, shelfHeight, width);
  super.dispatchDraw(canvas);
}

代码示例来源:origin: canqihe/TmallSale

super.dispatchDraw(canvas);

代码示例来源:origin: qq8585083/DragIcon

super.dispatchDraw(canvas);

代码示例来源:origin: AlexMofer/ProjectX

super.dispatchDraw(canvas);

相关文章

GridView类方法