Added in API level 1
Deprecated in API level 23

AnalogClock


open class AnalogClock : View
kotlin.Any
   ↳ android.view.View
   ↳ android.widget.AnalogClock

This widget displays an analogic clock with two hands for hours and minutes.

Summary

XML attributes
android:dial
android:hand_hour
android:hand_minute
android:hand_second
android:timeZone Specifies the time zone to use.
Inherited XML attributes
Inherited constants
Public constructors
AnalogClock(context: Context!)

AnalogClock(context: Context!, attrs: AttributeSet!)

AnalogClock(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

AnalogClock(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open BlendMode?

open ColorStateList?

open BlendMode?

open ColorStateList?

open BlendMode?

open ColorStateList?

open BlendMode?

open ColorStateList?

open String?

Indicates which time zone is currently used by this view.

open Unit

open Unit
setDial(icon: Icon)

Sets the dial of the clock to the specified Icon.

open Unit

Specifies the blending mode used to apply the tint specified by setDialTintList(android.content.res.ColorStateList)} to the dial drawable.

open Unit

Applies a tint to the dial drawable.

open Unit

Sets the hour hand of the clock to the specified Icon.

open Unit

Specifies the blending mode used to apply the tint specified by setHourHandTintList(android.content.res.ColorStateList)} to the hour hand drawable.

open Unit

Applies a tint to the hour hand drawable.

open Unit

Sets the minute hand of the clock to the specified Icon.

open Unit

Specifies the blending mode used to apply the tint specified by setMinuteHandTintList(android.content.res.ColorStateList)} to the minute hand drawable.

open Unit

Applies a tint to the minute hand drawable.

open Unit

Sets the second hand of the clock to the specified Icon, or hides the second hand if it is null.

open Unit

Specifies the blending mode used to apply the tint specified by setSecondHandTintList(android.content.res.ColorStateList)} to the second hand drawable.

open Unit

Applies a tint to the second hand drawable.

open Unit
setTimeZone(timeZone: String?)

Sets the specified time zone to use in this clock.

Protected methods
open Unit

open Unit

open Unit
onDraw(canvas: Canvas)

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

open Unit
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)

Inherited functions
Inherited properties

XML attributes

android:dial

android:dial

android:hand_hour

android:hand_hour

android:hand_minute

android:hand_minute

android:hand_second

android:hand_second

android:timeZone

android:timeZone
Specifies the time zone to use. When this attribute is specified, the TextClock will ignore the time zone of the system. To use the user's time zone, do not specify this attribute. The default value is the user's time zone. Please refer to java.util.TimeZone for more information about time zone ids.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

Public constructors

AnalogClock

Added in API level 1
AnalogClock(context: Context!)

AnalogClock

Added in API level 1
AnalogClock(
    context: Context!,
    attrs: AttributeSet!)

AnalogClock

Added in API level 1
AnalogClock(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int)

AnalogClock

Added in API level 21
AnalogClock(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int,
    defStyleRes: Int)

Public methods

getDialTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun getDialTintBlendMode(): BlendMode?

Deprecated: Deprecated in Java.

Return
BlendMode? the blending mode used to apply the tint to the dial drawable This value may be null.

getDialTintList

Added in API level 31
Deprecated in API level 23
open fun getDialTintList(): ColorStateList?

Deprecated: Deprecated in Java.

Return
ColorStateList? the tint applied to the dial drawable This value may be null.

getHourHandTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun getHourHandTintBlendMode(): BlendMode?

Deprecated: Deprecated in Java.

Return
BlendMode? the blending mode used to apply the tint to the hour hand drawable This value may be null.

getHourHandTintList

Added in API level 31
Deprecated in API level 23
open fun getHourHandTintList(): ColorStateList?

Deprecated: Deprecated in Java.

Return
ColorStateList? the tint applied to the hour hand drawable This value may be null.

getMinuteHandTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun getMinuteHandTintBlendMode(): BlendMode?

Deprecated: Deprecated in Java.

Return
BlendMode? the blending mode used to apply the tint to the minute hand drawable This value may be null.

getMinuteHandTintList

Added in API level 31
Deprecated in API level 23
open fun getMinuteHandTintList(): ColorStateList?

Deprecated: Deprecated in Java.

Return
ColorStateList? the tint applied to the minute hand drawable This value may be null.

getSecondHandTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun getSecondHandTintBlendMode(): BlendMode?

Deprecated: Deprecated in Java.

Return
BlendMode? the blending mode used to apply the tint to the second hand drawable This value may be null.

getSecondHandTintList

Added in API level 31
Deprecated in API level 23
open fun getSecondHandTintList(): ColorStateList?

Deprecated: Deprecated in Java.

Return
ColorStateList? the tint applied to the second hand drawable This value may be null.

getTimeZone

Added in API level 31
Deprecated in API level 23
open fun getTimeZone(): String?

Deprecated: Deprecated in Java.

Indicates which time zone is currently used by this view.

Return
String? The ID of the current time zone or null if the default time zone, as set by the user, must be used

onVisibilityAggregated

Added in API level 24
Deprecated in API level 23
open fun onVisibilityAggregated(isVisible: Boolean): Unit

Deprecated: Deprecated in Java.

Parameters
isVisible Boolean: true if this view and all of its ancestors are VISIBLE and this view's window is also visible

setDial

Added in API level 31
Deprecated in API level 23
open fun setDial(icon: Icon): Unit

Deprecated: Deprecated in Java.

Sets the dial of the clock to the specified Icon.

Parameters
icon Icon: This value cannot be null.

setDialTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun setDialTintBlendMode(blendMode: BlendMode?): Unit

Deprecated: Deprecated in Java.

