Thoughts on Android (20): Clocks (AnalogClock and Textclock) and timers (chronometer)

Source: Internet
Author: User

The clock text Textclock inherits from TextView, which is the text box that is used to display the current time.

XML attributes and related methods supported by Textclock

XML Properties

Related methods

Description

Android:format12hour

Setformat12hour (charsequence)

Set The format string for a system of hours

Android:format24hour

Setformat12hour (charsequence)

Set The format string for a system of hours

Android:timezone

Settimezone (String)

Set the time zone of the clock

The analog clock analogclock inherits from the view component, overriding the view 's OnDraw method, Draws an analog clock that displays the current time.

XML attributes and related methods supported by AnalogClock

XML Properties

Related methods

Description

Android:dial

Set the picture used for the dial

Android:hand_hour

Set the picture to be used by the hour

Android:hand_minute

Set the picture used by the minute hand

The timer chronometer inherits from TextView, displaying a text box that starts at a certain time and passes through the time.

The supported properties are Android:format used to specify the timing format of the timer.

The relevant methods are as follows:

SetBase (long Base): Sets the start time of the timer

SetFormat (String format): Sets the format of the display time

Start (): Start timing

Stop (): Stop timing

Setonchronometerticklistener (Chronometer.onchronometerticklistener listener);

Binds the event listener to the timer, but triggers the listener when the timer changes

Android Thoughts (20): Clocks (AnalogClock and Textclock) and timers (chronometer)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.