# Status.TimerOrStopwatchPart

Artifact: [androidx.wear:wear-ongoing](https://developer.android.com/jetpack/androidx/releases/wear) [View Source](https://cs.android.com/search?q=file:androidx/wear/ongoing/Status.java+class:androidx.wear.ongoing.Status.TimerOrStopwatchPart) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

*** ** * ** ***


```
public abstract class Status.TimerOrStopwatchPart extends Status.Part
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.wear.ongoing.Status.Part](https://developer.android.com/reference/androidx/wear/ongoing/Status.Part) ||
|   | ↳ | [androidx.wear.ongoing.Status.TimerOrStopwatchPart](https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart) |

Known direct subclasses [Status.StopwatchPart](https://developer.android.com/reference/androidx/wear/ongoing/Status.StopwatchPart), [Status.TimerPart](https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerPart)

|---|---|
| `https://developer.android.com/reference/androidx/wear/ongoing/Status.StopwatchPart` | An Ongoing activity status (or part of it) representing a stopwatch |
| `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerPart` | An Ongoing activity status (or part of it) representing a timer. |

*** ** * ** ***

Base class for `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerPart` and `https://developer.android.com/reference/androidx/wear/ongoing/Status.StopwatchPart`, defines the getters but can't be created directly, create one of those instead.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html obj)` |
| `long` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getNextChangeTimeMillis(long)(long fromTimeMillis)` See `https://developer.android.com/reference/androidx/wear/ongoing/TimeDependentText#getNextChangeTimeMillis(long)` |
| `long` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getPausedAtMillis()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getText(android.content.Context,long)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, long timeNowMillis)` See `https://developer.android.com/reference/androidx/wear/ongoing/TimeDependentText#getText(android.content.Context,long)` |
| `long` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getTimeZeroMillis()()` |
| `long` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#getTotalDurationMillis()()` |
| `boolean` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#hasTotalDuration()()` Determines if this has a total duration set. |
| `int` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#isCountDown()()` |
| `boolean` | `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#isPaused()()` Determines if this Timer or Stopwatch is paused. i.e. the display representation will not change over time. |

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### getNextChangeTimeMillis

```
public long getNextChangeTimeMillis(long fromTimeMillis)
```

See `https://developer.android.com/reference/androidx/wear/ongoing/TimeDependentText#getNextChangeTimeMillis(long)`

### getPausedAtMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

```
public long getPausedAtMillis()
```

| Returns |
|---|---|
| `long` | the timestamp of the time when this was paused. Use `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#isPaused()` to determine if this is paused or not. |

### getText

```
public @NonNull CharSequence getText(@NonNull Context context, long timeNowMillis)
```

See `https://developer.android.com/reference/androidx/wear/ongoing/TimeDependentText#getText(android.content.Context,long)`

### getTimeZeroMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

```
public long getTimeZeroMillis()
```

| Returns |
|---|---|
| `long` | the time at which this Timer or Stopwatch will display 0, will usually be in the past for a stopwatch and in the future for timers. |

### getTotalDurationMillis

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

```
public long getTotalDurationMillis()
```

| Returns |
|---|---|
| `long` | the total duration of this timer/stopwatch, if set. Use `https://developer.android.com/reference/androidx/wear/ongoing/Status.TimerOrStopwatchPart#hasTotalDuration()` to determine if this has a duration set. |

### hasTotalDuration

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

```
public boolean hasTotalDuration()
```

Determines if this has a total duration set.

| Returns |
|---|---|
| `boolean` | `true` if this the total duration was set, `false` if not. |

### hashCode

```
public int hashCode()
```

### isCountDown

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

```
public boolean isCountDown()
```

| Returns |
|---|---|
| `boolean` | `false` if this is a stopwatch or `true` if this is a timer. |

### isPaused

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

```
public boolean isPaused()
```

Determines if this Timer or Stopwatch is paused. i.e. the display representation will not change over time.

| Returns |
|---|---|
| `boolean` | `true` if this is paused, `false` if it's running. |