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

Practice problems Unit 2 Pathway 1: Android Basics with Compose #153

Open
HuberPablo opened this issue Aug 21, 2024 · 0 comments
Open

Practice problems Unit 2 Pathway 1: Android Basics with Compose #153

HuberPablo opened this issue Aug 21, 2024 · 0 comments

Comments

@HuberPablo
Copy link

A ---
name: Practice problems unit 2 pathway 1 issue template
about: Issue template for Unit 1 | Pathway 1 | Practice Problems
title: 'Practice problems Unit 2 Pathway 1: Android Basics with Compose'
labels: ''
assignees: ''


URL of codelab

in Solution Code of the exercice Foldable phones, is correct but not complete as if we add "newFoldablePhone.fold()
newFoldablePhone.checkPhoneScreenLight()" the result is wrong because the solution didn't take into account that we can try to fold the phone

**by not overidding the chechPhoneScreenLight() if we do "
newFoldablePhone.switchOn()
newFoldablePhone.checkPhoneScreenLight()

newFoldablePhone.unfold()
newFoldablePhone.switchOn()
newFoldablePhone.checkPhoneScreenLight()

newFoldablePhone.fold()
newFoldablePhone.checkPhoneScreenLight()"

it will output:"The phone screen's light is off.
The phone screen's light is on.
The phone screen's light is on."

When it should output:
"The phone screen's light is off.
The phone screen's light is on.
The phone screen's light is off."

Steps to reproduce?
we should add "override fun checkPhoneScreenLight() {
val phoneScreenLight = if (isScreenLightOn && isPhoneFolded == false) "on" else "off"
println("The phone screen's light is $phoneScreenLight.")
}" or something like that to make the code work

Versions
Android Studio version:
API version of the emulator:

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

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

1 participant