@Override
    public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
      super.onScrolled(recyclerView, dx, dy);

      int childCount = recyclerView.getChildCount();
      int width = recyclerView.getChildAt(0).getWidth();
      int padding = (recyclerView.getWidth() - width) / 2;

      for (int i = 0; i < childCount; i++) {
        View view = recyclerView.getChildAt(i);

        float ratio = 0;

        if (view.getLeft() <= padding) {
          if (view.getLeft() >= padding - view.getWidth()) {
            ratio = (padding - view.getLeft()) * 1f / view.getWidth();
          } else {
            ratio = 1;
          }
          view.setScaleY(1 - ratio * 0.5f);
          view.setScaleX(1 - ratio * 0.5f);

        } else {

          if (view.getLeft() <= recyclerView.getWidth() - padding) {
            ratio = (recyclerView.getWidth() - padding - view.getLeft()) * 1f / view.getWidth();
          }
          view.setScaleY(0.5f + ratio * 0.5f);
          view.setScaleX(0.5f + ratio * 0.5f);
        }
      }
    }
  @Override
  public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
    if (mDivider == null) {
      super.onDrawOver(c, parent, state);
      return;
    }

    // Initialization needed to avoid compiler warning
    int left = 0, right = 0, top = 0, bottom = 0, size;
    int orientation = mOrientation != -1 ? mOrientation : getOrientation(parent);
    int childCount = parent.getChildCount();

    if (orientation == LinearLayoutManager.VERTICAL) {
      size = mDivider.getIntrinsicHeight();
      left = parent.getPaddingLeft();
      right = parent.getWidth() - parent.getPaddingRight();
    } else { // horizontal
      size = mDivider.getIntrinsicWidth();
      top = parent.getPaddingTop();
      bottom = parent.getHeight() - parent.getPaddingBottom();
    }

    for (int i = mShowFirstDivider ? 0 : 1; i < childCount; i++) {
      View child = parent.getChildAt(i);
      RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();

      if (orientation == LinearLayoutManager.VERTICAL) {
        top = child.getTop() - params.topMargin - size;
        bottom = top + size;
      } else { // horizontal
        left = child.getLeft() - params.leftMargin;
        right = left + size;
      }
      mDivider.setBounds(left, top, right, bottom);
      mDivider.draw(c);
    }

    // show last divider
    if (mShowLastDivider && childCount > 0) {
      View child = parent.getChildAt(childCount - 1);
      if (parent.getChildAdapterPosition(child) == (state.getItemCount() - 1)) {
        RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        if (orientation == LinearLayoutManager.VERTICAL) {
          top = child.getBottom() + params.bottomMargin;
          bottom = top + size;
        } else { // horizontal
          left = child.getRight() + params.rightMargin;
          right = left + size;
        }
        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);
      }
    }
  }
  private void selectShade(int position) {
    ImageView shellSelected;

    for (int i = 0; i < shadeAdapter.getItemCount(); i++) {
      if (recyclerView.getChildAt(i) != null) {
        shellSelected = ((ImageView) recyclerView.getChildAt(i).findViewById(R.id.shell_selected));
        if (shellSelected.getVisibility() == View.VISIBLE) {
          shellSelected.setVisibility(View.GONE);
        }
      }
    }

    GridLayoutManager layoutManager = (GridLayoutManager) recyclerView.getLayoutManager();

    if (getSelectionMode() == SelectionModeEnum.SINGLE_SELECTION_MODE) {

      View view = recyclerView.getChildAt(position - layoutManager.findFirstVisibleItemPosition());

      if (shadeAdapter.getSelectedShade() == position) {
        shadeAdapter.setSelectedShade(-1);

        view.findViewById(R.id.shell_selected).setVisibility(View.INVISIBLE);

      } else {
        shadeAdapter.setSelectedShade(position);

        view.findViewById(R.id.shell_selected).setVisibility(View.VISIBLE);
      }

    } else if (getSelectionMode() == SelectionModeEnum.MULTIPLE_SELECTION_MODE) {

      if (selected.contains(position)) {
        selected.remove((Integer) position);

      } else {
        selected.add(position);
      }

      shadeAdapter.setSelected(selected);

      for (int item : shadeAdapter.getSelected()) {

        if (item >= layoutManager.findFirstVisibleItemPosition()
            && item <= layoutManager.findLastVisibleItemPosition()) {

          View view = recyclerView.getChildAt(item - layoutManager.findFirstVisibleItemPosition());
          view.findViewById(R.id.shell_selected).setVisibility(View.VISIBLE);
        }
      }
    }
  }
