Question: Please do it on Android Studio. Chapter 1 Assignment In this challenge, you will use Snackbar to display a message of Correct! or Incorrect! replacing

Please do it on Android Studio.

 Please do it on Android Studio. Chapter 1 Assignment In this

Chapter 1 Assignment In this challenge, you will use Snackbar to display a message of "Correct!" or "Incorrect!" replacing the Toast class in chapter 1 . (The Toast class is old.) However, the location is only at the bottom left screen. Refer to the Snackbar class definition at: Snackbar | Android Developers Step 1: You can just replace Toast.makeText(MainActivity.this,"Correct!",Toast.LENGTH_SHORT).show(); with Snackbar.make(view,"Correct!",Snackbar.LENGTH_SHORT).show(); Then, you will make the True and False buttons grey out and disabled. You can use mTrueButton.setEnabled(false). Note: Make sure you import the necessary Snackbar class. The Snackbar message allows you to swip out of the screen. Step 2: The Snackbar has more functions such as creating a button on the message. But you need to have a that wrap the original LinearLayout. You need to create an id for the CoordinatorLayout. In the MainActivity, you need to create an CoordinatorLayout variable that binds the CoordinatorLayout using findViewByld() method. Then, the following statements can create a click button on the message. Snackbar snackbar = Snackbar.make(mLayout, "You answered the question!",Snackbar.LENGTH_LONG ) .setAction("UNDO", new View.OnClickListener() \{ @Override public void onClick(View view) \{ I/leave the button enabled \} 3); snackbar.show(); Please refer to How to add a Snackbar in Android - GeeksforGeeks for more information. We want to provide an opportunity for the user to undo the answer. Things to submit: 1. a zipped folder that contains all the project files and folders. 2. screen shots of the successful execution of your app

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!