
Use a text listener to show the drawable only when text is entered into the EditText.Initialize the custom view with a drawable that appears at the end of the EditText.Extend the EditText class to create a custom view.Add layout attributes to position the view, and to support right-to-left (RTL) languages for text input.Create an app with an EditText view as a placeholder.The user can tap the X to clear the text. In this task, you create an app with a customized EditText view that includes a clear ( X) button on the right side of the EditText. After the custom view is created, you can use multiple versions of it in layouts, applying different EditText attributes as needed. The custom view includes a clear ( X) button for clearing text. The CustomEditText app demonstrates how to extend EditText to make a custom text-editing view. Use listeners to provide the custom view's behavior.


You can use these subclasses to construct a UI that enables user interaction and displays information in your app. The practical workbook for the Advanced Android Development course is now available asĪndroid offers a large set of View subclasses, such as Button, TextView, EditText, ImageView, CheckBox, or RadioButton. Unit 6: Working with Architecture Componentsġ4.1B: Deleting and updating data with Room 3.2: Working with sensor-based orientationĤ.1A: Using the Profile GPU Rendering toolĤ.1B: Using the Debug GPU Overdraw and Layout Inspector toolsĤ.1C: Using the Systrace and dumpsys toolsĤ.3: Optimizing network, battery, and image useĥ.2: Using the locale to format informationġ0.1A: Creating a custom view from a View subclassġ0.1B: Creating a custom view from scratchġ1.1C: Applying clipping to a Canvas object