Exemple #4
0
 public void saveScrollPosition() {
   if (crumb == null) return;
   crumb.setScrollPosition(
       ((GridLayoutManager) mRecyclerView.getLayoutManager()).findFirstVisibleItemPosition());
   final View firstChild = mRecyclerView.getChildAt(0);
   if (firstChild != null) crumb.setScrollOffset((int) firstChild.getY());
 }
        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
          if (dy == 0 || recyclerView.getChildCount() <= 0) return;

          LinearLayoutManager linearLayoutManager =
              (LinearLayoutManager) recyclerView.getLayoutManager();
          int firstVisibleItem = linearLayoutManager.findFirstVisibleItemPosition();
          int lastVisibleItem = linearLayoutManager.findLastVisibleItemPosition();
          int visibleItemCount = lastVisibleItem - firstVisibleItem;
          int totalItemCount = recyclerView.getAdapter().getItemCount();

          NewsListRecyclerAdapter adapter = (NewsListRecyclerAdapter) recyclerView.getAdapter();

          // Set the item at top to read
          ViewHolder vh =
              (ViewHolder) recyclerView.findViewHolderForLayoutPosition(firstVisibleItem);
          if (vh != null && !vh.shouldStayUnread()) {
            adapter.ChangeReadStateOfItem(vh, true);
          }

          // Check if Listview is scrolled to bottom
          if (lastVisibleItem == (totalItemCount - 1)
              && recyclerView.getChildAt(visibleItemCount).getBottom()
                  <= recyclerView.getHeight()) {
            for (int i = firstVisibleItem + 1; i <= lastVisibleItem; i++) {
              vh = (ViewHolder) recyclerView.findViewHolderForLayoutPosition(i);
              if (vh != null && !vh.shouldStayUnread()) {
                adapter.ChangeReadStateOfItem(vh, true);
              }
            }
          }
        }
 public final void onDraw$13fcd2ff(Canvas paramCanvas, RecyclerView paramRecyclerView) {
   this.mCardStackBoundsRect.setEmpty();
   int i = paramRecyclerView.getChildCount();
   for (int j = 0; j < i; j++) {
     View localView = paramRecyclerView.getChildAt(j);
     if ((localView instanceof CardSection)) {
       boolean bool = localView instanceof DetailsPeekingSection;
       int k = 0;
       if (bool) {
         k = ((DetailsPeekingSection) localView).getTopPeekAmount();
       }
       this.mCardStackBoundsRect.union(
           localView.getLeft(),
           k + localView.getTop(),
           localView.getRight(),
           localView.getBottom());
     }
   }
   if (this.mCardStackBoundsRect.isEmpty()) {
     return;
   }
   Rect localRect1 = this.mCardStackBoundsRect;
   localRect1.left -= this.mVerticalPadding;
   Rect localRect2 = this.mCardStackBoundsRect;
   localRect2.top -= this.mVerticalPadding;
   Rect localRect3 = this.mCardStackBoundsRect;
   localRect3.right += this.mVerticalPadding;
   Rect localRect4 = this.mCardStackBoundsRect;
   localRect4.bottom += this.mVerticalPadding;
   this.mCardDrawable.setBounds(this.mCardStackBoundsRect);
   this.mCardDrawable.draw(paramCanvas);
 }
  private static View findRangeLastItem(
      RecyclerView rv,
      ItemDraggableRange range,
      int firstVisiblePosition,
      int lastVisiblePosition) {
    if (firstVisiblePosition == RecyclerView.NO_POSITION
        || lastVisiblePosition == RecyclerView.NO_POSITION) {
      return null;
    }

    View v = null;

    final int childCount = rv.getChildCount();
    for (int i = childCount - 1; i >= 0; i--) {
      final View v2 = rv.getChildAt(i);
      final RecyclerView.ViewHolder vh = rv.getChildViewHolder(v2);

      if (vh != null) {
        final int position = vh.getLayoutPosition();

        if ((position >= firstVisiblePosition)
            && (position <= lastVisiblePosition)
            && range.checkInRange(position)) {
          v = v2;
          break;
        }
      }
    }

    return v;
  }
  private CustomEngine getData() {
    CustomEngine data = new CustomEngine();
    data.setName(mEditTextName.getText().toString());
    data.setUpload_url(mEditTextUrl.getText().toString());
    data.setPost_file_key(mEditTextFileKey.getText().toString());
    data.setResult_open_action(mSpinner.getSelectedItemPosition());

    if (!URLUtil.isNetworkUrl(data.getUpload_url())) {
      data.setUpload_url("http://" + data.getUpload_url());
    }

    data.post_text_key.clear();
    data.post_text_value.clear();
    data.post_text_type.clear();

    for (int i = 0; i < mRecyclerView.getChildCount(); i++) {
      View view = mRecyclerView.getChildAt(i);
      if (view == null) continue;
      EditText key = (EditText) view.findViewById(R.id.editText_key);
      EditText value = (EditText) view.findViewById(R.id.editText_value);
      if (key != null && value != null) {
        data.post_text_key.add(key.getEditableText().toString());
        data.post_text_value.add(value.getEditableText().toString());
        data.post_text_type.add(0);
      }
    }
    return data;
  }
 private void updateOnScreenCheckedViews() {
   final int count = mRecyclerView.getChildCount();
   for (int i = 0; i < count; i++) {
     final View child = mRecyclerView.getChildAt(i);
     final int position = mRecyclerView.getChildPosition(child);
     setViewChecked(child, mCheckedStates.get(position));
   }
 }
  @Override
  public void onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
    int left = parent.getPaddingLeft();
    int right = parent.getWidth() - parent.getPaddingRight();
    int top = parent.getPaddingTop();
    int bottom = parent.getHeight() - parent.getPaddingBottom();

    int orientation = getOrientation(parent);
    int childCount = parent.getChildCount();

    for (int i = showFirstDivider ? 0 : 1; i < childCount; i++) {
      View child = parent.getChildAt(i);
      RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();

      if (orientation == LinearLayoutManager.VERTICAL) {
        top = child.getTop() - params.topMargin;
        bottom = top - (size / 2);

        canvas.drawLine(left, bottom, right, bottom, paint);
      } else {
        left = child.getLeft() - params.leftMargin;
        right = left - (size / 2);

        canvas.drawLine(right, top, right, bottom, paint);
      }
    }

    if (showLastDivider && childCount > 0) {
      View child = parent.getChildAt(childCount - 1);
      RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();

      if (orientation == LinearLayoutManager.VERTICAL) {
        top = child.getBottom() + params.bottomMargin;
        bottom = top + size;

        canvas.drawLine(left, bottom, right, bottom, paint);
      } else {
        left = child.getRight() + params.rightMargin;
        right = left + (size / 2);

        canvas.drawLine(right, top, right, bottom, paint);
      }
    }
  }
