java setbackground_java – 在android中重新设置setBackgroundColor的动画
参见英文答案 >
Animate ProgressBar update in Android 9个
>
Animate change of view background color on Android 12个
我正在研究自定义步进器.
一切都很好.
我现在要做的是在填充当前步骤的同时为步进器设置动画.
这张图片显示了我的想法:
设置行,标题和图标src的颜色时,这是我的代码:
private void DrawStepper(int position) {
switch (position) {
case 0:
imgStepShipper.setImageResource(R.drawable.ic_current_step);
txtStepShipper.setTextColor(getResources().getColor(R.color.colorPrimary));
line.setBackgroundColor(getResources().getColor(R.color.colorDarkWhite));
imgStepConsignee.setImageResource(R.drawable.ic_unselected_step);
txtStepConsignee.setTextColor(getResources().getColor(R.color.colorDarkSuperWhite));
line2.setBackgroundColor(getResources().getColor(R.color.colorDarkWhite));
imgStepShipment.setImageResource(R.drawable.ic_unselected_step);
txtStepShipment.setTextColor(getResources().getColor(R.color.colorDarkSuperWhite));
line3.setBackgroundColor(getResources().getColor(R.color.colorDarkWhite));
imgStepCharges.setImageResource(R.drawable.ic_unselected_step);
txtStepCharges.setTextColor(getResources().getColor(R.color.colorDarkSuperWhite));
break;
case 1:
imgStepShipper.setImageResource(R.drawable.ic_done_step);
txtStepShipper.setTextColor(getResources().getColor(R.color.colorPrimary));
line.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
imgStepConsignee.setImageResource(R.drawable.ic_current_step);
txtStepConsignee.setTextColor(getResources().getColor(R.color.colorPrimary));
line2.setBackgroundColor(getResources().getColor(R.color.colorDarkWhite));
imgStepShipment.setImageResource(R.drawable.ic_unselected_step);
txtStepShipment.setTextColor(getResources().getColor(R.color.colorDarkSuperWhite));
line3.setBackgroundColor(getResources().getColor(R.color.colorDarkWhite));
imgStepCharges.setImageResource(R.drawable.ic_unselected_step);
txtStepCharges.setTextColor(getResources().getColor(R.color.colorDarkSuperWhite));
break;
case 2:
imgStepShipper.setImageResource(R.drawable.ic_done_step);
txtStepShipper.setTextColor(getResources().getColor(R.color.colorPrimary));
line.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
imgStepConsignee.setImageResource(R.drawable.ic_done_step);
txtStepConsignee.setTextColor(getResources().getColor(R.color.colorPrimary));
line2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
imgStepShipment.setImageResource(R.drawable.ic_current_step);
txtStepShipment.setTextColor(getResources().getColor(R.color.colorPrimary));
line3.setBackgroundColor(getResources().getColor(R.color.colorDarkWhite));
imgStepCharges.setImageResource(R.drawable.ic_unselected_step);
txtStepCharges.setTextColor(getResources().getColor(R.color.colorDarkSuperWhite));
break;
case 3:
imgStepShipper.setImageResource(R.drawable.ic_done_step);
txtStepShipper.setTextColor(getResources().getColor(R.color.colorPrimary));
line.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
imgStepConsignee.setImageResource(R.drawable.ic_done_step);
txtStepConsignee.setTextColor(getResources().getColor(R.color.colorPrimary));
line2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
imgStepShipment.setImageResource(R.drawable.ic_done_step);
txtStepShipment.setTextColor(getResources().getColor(R.color.colorPrimary));
line3.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
imgStepCharges.setImageResource(R.drawable.ic_current_step);
txtStepCharges.setTextColor(getResources().getColor(R.color.colorPrimary));
break;
}
}
位置是当前步骤.
这是我的用户界面:
正如我所说的,每次从一个步骤移动到另一个步骤时,我想要为该线条设置动画.
谢谢 :)
java setbackground_java – 在android中重新设置setBackgroundColor的动画相关推荐
- android 设置默认字体大小,Android中如何设置TextView的字体默认大小
Android中如何设置TextView的字体默认大小 发布时间:2020-11-25 16:46:14 来源:亿速云 阅读:81 作者:Leah 本篇文章为大家展示了Android中如何设置Text ...
- Android中如何设置RadioButton在文字的右边,图标在左边
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/5411953.html,如需转载请自行联系原作者Android中如何设置RadioButto ...
- Android中四种补间动画的使用示例(附代码下载)
场景 Android中四种补间动画. 透明度渐变动画 旋转动画 缩放动画 平移动画 注: 博客: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的 ...
- android java 调用js,Android中Java和JavaScript交互实例
Android提供了一个很强大的WebView控件用来处理Web网页,而在网页中,JavaScript又是一个很举足轻重的脚本.本文将介绍如何实现Java代码和Javascript代码的相互调用. 如 ...
- android 横屏竖屏设置,Android中强制设置横屏与竖屏,与横竖屏生命周期的设置
许多小的知识点,是面试中经常会被提问到的,面试题也方式也会不一样,比如,让你在配置文件中设置Activity 为竖屏模式,答题方式是把相关的配置节点代码也给写出来,多少有点懵逼... 全屏 在Acti ...
- Android中颜色设置
一.十六进制颜色码 1.六位十六进制码 最常见的应该是六位十六进制码:r g b 前两位是R,中间两位是G,后面两位是B . eg: FFC0CB 表示pink; FFFF00表 ...
- Java IO在Android中应用(三):Apk加固去壳
Java I/O在Android中应用(三):Apk加固去壳 前言(废话) 现在在动车上,因为最近接到一个紧急的出差任务,需要去一趟江苏我们移动应用的客户现场.说真的,本来其实我是很困的,但是车上有一 ...
- Java IO在Android中应用(二):APK加固
Java I/O在Android中应用(二):APK加固套壳 前言(废话) 我,有两把键盘,第一把是Poker III(黑轴),第二把是Poker II(红轴).工作的时候我常用的是红轴的Poker ...
- android编程xml动画,Android中xml设置Animation动画效果详解
在Android中,Animation动画效果的实现可以通过两种方式进行实现,一种是tweened animation渐变动画,另一种是frame by frame animation画面转换动画. ...
最新文章
- python爬虫网络请求超时_6、web爬虫讲解2—urllib库爬虫—基础使用—超时设置—自动模拟http请求...
- Android中五种常用的menu
- python读excel字体颜色_无法使用python xlsxwri更改excel中的字体颜色
- getopt( )和 getopt_long( )
- Web服务的体系架构
- iOS之UITraitCollection
- 黑旋风简约引导页源码-个人官网必备
- HDU - 4746预处理莫比乌斯反演
- 【CMAKE】 is not able to compile a simple test program.
- Linux常用命令大全(持续更新)
- SpringBoot连接远程云服务器的Redis并且让Redis后台运行
- python 精度计算 性能_Python 优化存储和精度
- 微信语音终于可以转发了
- 用户画像理解和方法论
- 2、传输介质——双绞线
- keras开发者文档 10:理解 masking padding
- 如何面对高水平的破解组织 谈暴力破解应对
- packet tracer配置ssh、telnet
- #Paper Reading# Efficient Heterogeneous Collaborative Filtering without NS for Recommendation
- Azure Kinect获取相机内参
热门文章
- 优点知识云原生存储 Rook 实战 分享笔记
- spwm调制仿真matlab,三相SPWM逆变器的调制建模和仿真
- 超声波功率放大器原理,安泰超声功率放大器在MEMS测试中的应用
- 数字电视共享器的系统应用
- Day04 红帽下Linux基础指令1
- vscode快捷设置左侧导航栏和文本字体大小
- C#WinForm实现串口通讯
- Multiple constructors accepting all given System.Collections.Generic.List
- oracle跨平台跨版本迁移工具xtts-V4版本
- 【Python】爬取中国历史票房榜,可视化分析