🥄
One Library
  • 🤖onelib
  • 🏡Home
    • Overview
    • Setup Project
    • What's New
  • ☀️Fundamental
    • Basic Android
    • Data Flow
    • Dependency Injection
      • Hilt
      • Koin
  • 📿Layers
    • Data Layer
    • Domain Layer
    • Presentation Layer
  • 🪶Features
    • Views
      • Activity
      • Fragment
      • Bottom Sheet
      • Dialog
    • Adapters
      • Recycler Adapter
      • Filterable Adapter
      • Paging Adapter
      • Selectable Adapter
      • ViewPager Adapter
    • Firebase
      • One Firebase Auth
      • One Firebase Firestore
      • One Firebase Realtime
      • One Firebase Storage
    • Extension Functions
      • Any
      • Common
      • Context
      • Edittext
      • Image View
      • LiveData
      • OneMap
      • State Flow (Jetpack Compose)
      • View
    • Notification
    • One State View
    • Local Database
    • Permission
    • Validation
      • Passive Validator
      • Reactive Validator
      • Extension Validation
Powered by GitBook
On this page
  • Convert to String
  • Clear Input
  1. Features
  2. Extension Functions

Edittext

Convert to String

  • Function: Converts the text of an EditText or TextInputLayout to a trimmed string.

  • Usage: Useful when you need to get user input without any leading or trailing spaces.

val text = binding.edittext.toStringTrim()

Clear Input

  • Function: Clears the text in an EditText or TextInputLayout.

  • Usage: Useful for resetting the input field, often after submitting data or on specific user actions.

binding.editText.clear()

These extension functions enhance the readability and usability of EditText and TextInputLayout by providing convenient methods to handle common tasks such as trimming and clearing text.

Last updated 11 months ago

🪶