Using EditText views

We introduced the EditText views to enter editable text content. You can see some new attributes here:

  • hint: This defines the default string value that will be presented to the user
  • padding: This is the space between the view itself and its content
  • gravity: This defines direction for the content; in our case, all text will stick to the top of the parent view
Note that, for all strings and dimensions, we defined proper entries in the strings.xml file and the dimens.xml file.

The strings resource file now looks like this:

    <resources> 
      <string name="app_name">Journaler</string> 
      <string name="title">Title</string> 
      <string name="your_note_content_goes_here">Your note content goes  here.</string> </resources> Todos screen ...

Get Mastering Android Development with Kotlin now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.