Android高仿iOS圆环进度条

本文旨在介绍如何在Android平台上创建一个高仿iOS风格的圆环进度条,用于播放笔记录音的UI元素。文章详细阐述了开发过程,包括参考项目、关键代码实现、特别是方法在创建圆环核心效果中的作用,以及后续的开发计划。
摘要由CSDN通过智能技术生成

一、目标

实现圆环进度条,为神马笔记播放笔记的录音元素做准备。
在这里插入图片描述

二、参考项目

开源项目 描述
ldoublem / RingProgress a circle progress bar with effect
HotBitmapGG / RingProgressBar A material design circle the progress bar.

三、系统功能类

描述
ShapeDrawable 使用各种Shape的Drawable。
ArcShape A material design circle the progress bar.

四、实现代码

添加了start()stop()接口,使之产生动画效果。

public class RingView extends View {
   

    long duration;
    long progress;

    long startTime;
    long endTime;
    boolean isRunning;

    ShapeDrawable drawable;
    RingShape shape;

    float indentSize;

    public RingView(Context context) {
   
        this(context, null);
    }

    public RingView(Context context, @Nullable AttributeSet attrs) {
   
        this(context, attrs, 0);
    }

    public RingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
   
        this(context, attrs, defStyleAttr, 0);
    }

    public RingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
   
        super(context, attrs, defStyleAttr, defStyleRes);

        {
   
            this.shape = new RingShape(-90, 0);
            this.drawable = new ShapeDrawable(shape);

            
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值