Define and implement ViewHolder class for the photo view.
- [Instructor] No we are ready to test all of the changes that we have made. Remember to register for the singing certificate before starting on this test. Otherwise the photos for your selected Google account will not load. Now, lets go and do a gradle clean. And once the gradle clean has finished lets check our run configuration. And lets make sure we have selected app as our run configuration. And then now lets press play to do a gradle build.
I'm going to select a virtual device that I have created previously please refer to the section in the intro on how to create your own virtual device. So here I'm going to select pixel xl as my virtual device, press okay. And we see that android studio has installed the app. Lets switch over to our app. If this is the very first time that you have installed the app onto the device then when we go and open the side nav drawer and select Google photos you'll see that the photos and albums have not loaded.
This is because we have not yet selected a Google account. So lets press the UI control on the action bar. And it will ask us to choose an account or add an account. If you have not yet created a Google account or you have not yet installed a Google account on your device. You can select add account and press okay. And it will start the work flow of adding a Google account for your device. I have already added a Google account for my device. So I'm going to go back here and I'm going to select the Google account that I want.
And press okay. And it will load my albums. Now you'll notice that there are two identical sets of albums so what is happening here is that Google photos automatically creates a backup copy of your album. So that's why we have an identical set. Now lets select the album on the right. And now we see the photos that are loaded. And notice we also have our timestamp as our header view. And then we have the Google photos view holder that is displaying the thumbnails from our Google photos.
And you'll see that we have organized our collection of photos according to timestamp. So this means all the photos are grouped by the date that they were created. So if you have not uninstalled your app and you run it a second time. Then in subsequent times we run it and select Google photos from the side nav drawer it will automatically load our photos from our selected account and we no longer have to select a Google account from the action bar.
And that completes our test.
- Creating a custom layout with XML
- Setting up OnClick handlers
- Making API calls
- Creating custom views
- Implementing ViewHolder objects
- Signing certificates
- Adding a checkbox