Exemple #11
0
 public void setOverScrollDistance(int overScrollDistance) {
   this.overScrollDistance = overScrollDistance;
   if (recyclerView != null) {
     checkBindDataChange();
     //      recyclerView.setTranslationY(overScrollDistance);
     for (int i = 0, count = recyclerView.getChildCount(); i < count; i++) {
       recyclerView.getChildAt(i).setTranslationY(overScrollDistance);
     }
   }
 }
Exemple #12
0
  private void appendComment(BotAdapter.Type type, String comment) {

    botAdapter.addItem(type, comment);
    botAdapter.setAnimationsLocked(false);
    botAdapter.setDelayEnterAnimation(false);

    if (rvComments.getChildCount() > 0) {
      rvComments.smoothScrollBy(
          0, rvComments.getChildAt(0).getHeight() * botAdapter.getItemCount());
    }
  }
Exemple #13
0
 /** Get center child in Y Axes */
 public static View getCenterYChild(RecyclerView recyclerView) {
   int childCount = recyclerView.getChildCount();
   if (childCount > 0) {
     for (int i = 0; i < childCount; i++) {
       View child = recyclerView.getChildAt(i);
       if (isChildInCenterY(recyclerView, child)) {
         return child;
       }
     }
   }
   return null;
 }
Exemple #14
0
 /** Get position of center child in Y Axes */
 public static int getCenterYChildPosition(RecyclerView recyclerView) {
   int childCount = recyclerView.getChildCount();
   if (childCount > 0) {
     for (int i = 0; i < childCount; i++) {
       View child = recyclerView.getChildAt(i);
       if (isChildInCenterY(recyclerView, child)) {
         return recyclerView.getChildAdapterPosition(child);
       }
     }
   }
   return childCount;
 }