Specifies the blending mode used to apply the tint specified by setDialTintList(android.content.res.ColorStateList)} to the dial drawable. The default mode is BlendMode#SRC_IN.

Parameters
blendMode BlendMode?: the blending mode used to apply the tint, may be null to clear tint

setDialTintList

Added in API level 31
Deprecated in API level 23
open fun setDialTintList(tint: ColorStateList?): Unit

Deprecated: Deprecated in Java.

Applies a tint to the dial drawable.

Subsequent calls to setDial(android.graphics.drawable.Icon) will automatically mutate the drawable and apply the specified tint and tint mode using Drawable#setTintList(ColorStateList).

Parameters
tint ColorStateList?: the tint to apply, may be null to clear tint

setHourHand

Added in API level 31
Deprecated in API level 23
open fun setHourHand(icon: Icon): Unit

Deprecated: Deprecated in Java.

Sets the hour hand of the clock to the specified Icon.

Parameters
icon Icon: This value cannot be null.

setHourHandTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun setHourHandTintBlendMode(blendMode: BlendMode?): Unit

Deprecated: Deprecated in Java.

Specifies the blending mode used to apply the tint specified by setHourHandTintList(android.content.res.ColorStateList)} to the hour hand drawable. The default mode is BlendMode#SRC_IN.

Parameters
blendMode BlendMode?: the blending mode used to apply the tint, may be null to clear tint

setHourHandTintList

Added in API level 31
Deprecated in API level 23
open fun setHourHandTintList(tint: ColorStateList?): Unit

Deprecated: Deprecated in Java.

Applies a tint to the hour hand drawable.

Subsequent calls to setHourHand(android.graphics.drawable.Icon) will automatically mutate the drawable and apply the specified tint and tint mode using Drawable#setTintList(ColorStateList).

Parameters
tint ColorStateList?: the tint to apply, may be null to clear tint

setMinuteHand

Added in API level 31
Deprecated in API level 23
open fun setMinuteHand(icon: Icon): Unit

Deprecated: Deprecated in Java.

Sets the minute hand of the clock to the specified Icon.

Parameters
icon Icon: This value cannot be null.

setMinuteHandTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun setMinuteHandTintBlendMode(blendMode: BlendMode?): Unit

Deprecated: Deprecated in Java.

Specifies the blending mode used to apply the tint specified by setMinuteHandTintList(android.content.res.ColorStateList)} to the minute hand drawable. The default mode is BlendMode#SRC_IN.

Parameters
blendMode BlendMode?: the blending mode used to apply the tint, may be null to clear tint

setMinuteHandTintList

Added in API level 31
Deprecated in API level 23
open fun setMinuteHandTintList(tint: ColorStateList?): Unit

Deprecated: Deprecated in Java.

Applies a tint to the minute hand drawable.

Subsequent calls to setMinuteHand(android.graphics.drawable.Icon) will automatically mutate the drawable and apply the specified tint and tint mode using Drawable#setTintList(ColorStateList).

Parameters
tint ColorStateList?: the tint to apply, may be null to clear tint

setSecondHand

Added in API level 31
Deprecated in API level 23
open fun setSecondHand(icon: Icon?): Unit

Deprecated: Deprecated in Java.

Sets the second hand of the clock to the specified Icon, or hides the second hand if it is null.

Parameters
icon Icon?: This value may be null.

setSecondHandTintBlendMode

Added in API level 31
Deprecated in API level 23
open fun setSecondHandTintBlendMode(blendMode: BlendMode?): Unit

Deprecated: Deprecated in Java.

Specifies the blending mode used to apply the tint specified by setSecondHandTintList(android.content.res.ColorStateList)} to the second hand drawable. The default mode is BlendMode#SRC_IN.

Parameters
blendMode BlendMode?: the blending mode used to apply the tint, may be null to clear tint

setSecondHandTintList

Added in API level 31
Deprecated in API level 23
open fun setSecondHandTintList(tint: ColorStateList?): Unit

Deprecated: Deprecated in Java.

Applies a tint to the second hand drawable.

Subsequent calls to setSecondHand(android.graphics.drawable.Icon) will automatically mutate the drawable and apply the specified tint and tint mode using Drawable#setTintList(ColorStateList).

Parameters
tint ColorStateList?: the tint to apply, may be null to clear tint

setTimeZone

Added in API level 31
Deprecated in API level 23
open fun setTimeZone(timeZone: String?): Unit

Deprecated: Deprecated in Java.

Sets the specified time zone to use in this clock. When the time zone is set through this method, system time zone changes (when the user sets the time zone in settings for instance) will be ignored.

Parameters
timeZone String?: The desired time zone's ID as specified in java.util.TimeZone or null to user the time zone specified by the user (system time zone)

Protected methods

onAttachedToWindow

Added in API level 1
protected open fun onAttachedToWindow(): Unit

Deprecated: Deprecated in Java.

onDetachedFromWindow

Added in API level 1
protected open fun onDetachedFromWindow(): Unit

Deprecated: Deprecated in Java.

onDraw

Added in API level 1
protected open fun onDraw(canvas: Canvas): Unit

Deprecated: Deprecated in Java.

Parameters
canvas Canvas: the canvas on which the background will be drawn This value cannot be null.

onMeasure

Added in API level 1
protected open fun onMeasure(
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit

Deprecated: Deprecated in Java.

Parameters
widthMeasureSpec Int: horizontal space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.
heightMeasureSpec Int: vertical space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.

onSizeChanged

Added in API level 1
protected open fun onSizeChanged(
    w: Int,
    h: Int,
    oldw: Int,
    oldh: Int
): Unit

Deprecated: Deprecated in Java.

Parameters
w Int: Current width of this view.
h Int: Current height of this view.
oldw Int: Old width of this view.
oldh Int: Old height of this view.