Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions in Kotlin: Android Basics in Compose #31

Closed
MasoudBB opened this issue Jun 30, 2022 · 1 comment
Closed

Functions in Kotlin: Android Basics in Compose #31

MasoudBB opened this issue Jun 30, 2022 · 1 comment
Assignees

Comments

@MasoudBB
Copy link

MasoudBB commented Jun 30, 2022

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-functions?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-1-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-functions#5

In which task and step of the codelab can this issue be found?
named arguments

Describe the problem

function definition:
fun birthdayGreeting(name: String, age: Int): String {
val nameGreeting = "Happy Birthday, $name!"
val ageGreeting = "You are now 5 years old!"
return "$nameGreeting\n$ageGreeting"
}

statement in main:

println(birthdayGreeting(name = "Rex", age = 2))

output:

Happy Birthday, Rex! You are now 2 years old!

output should be:

Happy Birthday, Rex!
You are now 2 years old!

or you should eliminate \n in this stateement:

return "$nameGreeting\n$ageGreeting"

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

@osuleymanova osuleymanova self-assigned this Jul 21, 2022
@osuleymanova
Copy link
Contributor

@MasoudBB
Thank you for reaching out to us. The typo is fixed and published:

Screen Shot 2022-07-25 at 3 02 29 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants