INQ241B
Mobile Apps

Activity 1

Extend the Draw App

  1. Add a clear button to the app. When the user clicks the button all lines and dots that have been drawn to the canvas should dissappear. Look in the canvas component's drawer in the blocks editor for how to clear the canvas.

  2. Add a camera button to the app. When the user clicks the camera button it should take a picture. After the user takes the picture the app should set the canvas's background image to the picture the user took. The camera component is in the component designer's media palette. Look at the camera component's drawer in the blocks editor for how to take a picture and get the image after a picture has been taken.

  3. Add buttons that change the pen color of the app. Add three buttons with the text Red, Blue, and Green. When the user clicks one of the color buttons, the color of subsiquent dots and lines drawn to the canvas should be drawn in the specified color. Note, previously drawn dots and lines should not change.

  4. Modify the app to provide feedback to the user on the current pen color. The backgroud color of the color buttons that are not the current color should be gray, but the button of the current color should be the current color. So for example, after the user presses the blue button, the background color of the blue button should be blue and the background color of the red button and the green button should be gray.