Join Albert Lo for an in-depth discussion in this video Implement CheckBox, part of Android Development: Modern Android UI Design Elements.
- [Instructor] Let's go back into our CheckBox class.…I'm going to dismiss our project view,…I'm going to close off our gradle file.…So loadVectorFromSvgFile method,…what it will do is handle the actual loading…of the SVG resource from a file.…So let's implement that here.…First, let's rename this to rawFileId,…and let's do a validation check on our rawFileId.…
If we have a valid file ID…then let's try loading it.…So let's get an SVG reference.…And we're going to call getFromResource,…passing in our context,…and the rawFileId.…If we have an SVG and we didn't run into an exception…we'll just return it as a PictureDrawable.…
And we call the renderToPicture…to convert to a PictureDrawable.…If there is an error this method will throw an exception.…So let's handle that here with our catch…and the exception we want to catch is SVGParseException.…And let's just print the StackTrace…if there was an exception.…If we don't have a valid file ID…we will return null.…
Now let's add some other methods.…The next one we want to add is the onClick.…
- Creating a custom layout with XML
- Setting up OnClick handlers
- Making API calls
- Creating custom views
- Implementing ViewHolder objects
- Signing certificates
- Adding a checkbox
Skill Level Intermediate
Building Android Apps with Cloud Serviceswith Albert Lo2h 37m Intermediate
1. Understanding the Side Navigation Drawer
2. Custom RecyclerView: Multiple View Types
3. Custom RecyclerView: ViewHolders
4. Understanding Custom Views
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.