当前位置: 首页 > news >正文

android 固定进度环形刷新效果

android 固定进度无限旋转的环形效果

效果图

在这里插入图片描述

效果视频:

Record_2023-10-13-17-17-19[1]

Activity 中使用

val rotation: ObjectAnimator = ObjectAnimator.ofFloat(progressBar, "rotation", 0f, 360f)
rotation.duration = ·000 // 旋转持续时间为2秒
rotation.repeatCount = ObjectAnimator.INFINITE // 设置为无限循环
rotation.interpolator = LinearInterpolator() // 设置匀速插值器
rotation.start()

布局样式

<ProgressBarandroid:id="@+id/progressBar"android:background="@drawable/pb_circular_bg"android:progressDrawable="@drawable/pd_circular_progress"android:indeterminateOnly="false"android:indeterminate="false"android:layout_width="50dp"android:layout_height="50dp"android:max="100"android:progress="25"/>

背景样式 pb_circula_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:innerRadiusRatio="3"android:shape="ring"android:thicknessRatio="8"android:useLevel="false"><solid android:color="@color/theme_c_d9" />
</shape>

进度样式 pd_circular_progress.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:innerRadiusRatio="3"android:shape="ring"android:thicknessRatio="8"android:useLevel="true"><solid android:color="@color/colorPrimary" />
</shape>
http://www.lryc.cn/news/193157.html

相关文章:

  • python jieba 词性标注 中文词性分类 nlp jieba.posseg
  • LeetCode 每日一题 2023/10/9-2023/10/15
  • 相似性搜索:第 3 部分--混合倒排文件索引和产品量化
  • 小程序使用uni.createAnimation只执行一次的问题
  • win10取消ie浏览器自动跳转edge浏览器
  • 目录启示:使用 use 关键字为命名空间内的元素建立非限定名称
  • Go语言介绍与安装
  • 常用傅里叶变换表
  • 生活中的视音频技术
  • 一种用于肽图分析的烷化剂,Desthiobiotin-Iodoacetamide
  • 【(数据结构) —— 顺序表的应用-通讯录的实现】
  • macbook磁盘清理免费教程分享
  • cartographer_ros数据加载与处理
  • 设计模式-7种结构型模式
  • 华为李鹏:加速5G商业正循环,拥抱更繁荣的5.5G(5G-A)
  • Marin说PCB之CoilcraftBourns POC 电感的性能对比
  • 聊聊Maven的依赖传递、依赖管理、依赖作用域
  • centos6/7 SOCKS5 堆溢出漏洞修复(RPM方式)curl 8.4 CVE-2023-38545 CVE-2023-38546
  • C#,数值计算——数据建模Proposal的计算方法与源程序
  • 如何使用命令生成动态链接库.dll文件(保姆级教学)
  • Qt之模块介绍
  • Socks5代理和代理IP
  • 计算机指令、机器码
  • MyLife - Docker安装Consul
  • Leetcode刷题笔记--Hot61-70
  • python特别篇—github基本操作手册
  • tiktok直播websocket序列化与反序列化
  • 微信picker弹出之后 , 背景变成灰色是怎么做的
  • 通用考勤后台管理系统
  • LeetCode75——Day5