简体   繁体   English

在Android应用程序中绘制模拟时钟并进行设置

[英]Painting over analog clock in Android application and setting it

I'm working on an Android Application for AutiPlan, which is a web-based planner tool for people with an Autism-related disorder. 我正在为AutiPlan开发Android应用程序,这是针对患有自闭症相关疾病的人的基于网络的计划工具。

I want to create an application which shows the current activity (planned item), together with a clock. 我想创建一个显示当前活动(计划项目)以及时钟的应用程序。 (AnalogClock) On this clock, I want to paint a red background from the current-minute to the minute at which the activity ends. (AnalogClock)在这个时钟上,我想从当前分钟到活动结束的那一刻绘制红色背景。

To clarify, if it is now 12:00 and the current activity ends at 12:15, the right-top quarter of the circle that makes out the analog clock is red. 要澄清的是,如果现在现在是12:00,并且当前活动在12:15结束,则构成模拟时钟的圆圈的右上四分之一为红色。 This has to be updated every minute, so that it is clear how much time is left for the current activity. 必须每分钟更新一次,以便可以清楚地知道当前活动还剩下多少时间。 (The red section gets smaller each minute). (红色部分每分钟变小)。

Also, (question 2) I want to use AnalogClock to display a small (stationary) clock with the time that the next activity starts. 另外,(问题2)我想使用AnalogClock在下一个活动开始的时间显示一个小的(固定的)时钟。 Can I set the time of the object so it displays a specific time? 我可以设置对象的时间以使其显示特定时间吗?

Regarding "question 2", not with the standard AnalogClock . 关于“问题2”,而不是标准AnalogClock

Regarding what I presume is "question 1" (can you paint those things on the AnalogClock ), probably not with the standard AnalogClock. 关于我的假设是“问题1”(您可以在AnalogClock上画那些东西),可能不是标准的AnalogClock。

In both cases, I suspect you want to create your own clock, perhaps using the AnalogClock source code as a basis. 在这两种情况下,我都怀疑您想创建自己的时钟,也许以AnalogClock源代码为基础。 For your "question 1", you may be able to get away with just a subclass. 对于您的“问题1”,您可能仅能摆脱一个子类。 For "question 2", getting the current time is a large chunk of the AnalogClock code, so you will probably need to create a separate clock class. 对于“问题2”,获取当前时间是AnalogClock代码的很大一部分,因此您可能需要创建一个单独的时钟类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM