Overriding AnalogClock in Android
I want to create an AnalogClock that can display a preset time, given as a parameter.
And I want to draw between the background and the hands. I want to paint the area between the minute-hand and location of the hour-hand at a preset future time. This is to let the user see how much time remains for the current activity开发者_高级运维.
I thought that I could take the AnalogClock object and extend that. However, when I create a new function that is essentially a copy of one of the old ones, I get errors on the com.android.internal.R.styleable.AnalogClock* objects: "com.android.internal.R cannot be resolved"
How can I import these objects? I've read something about declare-styleable, but I cannot figure out how to apply that to my situation. (Sorry, I'm really a Java n00b)
For instance, the internal objects refer to several graphical things, such as dials, hour_hand and minute_hands.
Here's my code: http://pastie.org/713276
Any help is very much appreciated, I am stuck after hours of Google.
Here is an tutorial for creating a custom Analog Clock. Shows some sample code, hope this is at least a start in the right direction.
Set time with custom android AnalogClock from its original class Please have a look at my solution. You can use it to display a custom analog clock in a application and set time that you want in it.
精彩评论