Exemple #15
0
 // gets item at a specific point
 public static View getItemAtPoint(RecyclerView recyclerView, float x, float y) {
   int childCount = recyclerView.getChildCount();
   if (childCount > 0) {
     for (int i = 0; i < childCount; i++) {
       View child = recyclerView.getChildAt(i);
       if (isItemAtPoint(child, x, y)) {
         return child;
       }
     }
   }
   return null;
 }
 /**
  * 绘制横向 item 分割线
  *
  * @param canvas
  * @param parent
  */
 private void drawHorizontal(Canvas canvas, RecyclerView parent) {
   final int top = parent.getPaddingTop();
   final int bottom = parent.getMeasuredHeight() - parent.getPaddingBottom();
   final int childSize = parent.getChildCount();
   for (int i = 0; i < childSize; i++) {
     final View child = parent.getChildAt(i);
     RecyclerView.LayoutParams layoutParams =
         (RecyclerView.LayoutParams) child.getLayoutParams();
     final int left = child.getRight() + layoutParams.rightMargin;
     final int right = left + mItemSize;
     canvas.drawRect(left, top, right, bottom, mPaint);
   }
 }
 public void drawHorizontal(Canvas c, RecyclerView parent) {
   final int top = parent.getPaddingTop();
   final int bottom = parent.getHeight() - parent.getPaddingBottom();
   final int childCount = parent.getChildCount();
   for (int i = 0; i < childCount; i++) {
     final View child = parent.getChildAt(i);
     final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
     final int left = child.getRight() + params.rightMargin;
     final int right = left + mDivider.getIntrinsicHeight();
     mDivider.setBounds(left, top, right, bottom);
     mDivider.draw(c);
   }
 }
 /**
  * 绘制垂直方向的分割线
  *
  * @param c
  * @param parent
  */
 private void drawVDeraction(Canvas c, RecyclerView parent) {
   int top = parent.getPaddingTop();
   int bottom = parent.getHeight() - parent.getPaddingBottom();
   int childCount = parent.getChildCount();
   for (int i = 0; i < childCount; i++) {
     View child = parent.getChildAt(i);
     RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) child.getLayoutParams();
     int left = child.getRight() + layoutParams.rightMargin;
     int right = left + mDivider.getIntrinsicWidth();
     mDivider.setBounds(left, top, right, bottom);
     mDivider.draw(c);
   }
 }
 public void drawVertical(Canvas c, RecyclerView parent) {
   final int left = parent.getPaddingLeft();
   final int right = parent.getWidth() - parent.getPaddingRight();
   final int childCount = parent.getChildCount();
   for (int i = 0; i < childCount; i++) {
     final View child = parent.getChildAt(i);
     final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
     final int top = child.getBottom() + params.bottomMargin;
     final int bottom = top + mDivider.getIntrinsicHeight();
     mDivider.setBounds(left, top, right, bottom);
     mDivider.draw(c);
   }
 }
 /**
  * 绘制纵向 item 分割线
  *
  * @param canvas
  * @param parent
  */
 private void drawVertical(Canvas canvas, RecyclerView parent) {
   final int left = parent.getPaddingLeft();
   final int right = parent.getMeasuredWidth() - parent.getPaddingRight();
   final int childSize = parent.getChildCount();
   // linearLayoutManager.findFirstVisibleItemPosition();
   for (int i = 0; i < childSize; i++) {
     final View child = parent.getChildAt(i);
     RecyclerView.LayoutParams layoutParams =
         (RecyclerView.LayoutParams) child.getLayoutParams();
     final int top = child.getBottom() + layoutParams.bottomMargin;
     final int bottom = top + mItemSize;
     canvas.drawRect(left, top, right, bottom, mPaint);
   }
 }
  // 垂直分割线
  private void drawVertical(Canvas canvas, RecyclerView parent) {
    int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
      View child = parent.getChildAt(i);
      RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) child.getLayoutParams();
      int left = child.getRight() + layoutParams.rightMargin;
      int right = left + height;
      int top = child.getTop() - layoutParams.topMargin;
      int bottom = child.getBottom() + layoutParams.bottomMargin;

      drawable.setBounds(left, top, right, bottom);
      drawable.draw(canvas);
    }
  }
  @Override
  public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
    int left = parent.getPaddingLeft();
    int right = parent.getRight() - parent.getPaddingRight();

    for (int i = 0; i < parent.getChildCount(); i++) {
      View child = parent.getChildAt(i);
      RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
      int top = child.getBottom() + params.bottomMargin;
      int bottom = top + divider.getIntrinsicHeight();

      divider.setBounds(left, top, right, bottom);
      divider.draw(c);
    }
  }
  private void drawHorizontal(Canvas canvas, RecyclerView parent) {
    final int top = parent.getPaddingTop();
    final int bottom = parent.getHeight() - parent.getPaddingBottom();
    final int childCount = parent.getChildCount();

    for (int i = 1; i < childCount; i++) {
      final View child = parent.getChildAt(i);
      final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
      final int size = mDivider.getIntrinsicWidth();
      final int left = child.getLeft() - params.leftMargin;
      final int right = left + size;
      mDivider.setBounds(left, top, right, bottom);
      mDivider.draw(canvas);
    }
  }
  @Override
  public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
    int left = parent.getPaddingLeft();
    int right = parent.getWidth() - parent.getPaddingRight();

    int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
      View child = parent.getChildAt(i);

      RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
      int top = child.getBottom() + params.bottomMargin;
      int bottom = top + 1;

      c.drawRect(left, top, right, bottom, mPaint);
    }
  }
  public void drawHorizontal(@NonNull Canvas c, @NonNull RecyclerView parent) {
    final int top = parent.getPaddingTop();
    final int bottom = parent.getHeight() - parent.getPaddingBottom();
    final int childCount = parent.getChildCount();

    IntStream.range(0, childCount)
        .forEach(
            i -> {
              final View child = parent.getChildAt(i);
              final RecyclerView.LayoutParams params =
                  (RecyclerView.LayoutParams) child.getLayoutParams();
              final int left = child.getRight() + params.rightMargin;
              final int right = left + mDivider.getIntrinsicHeight();
              mDivider.setBounds(left, top, right, bottom);
              mDivider.draw(c);
            });
  }
  @Override
  public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
    super.onDraw(c, parent, state);

    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
      final View child = parent.getChildAt(i);
      RecyclerView v = new RecyclerView(parent.getContext());
      final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
      final int top = child.getBottom() + params.bottomMargin;
      final int bottom = top + mDivider.getIntrinsicHeight();
      mDivider.setBounds(left, top, right, bottom);
      mDivider.draw(c);
    }
  }
 @Override
 public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
   super.onDraw(c, parent, state);
   // layout basically just gets drawn on the reserved space on top of the first view
   mLayout.layout(parent.getLeft(), 0, parent.getRight(), mLayout.getMeasuredHeight());
   for (int i = 0; i < parent.getChildCount(); i++) {
     View view = parent.getChildAt(i);
     if (parent.getChildAdapterPosition(view) == 0) {
       c.save();
       final int height = mLayout.getMeasuredHeight();
       final int top = view.getTop() - height;
       c.translate(0, top);
       mLayout.draw(c);
       c.restore();
       break;
     }
   }
 }
  public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
      final View child = parent.getChildAt(i);
      // 有脚部时,最后一条不画
      if (hasFooter
          && parent.getChildLayoutPosition(child) == parent.getLayoutManager().getItemCount() - 1) {
        continue;
      }
      final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
      final int top = child.getBottom() + params.bottomMargin;
      final int bottom = top + mDivider.getIntrinsicHeight();
      mDivider.setBounds(left, top, right, bottom);
      mDivider.draw(c);
    }
  }
