XML Settings

How to create settings file

All the clock settings can be loaded from XML resource, from the "res/xml" folder of your Android project. All the settings must be saved under "TrueAnalogClock" root element:

<?xml version="1.0" encoding="utf-8"?>
<TrueAnalogClock
  <!-- clock settings here -->
  >

  <hand
  <!-- hand settings here -->
  />

  <hand
  <!-- another hand settings here -->
  />

  <!-- ... -->
  
  <hand
  <!-- last hand settings here -->
  />

</TrueAnalogClock>

The clock settings section must contain at least the face image record, and any hand section must contain image record. If the face is not defined, clock drawing is ignored, and the hand without image it is not drawn too. Clock can contain any count of the hands.

Complete typical XML resource with face and 3 hands looks like this:

<?xml version="1.0" encoding="utf-8"?>
<TrueAnalogClock
  face="children_face"
  useSystemTime="true">

  <hand
    image="children_hand_hour"
    axisFacePoint="905:905"
    axisPoint="53:525"
    shadow="true"
    shadowBlurRadius="9"
    shadowOffset="9:9"
    type="Hour"/>

  <hand
    image="children_hand_minute"
    axisFacePoint="905:905"
    axisPoint="45:843"
    shadow="true"
    shadowBlurRadius="12"
    shadowOffset="12:12"
    type="Minute"/>

  <hand
    image="children_hand_second"
    axisFacePoint="905:905"
    axisPoint="105:850"
    shadow="true"
    shadowBlurRadius="25"
    shadowOffset="25:25"
    type="Second"/>

</TrueAnalogClock>

See complete list of XML attributes:

Clock
API