Skip to content

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

Open
@HuberPablo

Description

@HuberPablo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions