Show / Hide Table of Contents

Class DigitFormat

A ThemeElement used primarily for generating and managing our DoubleDigit's and DigitSeparator's components. Includes support for multiple layouts: See DigitFormat.SupportedFormats.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
ThemeElement
DigitFormat
Implements
IColorHook
Inherited Members
ThemeElement.Timer
ThemeElement.IsInitialized()
ThemeElement.OnDestroy()
Namespace: AdrianMiasik.Components.Core.Containers
Assembly: Assembly-CSharp.dll
Syntax
public class DigitFormat : ThemeElement, IColorHook

Fields

| Improve this Doc View Source

m_isOnBreak

Is this digit format on break? If False then this digit format is in work mode. If True this digit format is either on break / or on a long break.

Declaration
public bool m_isOnBreak
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

m_isOnLongBreak

Is this digit format on a long break?

Declaration
public bool m_isOnLongBreak
Field Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

ActivateLongBreak()

Sets this digit format to be using the long break dataset. (work / break / long break)

Declaration
public void ActivateLongBreak()
| Improve this Doc View Source

CanDecrementOne(DigitFormat.Digits)

Returns True if you can subtract one from this digit without hitting it's floor, otherwise returns False.

Declaration
public bool CanDecrementOne(DigitFormat.Digits digit)
Parameters
Type Name Description
DigitFormat.Digits digit

The DigitFormat.Digits you want to check if it can be decremented by one.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

CanIncrementOne(DigitFormat.Digits)

Returns True if you can add one to this digit without hitting it's ceiling, otherwise returns False.

Declaration
public bool CanIncrementOne(DigitFormat.Digits digit)
Parameters
Type Name Description
DigitFormat.Digits digit

The DigitFormat.Digits you want to check if it can be decremented by one.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

ClearTimerSelection()

Clears our digit selection and sets the selection to the Background (our default).

Declaration
public void ClearTimerSelection()
| Improve this Doc View Source

ColorUpdate(Theme)

Applies our Theme changes to our components when necessary.

Declaration
public override void ColorUpdate(Theme theme)
Parameters
Type Name Description
Theme theme
Overrides
ThemeElement.ColorUpdate(Theme)
| Improve this Doc View Source

CorrectTickAnimVisuals()

Prevents all our digits tick animation from holding, especially useful for when the gameobjects are no longer active and need to be re-enabled (Such as switching between pages).

Declaration
[ContextMenu("Correct Tick Animation")]
public void CorrectTickAnimVisuals()
| Improve this Doc View Source

DeactivateLongBreak()

Sets this digit to be using the break dataset. (work / break / long break)

Declaration
public void DeactivateLongBreak()
| Improve this Doc View Source

DecrementOne(DigitFormat.Digits)

Decrements the provided digit by one. (-1)

Declaration
public void DecrementOne(DigitFormat.Digits digits)
Parameters
Type Name Description
DigitFormat.Digits digits
| Improve this Doc View Source

FlipIsOnBreakBool()

Flips our break boolean from True to False and vice versa.

Declaration
public void FlipIsOnBreakBool()
| Improve this Doc View Source

GenerateFormat()

Generates/creates our digit format using DoubleDigit's and DigitSeparator's. See SwitchFormat(DigitFormat.SupportedFormats) if you'd like to change your preferred DigitFormat.SupportedFormats, then invoke this function again to generate your new preferred format.

Declaration
[ContextMenu("Generate Format")]
public void GenerateFormat()
| Improve this Doc View Source

GetDigits()

Returns our list of generated DoubleDigit's

Declaration
public List<DoubleDigit> GetDigits()
Returns
Type Description
System.Collections.Generic.List<DoubleDigit>
| Improve this Doc View Source

GetDigitValue(DigitFormat.Digits)

Returns the provided DigitFormat.Digits value.

Declaration
public int GetDigitValue(DigitFormat.Digits digit)
Parameters
Type Name Description
DigitFormat.Digits digit
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetFormatIndex()

Return the current format index

Declaration
public int GetFormatIndex()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetPreviousFormatSelection()

Returns the previously selected format index

Declaration
public int GetPreviousFormatSelection()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetTime()

Returns the users own set times (depending on the state, you could get one of three datasets: work / break / long break)

Declaration
public TimeSpan GetTime()
Returns
Type Description
System.TimeSpan
| Improve this Doc View Source

GetTimerState()

Returns PomodoroTimer's current state. (See: PomodoroTimer.States)

Declaration
public PomodoroTimer.States GetTimerState()
Returns
Type Description
PomodoroTimer.States
| Improve this Doc View Source

