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

android 指针动画转动

记录一种简单动画 

效果图: 

都是直接使用图片资源FrameLayout布局实现,布局如下:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginStart="22dp"android:layout_marginTop="16dp"android:text="Manager"android:textColor="#010101"android:textSize="22sp" /><FrameLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"><FrameLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginHorizontal="22dp"><ImageViewandroid:layout_width="match_parent"android:layout_height="wrap_content"android:scaleType="fitXY"/><ImageViewandroid:layout_width="274dp"android:layout_height="137dp"android:layout_marginTop="34dp"android:layout_gravity="center_horizontal"android:scaleType="fitXY"android:src="@drawable/img_storage" /><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"android:layout_marginTop="80sp"android:layout_gravity="center_horizontal"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textColor="@color/color_db3"android:layout_gravity="center_horizontal"android:textSize="16sp" android:textStyle="bold"android:text="Storage"/><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_horizontal"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_percentage"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textColor="@color/color_545"android:layout_gravity="center_horizontal"android:textSize="44dp"android:text="0"android:textStyle="bold"/><TextViewandroid:layout_width="wrap_content"android:layout_height="32dp"android:text="%"android:textColor="#ff914545"android:layout_gravity="center_vertical"android:textSize="28sp"/></LinearLayout><TextViewandroid:id="@+id/tv_storage"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textColor="@color/color_545"android:layout_gravity="center_horizontal"android:textSize="14sp"android:text="99.1/108GB" /></LinearLayout><ImageViewandroid:id="@+id/iv_position"android:layout_width="262dp"android:layout_height="262dp"android:layout_gravity="center_horizontal"android:layout_marginTop="40dp"android:scaleType="fitXY"android:src="@drawable/img_storage_icon" /></FrameLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="200dp"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginStart="24dp"android:layout_marginTop="24dp"android:layout_marginBottom="16dp"android:text="Manager"android:textColor="@android:color/white"android:textSize="16sp"android:visibility="gone"android:textStyle="bold" /><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="40dp"android:orientation="horizontal"><LinearLayoutandroid:id="@+id/cardDocement"android:layout_width="match_parent"android:layout_height="wrap_content"android:tag="0"app:cardCornerRadius="16dp"android:layout_weight="1"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:layout_gravity="center"android:gravity="center_horizontal"android:orientation="vertical"><RelativeLayoutandroid:layout_width="78dp"android:layout_height="78dp"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:src="@drawable/img_document" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="14dp"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Doceumen"android:textColor="#333333"android:textSize="14sp"android:textStyle="bold" /><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="8dp"android:textColor="#999999"android:textSize="14sp"android:visibility="gone"tools:text="Size: 22MB" /></LinearLayout></LinearLayout></LinearLayout><LinearLayoutandroid:id="@+id/cardPhoto"android:layout_width="match_parent"android:layout_height="wrap_content"android:tag="0"app:cardCornerRadius="16dp"android:layout_weight="1"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:layout_gravity="center"android:gravity="center_horizontal"android:orientation="vertical"><RelativeLayoutandroid:layout_width="78dp"android:layout_height="78dp"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:src="@drawable/img_photo" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="14dp"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Photos"android:textColor="#333333"android:textSize="14sp"android:textStyle="bold" /><TextViewandroid:id="@+id/tv_photo"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="8dp"android:textColor="#999999"android:textSize="14sp"android:visibility="gone"tools:text="Size: 22MB" /></LinearLayout></LinearLayout></LinearLayout><LinearLayoutandroid:id="@+id/cardVideo"android:layout_width="match_parent"android:layout_height="wrap_content"android:tag="1"app:cardBackgroundColor="@android:color/white"app:cardCornerRadius="16dp"android:layout_weight="1"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_horizontal"android:orientation="vertical"android:tag="1"><RelativeLayoutandroid:layout_width="78dp"android:layout_height="78dp"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:src="@drawable/img_video" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="14dp"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Video"android:textColor="#333333"android:textSize="14sp"android:textStyle="bold" /><TextViewandroid:id="@+id/tv_video"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="8dp"android:textColor="#999999"android:textSize="14sp"android:visibility="gone"tools:text="Size: 22MB" /></LinearLayout></LinearLayout></LinearLayout>><LinearLayoutandroid:id="@+id/cardMusic"android:layout_width="match_parent"android:layout_height="wrap_content"android:visibility="gone"android:tag="2"app:cardBackgroundColor="@android:color/white"android:layout_weight="1"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_horizontal"android:orientation="vertical"android:tag="1"><RelativeLayoutandroid:layout_width="60dp"android:layout_height="60dp"android:background="@drawable/card_ffda65_r16"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:src="@drawable/icon_music" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="14dp"android:orientation="vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Music"android:textColor="#333333"android:textSize="14sp"android:textStyle="bold" /><TextViewandroid:id="@+id/tv_music"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="8dp"android:textColor="#999999"android:textSize="14sp"tools:text="Size: 22MB"android:visibility="gone"/></LinearLayout></LinearLayout></LinearLayout></LinearLayout><LinearLayout      android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_marginTop="32dp"><LinearLayoutandroid:id="@+id/cardApk"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginHorizontal="1dp"android:tag="3"app:cardCornerRadius="16dp"android:layout_weight="1" ><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_horizontal"android:orientation="vertical"android:tag="1"><RelativeLayoutandroid:layout_width="78dp"android:layout_height="78dp"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:src="@drawable/img_apks" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"android:layout_marginTop="14dp"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="APKs"android:textColor="#333333"android:textSize="14sp"android:textStyle="bold" /><TextViewandroid:id="@+id/tv_apk"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="8dp"android:textColor="#999999"android:textSize="14sp"tools:text="Size: 22MB"android:visibility="gone"/></LinearLayout></LinearLayout></LinearLayout><LinearLayoutandroid:id="@+id/cardBigFile"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginHorizontal="1dp"android:tag="4"app:cardBackgroundColor="@android:color/white"app:cardCornerRadius="16dp"android:layout_weight="1"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_horizontal"android:orientation="vertical"android:tag="1"><RelativeLayoutandroid:layout_width="78dp"android:layout_height="78dp"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:src="@drawable/img_bigfiles" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"android:layout_marginTop="14dp"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Big Files"android:textColor="#333333"android:textSize="14sp"android:textStyle="bold" /><TextViewandroid:id="@+id/tv_bigFile"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="8dp"android:textColor="#999999"android:textSize="14sp"android:visibility="gone"tools:text="Size: 22MB" /></LinearLayout></LinearLayout></LinearLayout><LinearLayoutandroid:id="@+id/cardRecentFile"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginHorizontal="1dp"android:tag="4"app:cardBackgroundColor="@android:color/white"app:cardCornerRadius="16dp"android:layout_weight="1"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_horizontal"android:orientation="vertical"android:tag="1"><RelativeLayoutandroid:layout_width="78dp"android:layout_height="78dp"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:src="@drawable/img_recentfiles" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"android:layout_marginTop="14dp"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Recent Files"android:textColor="#333333"android:textSize="14sp"android:textStyle="bold" /><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="8dp"android:textColor="#999999"android:textSize="14sp"android:visibility="gone"tools:text="Size: 22MB" /></LinearLayout></LinearLayout></LinearLayout></LinearLayout></LinearLayout></FrameLayout></LinearLayout>

