Join Chiu-Ki Chan for an in-depth discussion in this video Vector drawable: Use, part of Effective Android Testing for Mobile Developers.
- [Instructor] To use this drawable, go to activity_recipe.xml. Go to the title text view which is in line 19. We will add an attribute to use the drawable android:drawableRight will specify the one that has both stays, that is to say, drawable/ic_favorite. Duplicate this line and change drawableRight to drawableEnd so that we will support right to left languages as well.
Let's run the app. Click on the green triangle. Once again we will select chocolate pudding and we can see that there's a star to the right of the title. It is black though, I think it looks more interesting if it's yellow so let's add that color. Go to ic_favorites_solid. You can quickly do that by pressing command shift O and typing ic_favorite_hollow or solid, we'll do both but let's do solid first.
Here in line seven you can see that the fill color is black. We're going to change it to use our primary dark color, which is yellow @color/ColorPrimaryDark. Do the same thing for hollow. Command shift O, select the hollow one, and then change the color to @color/colorPrimaryDark. Run the app by clicking the green triangle.
If we choose chocolate pudding again, we can see that now the star is yellow, right now if you click on the star, it doesn't do anything. Next we are going to make it actually work. We need two things, we need an uncut listener and also somewhere to store the fact that this recipe has been marked as a favorite.
- Why test?
- Local vs. on-device
- Code coverage
- UI testing
- Hermetic environment
- Dependency injection
- Testing with MVP
Skill Level Intermediate
Android App Development: Unit Testingwith James P White2h 58m Intermediate
Android Studio Essential Trainingwith David Gassner3h 41m Beginner
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
1. Testing Considerations
2. Test as You Go
3. UI Testing
4. Hermetic Environment
5. Robot Pattern
- 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.