RadarAnimationView.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:RadarAnimationView 作者:
private void configurePaintParams() {
  int delta = (numberOfRings * outerRingsSpacingPx + innerRingRadiousPx * 2) / 2;
  radarShadowBoundsRectF =
      new RectF(viewWidth / 2 - delta, viewHeight / 2 - delta, viewWidth / 2 + delta,
          viewHeight / 2 + delta);

  innerLoadingViewBoundsRecF =
      new RectF(viewWidth / 2 - innerRingRadiousPx, viewHeight / 2 - innerRingRadiousPx,
          viewWidth / 2 + innerRingRadiousPx, viewHeight / 2 + innerRingRadiousPx);

  int colors[] = {
      Color.parseColor("#b5615e"), Color.parseColor("#b5a15c"), Color.parseColor("#93bb5c"),
      Color.parseColor("#b5615e")
  };
  float[] positions = { 0f, .25f, .50f, .95f };
  innerLoadingGradientPaint.setShader(
      new SweepGradient(viewWidth / 2, viewHeight / 2, colors, positions));

  shadowPaint.setShadowLayer(10.0f, 0.0f, 2.0f, Color.BLACK);

  int colors2[] = { Color.TRANSPARENT, Color.GRAY };
  float[] positions2 = { 0f, .90f, };
  radarFillSectionPaint.setShader(
      new SweepGradient(viewWidth / 2, viewHeight / 2, colors2, positions2));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号