From the course: Building an Android App with Jetpack Libraries

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create new notes

Create new notes - Android Tutorial

From the course: Building an Android App with Jetpack Libraries

Start my 1-month free trial

Create new notes

- My app is successfully saving data now, updating and deleting notes. And now I'm ready to add code to create a new note. First, I need to user interface element that lets the user say, I want to create a new note. I'll add that in the main fragment layout file. I'll go to design view and then I'll go over to my buttons category in the palette and I'll drag in a floating action button. For the icon, I'll choose ic_add. Now I'm going to anchor this to the right and bottom edges. And then in the attributes panel, I'll add margins of 16 pixels each. I'll look at that in code view. And that resulted in creating these two constraint properties. I'll take care of this issue, I'll use an intention action and I'll switch from the source to the source compat attribute. And that has the app prefix. I'll reformat my code and then I'll run the app to see what the fragment looks like with the floating action button. So now…

Contents