From cf140c800705148d38513aa350e13b372bcab8e2 Mon Sep 17 00:00:00 2001 From: Devin Morgan Date: Mon, 17 Jun 2024 08:09:45 -0400 Subject: [PATCH] Add missing docstrings --- .../android/core/ui/element/state/EditTextState.kt | 7 ++++++- .../android/core/ui/element/state/ElementState.kt | 12 +++++++++++- .../core/ui/element/state/pin/PinEditTextState.kt | 6 +++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/EditTextState.kt b/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/EditTextState.kt index 03a590da5..ec62b9968 100644 --- a/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/EditTextState.kt +++ b/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/EditTextState.kt @@ -1,6 +1,11 @@ package com.joinforage.forage.android.core.ui.element.state -// TODO: docstrings +/** + * An interface that represents the `EditText` state of the [ForageElement][com.joinforage.forage.android.core.ui.ForageElement] + * as the customer interacts with it. + * @property isFocused Whether the Element is in focus. + * @property isBlurred Whether the Element is blurred. + */ interface EditTextState : ElementState { val isFocused: Boolean val isBlurred: Boolean diff --git a/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/ElementState.kt b/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/ElementState.kt index 4e362230e..859a0560c 100644 --- a/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/ElementState.kt +++ b/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/ElementState.kt @@ -2,7 +2,17 @@ package com.joinforage.forage.android.core.ui.element.state import com.joinforage.forage.android.core.ui.element.ElementValidationError -// TODO: docstrings +/** + * An interface that represents the state of the [ForageElement][com.joinforage.forage.android.core.ui.ForageElement] + * as the customer interacts with it. + * @property isEmpty Whether the input value of the Element is empty. + * @property isValid Whether the input text fails any validation checks, with the exception of the + * target length constraint. + * @property isComplete Whether the text field of the Element is ready to submit. This is `true` + * when all input value validation constraints are satisfied. + * @property validationError An [ElementValidationError], if `isValid` is `false`. + * @see [EditTextState] + */ interface ElementState { val isEmpty: Boolean val isValid: Boolean diff --git a/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/pin/PinEditTextState.kt b/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/pin/PinEditTextState.kt index a8aabeeca..d99587485 100644 --- a/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/pin/PinEditTextState.kt +++ b/forage-android/src/main/java/com/joinforage/forage/android/core/ui/element/state/pin/PinEditTextState.kt @@ -4,7 +4,11 @@ import com.joinforage.forage.android.core.ui.element.ElementValidationError import com.joinforage.forage.android.core.ui.element.state.EditTextState import com.joinforage.forage.android.core.ui.element.state.FocusState -// TODO: docstrings +/** + * An interface that represents the state of a + * [ForagePINEditText][com.joinforage.forage.android.core.ui.ForagePINEditText] Element. + * @see [EditTextState][com.joinforage.forage.android.core.ui.element.state.EditTextState] + */ interface PinEditTextState : EditTextState { companion object { internal fun from(focusState: FocusState, inputState: PinInputState) = object :