Exam 3 : Fragments, Files and Threads
Develop an application that will download a large image from the internet without blocking the main thread. The image will need to scaled down from the original size to that of the ImageView used to display the image.
The UI should be composed of 5 widgets
- When image is being downloaded, should display a message with the size of the image that is being downloaded (see picture for exact message).
- When download is complete and while image is being decoded, should display message "Decoding downloaded image".
- When decoding is complete and image is displayed, display a message that indicates the original dimensions of the image as well as the final scaled down image size. See picture for exact message format. Note that the dimensions should be dynamically generated and not copied from the image.
- When user clicks the stop button, should display the message "Download aborted" as shown in picture. Note that there is no need to check if a download is in progress for this (you can if you wish to).
Part 2
- The ImageView and TextView should be in one fragment (DisplayFragment for instance).
- The start/stop Button widgets and the ProgressBar widget should be in another fragment (ControlsFragment for instance).
- Follow standard recommendations when implementing the fragments
- Fragments should have no knowledge of each other
- The fragments should not interact directly with each other
Note: You can reuse Lab8 for this work.