GetTimerString()

Returns our current timer values in a System.String. Such as "00:24:35" (without the quotation marks)

Declaration
public string GetTimerString()
Returns
Type Description
System.String

Our current timer value.

| Improve this Doc View Source

Hide()

Disables this gameobject.

Declaration
public void Hide()
| Improve this Doc View Source

IncrementOne(DigitFormat.Digits)

Increments the provided digit by one. (+1)

Declaration
public void IncrementOne(DigitFormat.Digits digits)
Parameters
Type Name Description
DigitFormat.Digits digits
| Improve this Doc View Source

Initialize(PomodoroTimer, DigitFormat.SupportedFormats, Boolean)

Switches then generates the provided digit format and updates all relevant ThemeElement components.

Declaration
public void Initialize(PomodoroTimer pomodoroTimer, DigitFormat.SupportedFormats startingFormat, bool updateColors = true)
Parameters
Type Name Description
PomodoroTimer pomodoroTimer
DigitFormat.SupportedFormats startingFormat
System.Boolean updateColors
| Improve this Doc View Source

Initialize(PomodoroTimer, Boolean)

Switches then generates our preferred digit format and updating the relevant components using the current active Theme.

Declaration
public override void Initialize(PomodoroTimer pomodoroTimer, bool updateColors = true)
Parameters
Type Name Description
PomodoroTimer pomodoroTimer
System.Boolean updateColors
Overrides
ThemeElement.Initialize(PomodoroTimer, Boolean)
| Improve this Doc View Source

InitializeRuntimeCaret()

Declaration
public void InitializeRuntimeCaret()
| Improve this Doc View Source

Lock()

Prevents our generated DoubleDigit's to be interacted with.

Declaration
public void Lock()
| Improve this Doc View Source

RefreshDigitVisuals()

Updates our generated DoubleDigit's using our cached values and hides our increment and decrement arrows.

Declaration
public void RefreshDigitVisuals()
| Improve this Doc View Source

ResetTextPositions()

Moves all our generated DoubleDigit's into their default viewport positions and anchors.

Declaration
public void ResetTextPositions()
| Improve this Doc View Source

SetDigit(DigitFormat.Digits, Int32)

Sets the provided digit to it's provided new value.

Declaration
public void SetDigit(DigitFormat.Digits digit, int newValue)
Parameters
Type Name Description
DigitFormat.Digits digit
System.Int32 newValue
| Improve this Doc View Source

SetDigitColor(Color)

Sets the color of our generated DoubleDigit's to the provided color.

Declaration
public void SetDigitColor(Color newColor)
Parameters
Type Name Description
UnityEngine.Color newColor

The color you want to set all our DoubleDigit's to.

| Improve this Doc View Source

SetTime(TimeSpan)

Sets the generated DoubleDigit's to the provided System.TimeSpan.

Declaration
public void SetTime(TimeSpan ts)
Parameters
Type Name Description
System.TimeSpan ts
| Improve this Doc View Source

SetTimerSelection(DoubleDigit)

Sets the PomodoroTimer's selection to the provided DoubleDigit.

Declaration
public void SetTimerSelection(DoubleDigit digitToSelect)
Parameters
Type Name Description
DoubleDigit digitToSelect
| Improve this Doc View Source

SetTimerValue(String)

Sets the value of the timer using the provided formatted string.

Declaration
public void SetTimerValue(string formattedString)
Parameters
Type Name Description
System.String formattedString

Expected format of "00:25:00" (Without the quotation marks).

| Improve this Doc View Source

Show()

Enables this gameobject.

Declaration
public void Show()
| Improve this Doc View Source

ShowTickAnimation()

Declaration
public void ShowTickAnimation()
| Improve this Doc View Source

ShowTime(TimeSpan)

Sets the generated DoubleDigit's text label to the provided System.TimeSpan.

Declaration
public void ShowTime(TimeSpan ts)
Parameters
Type Name Description
System.TimeSpan ts

The System.TimeSpan you want to display to the user.

Exceptions
Type Condition
System.ArgumentOutOfRangeException
| Improve this Doc View Source

SwitchFormat(DigitFormat.SupportedFormats)

Switches your format to the provided format.

Declaration
public void SwitchFormat(DigitFormat.SupportedFormats desiredFormat)
Parameters
Type Name Description
DigitFormat.SupportedFormats desiredFormat
| Improve this Doc View Source

Unlock()

Allows our generated DoubleDigit's to be interacted with.

Declaration
public void Unlock()

Implements

IColorHook
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX