Question: Part 1: Write an app that simulates a traffic light. It should display a label(TextView) and a button. The label represents the current color of

Part 1: Write an app that simulates a traffic light. It should display a label(TextView) and a button. The label represents the current color of a traffic light and can be red, green, or yellow. When the user clicks on the button, the label cycles to the next color and simulates running the traffic light. Look at the documentation of the View class to figure out how to change the color of a View programmatically. You decide on the layout and screen design. Include a traffic light model. (20 points)

Part 2: Write and app that lets the user create a color using the RBG color model. It displays 3 input fields and one label. The user should be prompted to enter numbers between 0 and 255. If an input is less than 0 it should be made 0, if it is greater than 255 it should be set to 255. Each of the input boxes represents a color value Red, Green, and Blue. When the number in any of the text fields changes, update the background color of the label. (40 points)

Part 3: Now rewrite the app from Part 1, only do not use xml. (40 points)

Using Android Studio.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!