Activity中动画代码 

private void loadIngData(double loading) {double loadingnum=loading*1.8;//进度值*角度比ObjectAnimator animator = ObjectAnimator.ofFloat(mImagStorageView, "rotation", (float) loadingnum);animator.setDuration(1000);animator.start();}

                                                                           -END

相关文章:

android 指针动画转动

记录一种简单动画 效果图&#xff1a; 都是直接使用图片资源FrameLayout布局实现&#xff0c;布局如下&#xff1a; <LinearLayout xmlns:android"http://schemas.android.com/apk/res/android"xmlns:app"http://schemas.android.com/apk/res-auto"…...

力扣第51题 N 皇后 c++ 难~ 回溯题

题目 51. N 皇后 困难 相关标签 数组 回溯 按照国际象棋的规则&#xff0c;皇后可以攻击与之处在同一行或同一列或同一斜线上的棋子。 n 皇后问题 研究的是如何将 n 个皇后放置在 nn 的棋盘上&#xff0c;并且使皇后彼此之间不能相互攻击。 给你一个整数 n &#xff0…...

【摄影】基础笔记

摄影基础 合理选择器材1.定焦镜&#xff08;画质更好&#xff0c;有利于联系构图&#xff09;2.变焦镜&#xff08;拍摄便捷灵活&#xff0c;有利于快速捕捉&#xff09;3.了解焦距 合理利用景深1.焦段2.光圈3.背景距离 焦距与参数实用相机参数设置指南高效的快速对焦法&#x…...

【广州华锐互动】VR石油钻井井控实训系统

在过去的几十年中&#xff0c;石油工业的发展速度一直在加快。为了适应这个快速发展的行业&#xff0c;需要新的技术和工具&#xff0c;而VR&#xff08;虚拟现实&#xff09;技术正是其中之一。本文将探讨VR石油钻井井控实训系统在石油工业教育中的应用。 在真实的钻井环境中&…...

【RocketMQ系列五】消息示例-顺序消息延迟消息广播消息的实现

1. 前言 上一篇文章我们介绍了简单消息的实现&#xff0c;本文将主要来介绍顺序消息的实现&#xff0c;顺序消息分为局部顺序消息和全局顺序消息。 顺序消息指的是消费者在消费消息时&#xff0c;按照生产者发送消息的顺序进行消费。即先发送的先消费【FIFO】。 顺序消息分为…...

hdfs dfsadmin -safemode无法退出安全模式

退出安全模式 第一种&#xff1a;正常退出安全模式 hdfs dfsadmin -safemode leave如提示Safe mode is OFF&#xff0c;那就说明退出成功&#xff0c;但有时候这个命令也没办法退出安全模式&#xff0c;就需要使用强制退出 第二种&#xff1a;强制退出安全模式 hdfs dfsadmin …...

git 新建 branch 推送 到服务器

通常情况下&#xff0c;需要开发一个模块&#xff0c;从 master 新建立了一个 分支&#xff0c;newbranch&#xff0c;如果推送到服务器&#xff1b; 1&#xff1a;从远程 master 建立本地分支 newbranch&#xff1b; git checkout -b newbranch origin/master 2:当修改完成代码…...

安全渗透测试基础知识之网络基础知识

一、OSI七层模型 7应用层6表示层5会话层4传输层3网络层2数据链路层1物理层1.物理层 提供通信介质和接口标准 网线 2.网络链路层 提供二层寻扯/MAC地址和二层通信(交换机)功能 协议:以太网Ethernet 3.网络层 提供三层寻扯/IP地址和三层通信(路由器...

Unity Editor 打包指定资源(AssetBundle)和加载指定资源

前言&#xff1a; 一般用于ui资源打包和加载&#xff0c;代码比较简单没什么好说的&#xff0c;直接上代码。 打包代码&#xff1a; [MenuItem("Assets/打包指定的预设")]public static void BuildAsset() {var selectObject Selection.activeObject;if (selectObje…...

网站批量替换关键词方法

注意替换操作之前先对文件做好备份 1.下载http://downinfo.myhostadmin.net/ultrareplace5.02.rar 解压出来,运行UltraReplace.exe 2.点击菜单栏中的配置&#xff0c;全选所有文件类型,或者根据自己的需求选择部分,如htm、html、php、asp等 3.若替换单个文件,点击文件,若是要…...

RabbitMQ的LazyQueue

在默认情况下&#xff0c;RabbitMQ会将接收到的信息保存在内存中以降低消息收发的延迟。但在某些特殊情况下&#xff0c;这会导致消息积压&#xff0c;比如&#xff1a; 消费者宕机或出现网络故障消息发送量激增&#xff0c;超过了消费者处理速度消费者处理业务发生阻塞 一旦…...

面试经典150题——Day16

文章目录 一、题目二、题解 一、题目 42. Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: Input: height [0,1,0,2,1,0,1,3,2,1,2,…...

从零开始搭建第一个django项目

目录 配置环境创建 Django 项目和 APP项目组成  ‍子目录文件组成应用文件组成 配置 settings.py启动项目 数据表创建models.pyDjango-models的常用字段和常用配置 Django-admin 引入admin后台和管理员外键views.pyurls.pypostman接口测试 QuerySetInstance功能APIView 的概念…...

Godot2D角色导航-自动寻路教程(Godot获取导航路径)

文章目录 开始准备获取路径全局点坐标 开始准备 首先创建一个导航场景&#xff0c;具体内容参考下列文章&#xff1a; Godot实现角色随鼠标移动 然后我们需要设置它的导航目标位置&#xff0c;具体关于位置的讲解在下面这个文章&#xff1a; Godot设置导航代理的目标位置 获取…...

用c++写一个高精度计算的减法运算

这段代码是一个用C编写的程序&#xff0c;它实现了两个大整数的减法运算。 #include<iostream> #include<cstdio> #include<cstring> using namespace std;int main(){int a[256],b[256],c[256],lena,lenb,lenc,i;char n[256],n1[256]"1001",n2[2…...

基于白鲸优化的BP神经网络(分类应用) - 附代码

基于白鲸优化的BP神经网络&#xff08;分类应用&#xff09; - 附代码 文章目录 基于白鲸优化的BP神经网络&#xff08;分类应用&#xff09; - 附代码1.鸢尾花iris数据介绍2.数据集整理3.白鲸优化BP神经网络3.1 BP神经网络参数设置3.2 白鲸算法应用 4.测试结果&#xff1a;5.M…...

Matlab遗传算法工具箱——一个例子搞懂遗传算法

解决问题 我们一般使用遗传算法是用来处理最优解问题的&#xff0c;下面是一个最优解问题的例子 打开遗传算法工具箱 ①在Matlab界面找到应用程序选项&#xff0c;点击应用程序(英文版的Matlab可以点击App选项) ②找到Optimization工具箱&#xff0c;点击打开 创建所需要…...

Coreldraw2020最新64位电脑完整版本下载教程

安装之前所有的杀毒软件都要退出。无论是360&#xff0c;腾讯管家&#xff0c;或者电脑自带的安全中心&#xff0c;要不然会阻止安装。 CorelDRAW2020版win下载如下:https://wm.makeding.com/iclk/?zoneid55678 CorelDRAW2020版mac下载如下:https://wm.makeding.com/iclk/?…...

第一节——vue安装+前端工程化

作者&#xff1a;尤雨溪 官网&#xff1a;简介 | Vue.js 脚手架文档 创建一个项目 | Vue CLI 一、概念&#xff08;了解&#xff09; 是一套用于构建用户界面的渐进式框架。与其它大型框架不同的是&#xff0c;Vue 被设计为可以自底向上逐层应用。Vue 的核心库只关注视图层&…...

vue集成钉钉单点登录

初始环境判断 判断是否是来自钉钉环境的访问&#xff0c;返回&#xff1a;boolean类型值 window.navigator.userAgent.includes("DingTalk")前端引入vue中钉钉相关的依赖&#xff0c;并获取钉钉的临时授权码 import * as dingtalk from dingtalk-jsapi; let that …...

突破不可导策略的训练难题:零阶优化与强化学习的深度嵌合

强化学习&#xff08;Reinforcement Learning, RL&#xff09;是工业领域智能控制的重要方法。它的基本原理是将最优控制问题建模为马尔可夫决策过程&#xff0c;然后使用强化学习的Actor-Critic机制&#xff08;中文译作“知行互动”机制&#xff09;&#xff0c;逐步迭代求解…...

Python实现prophet 理论及参数优化

文章目录 Prophet理论及模型参数介绍Python代码完整实现prophet 添加外部数据进行模型优化 之前初步学习prophet的时候&#xff0c;写过一篇简单实现&#xff0c;后期随着对该模型的深入研究&#xff0c;本次记录涉及到prophet 的公式以及参数调优&#xff0c;从公式可以更直观…...

Qwen3-Embedding-0.6B深度解析:多语言语义检索的轻量级利器

第一章 引言&#xff1a;语义表示的新时代挑战与Qwen3的破局之路 1.1 文本嵌入的核心价值与技术演进 在人工智能领域&#xff0c;文本嵌入技术如同连接自然语言与机器理解的“神经突触”——它将人类语言转化为计算机可计算的语义向量&#xff0c;支撑着搜索引擎、推荐系统、…...

ServerTrust 并非唯一

NSURLAuthenticationMethodServerTrust 只是 authenticationMethod 的冰山一角 要理解 NSURLAuthenticationMethodServerTrust, 首先要明白它只是 authenticationMethod 的选项之一, 并非唯一 1 先厘清概念 点说明authenticationMethodURLAuthenticationChallenge.protectionS…...

Android Bitmap治理全解析:从加载优化到泄漏防控的全生命周期管理

引言 Bitmap&#xff08;位图&#xff09;是Android应用内存占用的“头号杀手”。一张1080P&#xff08;1920x1080&#xff09;的图片以ARGB_8888格式加载时&#xff0c;内存占用高达8MB&#xff08;192010804字节&#xff09;。据统计&#xff0c;超过60%的应用OOM崩溃与Bitm…...

高考志愿填报管理系统---开发介绍

高考志愿填报管理系统是一款专为教育机构、学校和教师设计的学生信息管理和志愿填报辅助平台。系统基于Django框架开发&#xff0c;采用现代化的Web技术&#xff0c;为教育工作者提供高效、安全、便捷的学生管理解决方案。 ## &#x1f4cb; 系统概述 ### &#x1f3af; 系统定…...

快速排序算法改进:随机快排-荷兰国旗划分详解

随机快速排序-荷兰国旗划分算法详解 一、基础知识回顾1.1 快速排序简介1.2 荷兰国旗问题 二、随机快排 - 荷兰国旗划分原理2.1 随机化枢轴选择2.2 荷兰国旗划分过程2.3 结合随机快排与荷兰国旗划分 三、代码实现3.1 Python实现3.2 Java实现3.3 C实现 四、性能分析4.1 时间复杂度…...

VSCode 没有添加Windows右键菜单

关键字&#xff1a;VSCode&#xff1b;Windows右键菜单&#xff1b;注册表。 文章目录 前言一、工程环境二、配置流程1.右键文件打开2.右键文件夹打开3.右键空白处打开文件夹 三、测试总结 前言 安装 VSCode 时没有注意&#xff0c;实际使用的时候发现 VSCode 在 Windows 菜单栏…...

AT模式下的全局锁冲突如何解决?

一、全局锁冲突解决方案 1. 业务层重试机制&#xff08;推荐方案&#xff09; Service public class OrderService {GlobalTransactionalRetryable(maxAttempts 3, backoff Backoff(delay 100))public void createOrder(OrderDTO order) {// 库存扣减&#xff08;自动加全…...

21-Oracle 23 ai-Automatic SQL Plan Management(SPM)

小伙伴们&#xff0c;有没有迁移数据库完毕后或是突然某一天在同一个实例上同样的SQL&#xff0c; 性能不一样了、业务反馈卡顿、业务超时等各种匪夷所思的现状。 于是SPM定位开始&#xff0c;OCM考试中SPM必考。 其他的AWR、ASH、SQLHC、SQLT、SQL profile等换作下一个话题…...