Exemple #29
0
 public static View getFirstIntersectsChild(RecyclerView recyclerView) {
   int childCount = recyclerView.getChildCount();
   if (childCount > 0) {
     for (int i = 0; i < childCount; i++) {
       View child = recyclerView.getChildAt(i);
       Rect rect1 =
           new Rect(
               recyclerView.getLeft(),
               recyclerView.getTop(),
               recyclerView.getRight(),
               recyclerView.getBottom());
       Rect rect2 = new Rect(child.getLeft(), child.getTop(), child.getRight(), child.getBottom());
       if (Rect.intersects(rect1, rect2)) {
         return child;
       }
     }
   }
   return null;
 }
 @Override
 public void onDrawLoadMore(Canvas c, RecyclerView parent) {
   super.onDrawLoadMore(c, parent);
   mProgress = mProgress + 5;
   if (mProgress == 100) {
     mProgress = 0;
   }
   final int left = parent.getPaddingLeft();
   final int right = parent.getMeasuredWidth() - parent.getPaddingRight();
   final int childSize = parent.getChildCount();
   final View child = parent.getChildAt(childSize - 1);
   RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) child.getLayoutParams();
   final int top = child.getBottom() + layoutParams.bottomMargin;
   final int bottom = top + getLoadMorePadding() / 2;
   paint.setAntiAlias(true); // 抗锯齿
   paint.setFlags(Paint.ANTI_ALIAS_FLAG); // 增强消除锯齿
   paint.setColor(Color.GRAY); // 画笔为灰色
   paint.setStrokeWidth(10); // 画笔宽度
   paint.setStyle(Paint.Style.STROKE); // 中空
   c.drawCircle(
       (right - left) / 2 - mCircleOffset,
       bottom,
       mCircleSize,
       paint); // 在中心为((right - left)/2,bottom)的地方画个半径为mCircleSize的圆,
   paint.setColor(Color.GREEN); // 设置画笔为绿色
   oval.set(
       (right - left) / 2 - mCircleOffset - mCircleSize,
       bottom - mCircleSize,
       (right - left) / 2 - mCircleOffset + mCircleSize,
       bottom + mCircleSize); // 在Circle小于圈圈大小的地方画圆,这样也就保证了半径为mCircleSize
   c.drawArc(
       oval,
       -90,
       ((float) mProgress / 100) * 360,
       false,
       paint); // 圆弧,第二个参数为:起始角度,第三个为跨的角度,第四个为true的时候是实心,false的时候为空心
   paint.reset(); // 将画笔重置
   paint.setStrokeWidth(3); // 再次设置画笔的宽度
   paint.setTextSize(40); // 设置文字的大小
   paint.setColor(Color.BLACK); // 设置画笔颜色
   c.drawText(getLoadmoreString(), (right - left) / 2, bottom + 10, paint);
 }