This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.marwaeltayeb.currencyexchange.data.model | |
import com.google.gson.annotations.SerializedName | |
data class HistoricApiResponse( | |
@SerializedName("base") | |
val base: String, | |
@SerializedName("end_date") | |
val endAt: String, | |
@SerializedName("rates") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.marwaeltayeb.currencyexchange.data.model | |
import com.google.gson.annotations.SerializedName | |
data class RateApiResponse( | |
@SerializedName("rates") | |
val rates: Map<String, Double>, | |
@SerializedName("base") | |
val base: String, | |
@SerializedName("date") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find the View that shows the numbers category | |
TextView numbers = (TextView) findViewById(R.id.numbers); | |
// Set a click listener on that View | |
numbers.setOnClickListener(new View.OnClickListener() { | |
// The code in this method will be executed when the numbers View is clicked on. | |
@Override | |
public void onClick(View view) { | |
Intent numbersIntent = new Intent(MainActivity.this, NumbersActivity.class); | |
startActivity(numbersIntent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> | |
<!-- Title for the application. [CHAR LIMIT=12] --> | |
<string name="app_name">Sólo Java</string> | |
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] --> | |
<string name="name">Nombre</string> | |
<!-- Hint text display in the empty field for the user's name [CHAR LIMIT=20] --> | |
<string name="toppings">Ingredientes</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int numberOfSmoothiesTillPrize = 10; | |
if (numberOfSmoothiesTillPrize > 9) { | |
Log.v("SmoothieActivity", "Congratulations, you get a free smoothie!"); | |
numberOfSmoothiesTillPrize = numberOfSmoothiesTillPrize - 10; | |
} else { | |
Log.v("SmoothieActivity", "No free smoothie this time."); | |
} | |
Log.v("SmoothieActivity", "You currently have " + numberOfSmoothiesTillPrize + " out of 10 smoothies needed for your next free smoothie."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int numberOfEmailsInInbox = 0; | |
int numberOfDraftEmails = 2; | |
String emailMessage = "You have " + numberOfEmailsInInbox + " emails. "; | |
String draftMessage = "You have " + numberOfDraftEmails + " email drafts."; | |
if (numberOfEmailsInInbox == 0) { | |
emailMessage = "You have no new messages. "; | |
} | |
if (numberOfDraftEmails == 0) { | |
draftMessage = "You have no new drafts."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isRaining = true; | |
if (isRaining) { | |
Log.v("WeatherActivity", "It's raining, better bring an umbrella."); | |
} else { | |
Log.v("WeatherActivity", "It's unlikely to rain."); | |
} | |
Log.v("WeatherActivity", "Thank you for using the WhetherWeather App."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isRaining = false; | |
Log.v("WeatherActivity", "Thank you for using the WhetherWeather App."); | |
if (isRaining) { | |
Log.v("WeatherActivity", "It's raining, better bring an umbrella."); | |
} else { | |
Log.v("WeatherActivity", "It's unlikely to rain."); | |
} |