American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

4 PM – Intro To Java – William

April 6 @ 4:00 pm - 5:00 pm

Today We Did
  1. Added 3 conversion types to the application
  2. Created ConversionTypeListener.java to listen to changes in the Spinner
Homework

Continue working on TemperatureConverter:

  1. Catch up if you haven’t already!! Our code can be found here: https://drive.google.com/drive/folders/1Ftsx-CYnRf3_zP2ypCEGCDhjrX3PCWrY?usp=drive_link
  2. Start working on code to switch labels when selecting a new conversion:
    1. Create a new attribute in MainActivity.java called selectedConversion and initialize it to NULL
    2. Create a new method called setConversion() inside MainActivity.java that has one String parameter called selectedConversion
    3. Inside setConversion(), get the 2 labels representing the two temperature units (hint: use findViewById)
    4. Update the values of the labels using {label}.setText({text}) based on the conversionType
    5. Inside ConversionTypeListener.java, call the setConversion() method with selected conversion type inside the onItemSelected() method.

If you have any questions, please email me at williamsmith@ayclogic.com.

Details

Date:
April 6
Time:
4:00 pm - 5:00 pm
Event Categories:
,
Verified by MonsterInsights