Skip to content

feat: Add SecureTextField component and update TextField #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 11, 2025

Conversation

Sanlorng
Copy link
Collaborator

@Sanlorng Sanlorng commented Apr 21, 2025

This commit introduces the SecureTextField component, which is a text input field designed for securely entering private text like passwords. It also updates the TextField component with enhanced functionality.

close #103
close #114
Key changes:

  • SecureTextField:
    • Adds a new SecureTextField component that obscures the entered text.
    • Provides options to customize text obfuscation using textObfuscationMode and textObfuscationCharacter.
    • Includes BasicSecureTextField for the core text field functionality.
    • Uses KeyboardType.Password by default.
  • TextField:
  • TextField Update:
    • Update the TextField component and add support TextFieldState, header, placeholder, trailing, leadingIcon, clear.
    • Refactor TextField use new TextFieldState.
    • The HeaderContainer composable is updated to use a custom Layout with a HeaderMeasurePolicy to correctly measure and position the header and content.
    • The TextField and SecureTextField composables now pass the header directly to the DecorationBox.
    • The DecorationBox in TextFieldDefaults is updated to accept and display the header.
    • A new Container composable is introduced within TextFieldDefaults.DecorationBox to encapsulate the visual styling of the TextField, including border and background.
    • The modifier parameter for drawing the bottom line is removed from TextFieldDefaults.DecorationBox as this is now handled by the new Container.
  • Sample:
  • Gallery Sample:
    • Adds a new sample screen that include SecureTextField and TextField in the Gallery app.

@Sanlorng Sanlorng requested a review from Konyaco April 21, 2025 05:32
@Sanlorng Sanlorng changed the base branch from change-group to dev June 5, 2025 05:29
@Sanlorng Sanlorng force-pushed the text_field_password_type branch from 239aceb to f1b8d56 Compare June 6, 2025 12:35
Sanlorng added 2 commits June 8, 2025 16:14
This commit introduces the `SecureTextField` component, which is a text input field designed for securely entering private text like passwords. It also updates the `TextField` component with enhanced functionality.

Key changes:

-   **SecureTextField**:
    -   Adds a new `SecureTextField` component that obscures the entered text.
    -   Provides options to customize text obfuscation using `textObfuscationMode` and `textObfuscationCharacter`.
    -   Includes `BasicSecureTextField` for the core text field functionality.
    -   Uses `KeyboardType.Password` by default.
-   **TextField**:
+   **TextField Update**:
     -   Update the `TextField` component and add support `TextFieldState`, `header`, `placeholder`, `trailing`, `leadingIcon`, `clear`.
     -   Refactor `TextField` use new `TextFieldState`.
-   **Sample**:
+   **Gallery Sample**:
     -   Adds a new sample screen that include `SecureTextField` and `TextField` in the Gallery app.
-   Add Password guide in the README.md.
This commit refactors the TextField component by moving the header logic into the `DecorationBox`.

Key changes:

-   The `HeaderContainer` composable is updated to use a custom `Layout` with a `HeaderMeasurePolicy` to correctly measure and position the header and content.
-   The `TextField` and `SecureTextField` composables now pass the `header` directly to the `DecorationBox`.
-   The `DecorationBox` in `TextFieldDefaults` is updated to accept and display the `header`.
-   A new `Container` composable is introduced within `TextFieldDefaults.DecorationBox` to encapsulate the visual styling of the TextField, including border and background.
-   The `modifier` parameter for drawing the bottom line is removed from `TextFieldDefaults.DecorationBox` as this is now handled by the new `Container`.
@Sanlorng Sanlorng force-pushed the text_field_password_type branch from f1b8d56 to 2e28ccf Compare June 8, 2025 11:19
@Konyaco Konyaco merged commit f34cfc4 into dev Jun 11, 2025
@Konyaco Konyaco deleted the text_field_password_type branch June 11, 2025 16:55
@Sanlorng Sanlorng mentioned this pull request Jun 13, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants