Coder Social home page Coder Social logo

basic-android-kotlin-compose-training-dice-roller's Introduction

Create an interactive dice roller app - Solution Code

Solution code for the Android Basics with Compose: Create an interactive dice roller app.

Introduction

In this codelab, you will build out the Dice Roller app from start to finish using Compose.

Pre-requisites

You need to know:

  • How to create a new project in Android Studio
  • How to build a basic layout with Compose.
  • How to write control flow statements (if / else, when statements).

Getting Started

  1. Download and run the app.

basic-android-kotlin-compose-training-dice-roller's People

Contributors

angiesasmita avatar johnshea avatar osuleymanova avatar owenscott-gds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

basic-android-kotlin-compose-training-dice-roller's Issues

Art Space app: Android Basics in Compose

URL of codelab

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

Describe the problem

NEVERMIND! I figured it out! Thanks a lot!

Screen Shot 2022-07-09 at 1 05 21 PM

Now....next question......how do I click to the other 3 pieces of art? It didn't discuss that, so I am confused on that one.

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.

Art Space app: Android Basics in Compose----------------HELP WITH PUTTING BUTTON IN CORRECT SPOT

URL of codelab

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

**1. I have the button on the app main screen but for some reason, it is UNDERNEATH the 1st piece of artwork. I want it to be underneath, Year: 2022. Do I have my button code in the wrong spot? Where does it go, because I tried everything.*.

2 screen shots below
Screen Shot 2022-07-08 at 2 04 14 PM

Screen Shot 2022-07-08 at 2 04 30 PM

Describe the problem

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.

Create an interactive Dice Roller app: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
"Create The Layout Infrastructure"

Describe the problem
Several code errors jumping between similar named functions, the described action does not match the code displayed, or the solution code

Steps to reproduce?
Follow tutorial

Versions
Android Studio version:
API version of the emulator:

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

Write conditionals in Kotlin: Android Basics with Compose

URL of codelab

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

Describe the problem

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.

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#8

In which task and step of the codelab can this issue be found?
Step 9

Describe the problem
There is a typo on line 11 in the Mobile notifications solution code. noOfMessages should be numberOfMessages.

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.

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#1

In which task and step of the codelab can this issue be found?
2. Mobile notifications

Describe the problem

  • The exact number of notifications when there are less than 100 notifications.
  • 99+ as the number of notifications when there are more than 100 notifications.

As you can see the case when there are exactly 100 notifications isn't handled in the request.

Create an interactive Dice Roller app: Android Basics with Compose

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-build-a-dice-roller-app?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-build-a-dice-roller-app#7

Describe the problem
Adopting the remember function throws an error.
to import
So, one should import the followings.

import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue

I thought you might have omitted it because that is so obvious, but the next course explicitly directs the user to import the libraries.

I think you should:

  1. Direct the user to import the libraries at first, then omit on the next uses.
  2. Direct the user to import the libraries all the time.

Instead of omitting it at first, then mention it on a later course.

Create an interactive Dice Roller app: Android Basics with Compose

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-build-a-dice-roller-app

In which task and step of the codelab can this issue be found?
4. Create the layout infrastructure
Restructure the sample code

Describe the problem
Current text:
Because you removed the Greeting() function, the call to Greeting("Android") in the DiceWithImageButton() function is highlighted red.

Expected text:
Because you removed the Greeting() function, the call to Greeting("Android") in the Greeting() function is highlighted red.

Note: DiceWithImageButton is not a function. Greeting is the default function that needs to be deleted.

Steps to reproduce?

  1. Create a new Jetpack Compose starter project in Android Studio
  2. Open Main Activity and remove the Greeting function
  3. See that the call to the now deleted function in setContent is red. This is the line the doc is trying to tell the user to delete.

Versions
Android Studio version: Android Studio Dolphin | 2021.3.1 Patch 1 Build #AI-213.7172.25.2113.9123335, built on September 29, 2022
API version of the emulator: n/a

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

Art Space app: Android Basics in Compose

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

In which task and step of the codelab can this issue be found?
1. Before you begin

Describe the problem
For some reason I'm supposed to know what your NFT collections means?

What you'll build

    An Android app that can display artwork, family photos, or even your NFT collections!

Google is my friend, so:

What does NFT mean?
Image result for NFT
non-fungible token
NFT stands for "non-fungible token." At a basic level, an NFT is a digital asset that links ownership to unique physical or digital items, such as works of art, real estate, music, or videos. NFTs can be considered modern-day collectibles.Jul 12, 2022

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#3

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

Describe the problem
in function

fun printFinalTemperature(
initialMeasurement: Double,
initialUnit: String,
finalUnit: String,
conversionFormula: (Double) -> Double
) {
val finalMeasurement = String.format("%.2f", conversionFormula(initialMeasurement)) // two decimal places
println("$initialMeasurement degrees $initialTemperature is $finalMeasurement degrees $finalTemperature.")
}

The arguments are initialUnit and finalUnit, but the println function uses initialTemperature and finalTemperature.

Steps to reproduce?

  1. Go to...
    fun main() {
    // I wrote the main code myself.
    val celsiusToFahrenheit: (Double) -> Double = { it*9/5 + 32}
    val KelvinToCelsius: (Double) -> Double = { it - 273.15}
    val FahrenheitToKelvin: (Double) -> Double = {(it-32)*5/9 + 273.15}

    printFinalTemperature(27.0, "Celsius", "Fahrenheit", celsiusToFahrenheit)
    printFinalTemperature(350.0, "Kelvin", "Celsius", KelvinToCelsius)
    printFinalTemperature(10.0, "Fahrenheit", "Kelvin", FahrenheitToKelvin)
    }

fun printFinalTemperature(
initialMeasurement: Double,
initialUnit: String,
finalUnit: String,
conversionFormula: (Double) -> Double
) {
val finalMeasurement = String.format("%.2f", conversionFormula(initialMeasurement)) // two decimal places
println("$initialMeasurement degrees $initialTemperature is $finalMeasurement degrees $finalTemperature.")
}

  1. See error

Unresolved reference: initialTemperature
Unresolved reference: finalTemperature

Versions
Android Studio version:
API version of the emulator:

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

Broken images in "Write conditionals in Kotlin: Android Basics with Compose" Codelab

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

In which task and step of the codelab can this issue be found?
Task 3

Describe the problem
Multiple images near the end of the task do not render properly, dumping raw HTML into the page.

Steps to reproduce?

  1. Go to codelab
  2. Scroll to end of Task 3
  3. See that images aren't loading properly

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

Screen Shot 2022-11-17 at 10 32 41 AM

Screen Shot 2022-11-17 at 10 33 00 AM

Create an interactive Dice Roller app: Android Basics with Compose

URL of codelab

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

compile error ----- Type 'MutableState' has no method 'setValue(Nothing?, KProperty<*>, Int)' and thus it cannot serve as a delegate for var (read-write property)

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.

Art Space app: Android Basics in Compose

URL of codelab

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

Why does my makeText give a red line in the toast? Sorry for all the questions. This is the last one for a while!

Screen Shot 2022-07-09 at 2 22 57 PM

Describe the problem

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.

Art Space app: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
4. Challenge: Build for different screen sizes (Chapter)

Describe the problem
Typo. Several times word 'table' was used instead of 'tablet'.

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.

Practice problems Unit 2 Pathway 1: Android Basics

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?hl=es-419#1

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

Describe the problem

Can not use Playground on each exercise to solve the code, it does not start at all or let me do the editing thing.

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.

Create an interactive Dice Roller app: Android Basics with Compose

URL of codelab https://developer.android.com/codelabs/basic-android-kotlin-compose-build-a-dice-roller-app#3

In which task and step of the codelab can this issue be found? Add a Modifier

Describe the problem The @Preview is shown above the fun DiceWithButtonAndImage() and has a parameter. In the solution file, it is positioned above fun DiceRollApp(). Confusing.)

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.

Use the debugger in Android Studio: Android Basics with Compose

in https://developer.android.com/codelabs/basic-android-kotlin-compose-intro-debugger?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-intro-debugger#4

The Note seems incomplete:

Note: The result$delegate variable in the Variables pane refers to the result variable in the code. The $delegate notation is there because the result variable is a remember delegate. But the value

But the value is the last sentence and it's incomplete.

but the value

add a composable Image

URL of codelab

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

Describe the problem

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.

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#3

In which task and step of the codelab can this issue be found?
Task 4 - Temperature Converter

Describe the problem
In the provided code the names of the properties do not match the names used in the println() statement.
initialTemperature should be initialUnit; and;
finalTemperature should be finalUnit.

Steps to reproduce?

  1. Copy code into playground
  2. Complete missing code in main() function - e.g. printFinalTemperature(27.0, "Celsius", "Fahrenheit") {9.0/5.0 * it + 32}
  3. Click on button to run
  4. See errors:

Unresolved reference: initialTemperature
Unresolved reference: finalTemperature

Versions
Android Studio version:
API version of the emulator:

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

Write conditionals in Kotlin: Android Basics in Compose | Korean

Write conditionals in Kotlin: Android Basics with Compose

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-conditionals?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%3Fhl%3Dko&hl=ko#2

In which task and step of the codelab can this issue be found?
Write conditionals in Kotlin, step 3 in Korean version.

Describe the problem
2 images are not shown in Korean version of the codelab.
Following links are the original images of them :
https://developer.android.com/static/codelabs/basic-android-kotlin-compose-conditionals/img/7112edfc7c7b7918_1920.png
https://developer.android.com/static/codelabs/basic-android-kotlin-compose-conditionals/img/bde4eca467c105a2_1920.png
I've drawn a blue line on the error area on the error screenshots below.

Steps to reproduce?

  1. Change language option to Korean
  2. See error...

Versions
Android Studio version:
API version of the emulator:

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

Create an interactive Dice Roller app: Android Basics with Compose

Use nullability in Kotlin: Android Basics in Compose

URL of codelab

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

Describe the problem

That not operator . but operator ?

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.

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?hl=ko&continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%3Fhl%3Dko%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#3

In which task and step of the codelab can this issue be found?
println("$initialMeasurement degrees $initialUnit is $finalMeasurement degrees $finalTemperature.")
$finalTemperature is wrong

Describe the problem
fix the $finalTemperature to $finalUnit

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.

Art Space app: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
Last Step, comparing my solution to that of developers

Describe the problem
Can the code for the Artspace app get added to a repository so we can see the approach of the development team?

Steps to reproduce?
NA

Versions
NA

Additional information
NA

Create an interactive Dice Roller app: Android Basics with Compose

URL of codelab

Create an interactive Dice Roller app

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

In step 4 of the codelab, section: Add a modifier

Describe the problem

The code sample incorrectly contains the @Preview annotation.

@Preview(showBackground = true)
@Composable 
fun DiceWithButtonAndImage(modifier: Modifier = Modifier) {
}

The annotation actually belongs to the DiceRollerApp function as shown in the previous section:

@Preview
@Composable
fun DiceRollerApp() {

}

@Composable
fun DiceWithButtonAndImage() {

}

Steps to reproduce?

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

Versions
Android Studio version:
API version of the emulator:

Additional information

The issue is not present in the actual solution code:

@Preview
@Composable
fun DiceRollerApp() {
DiceWithButtonAndImage(modifier = Modifier
.fillMaxSize()
.wrapContentSize(Alignment.Center)
)
}
@Composable
fun DiceWithButtonAndImage(modifier: Modifier = Modifier) {

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?authuser=2&continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%3Fauthuser%3D2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#8

In which task and step of the codelab can this issue be found?
9. Code de solution
Enchère spéciale
Le code

Describe the problem
Curly braces are missing
And the function auctionPrice() doesn't work

Versions
Android Studio version: -
API version of the emulator: -

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

Write conditionals in Kotlin: Android Basics with Compose

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

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

Describe the problem

Steps to reproduce?

  1. Go to Language -> Portuguese
  2. Click on Usar uma instrução when para várias ramificações
  3. See error no sétimo ponto, onde fala sobre o else do when

Versions
Android Studio version:
API version of the emulator:

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

Practice problems Unit 2 Pathway 1: Android Basics with Compose

A ---
name: Practice Kotlin Fundamentals
about: Error in the Solution Section 9 .
(Error in Special Auction Solution )


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

In which task and step of the codelab can this issue be found?
Task :- Error in the Solution Section 9 .
(Error in Special Auction Solution )
line number :- 4 and 5

Describe the problem
The auctionPrice method is not accessed directly without using the object of the class Bid.

Solution
Using the object of the class 'winningBid' that is created inside the main method to access the auctionPrice method as :
println("Item A is sold at ${winningBid.auctionPrice(winningBid, 2000)}.")
println("Item B is sold at ${winningBid.auctionPrice(null, 3000)}.")

Versions
Android Studio version:
API version of the emulator:

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

Use function types and lambda expressions in Kotlin: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
On Step Number 4 | Use functions as a data type

Describe the problem
Each of the steps of this codelab is almost 20 minutes long according to the mins remaining shown above, except for the Step 4. While doing the Step 4, 24 mins are remaining, and after finishing that and moving on to the Step 5, 23 mins are remaining. This might be a really small bug but I think it takes more than 1 minute to go through Step 4.

Steps to reproduce?

  1. Go the codelab
  2. Select Step 4 and check the time remaining
  3. Now press Next
  4. Check the time remaining for the Step 5

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

image

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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'


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

In which task and step of the codelab can this issue be found?
Practice: Kotlin Fundamentals -> 4. Temperature converter

Describe the problem
The Korean translation is wrong.

Korean Ver. (Incorrect)
println("$initialMeasurement degrees $initialTemperature is $finalMeasurement degrees $finalTemperature.")

English Ver.
println("$initialMeasurement degrees $initialUnit is $finalMeasurement degrees $finalUnit.")

Additional information
image
image

Use nullabillity in Kotlin

The prerequisites of this codelab mention "knowledge of Kotlin classes, including how to access methods and properties from a variable ". The codelab featuring classes and such doesn't come for later on in the course (it's actually the next lesson). Perhaps these two lessons should be swapped places so the prerequisites for Use Nullabillity in Kotlin can be met effectively?

Screenshot_2022-09-28-01-53-54.png

(Prerequisites for Use Nullabillity in Kotlin. Note 3rd item)

Screenshot_2022-09-28-01-55-55.png

(Codelabs in current order)

Use function types and lambda expressions in Kotlin: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
Nullable function types, step 3

Describe the problem
the lambda is replaced with null, but the code path executed never touches the lambda provided because the change is made when isTrick has a true value. If instead coins is replaced by null the check for if (extraTreat != null) { will be executed because isTrick is false.

Steps to reproduce?

  1. with this implementation of trickOrTreat
fun trickOrTreat(isTrick: Boolean, extraTreat: ((Int) -> String)?): () -> Unit {
    if (isTrick) {
        return trick
    } else {
        if (extraTreat != null) {
            println(extraTreat(5))
        }
        return treat
    }
}
  1. the main function should containing something like:
    val treatFunction = trickOrTreat(false, null)
    val trickFunction = trickOrTreat(true, cupcake)

Versions
Android Studio version:
API version of the emulator:

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

[Question] Lemon App // Create an interactive Dice Roller app: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
in the solution code of the Lemonade App

Describe the problem
No problem, but may I ask two questions ? if not, close&ignore this and please tell me where should I ask such questions.

  1. How can you add a Text in step 2(lemon squeeze), hopefully using a Column, centered below the lemon image that shows Taps left: N without modifying the LemonTextAndImage(...) function contents ?

I tried to use a Column but because there's a modifier=modifier.fillMaxSize() inside LemonTextAndImage it occupies the whole screen, so my Text is outside the screen / invisible.
(curiously though, modifier = modifier.fillMaxSize(0.9f) kind of works: at least my text isn't invisible below the screen like with 1f would)

In the following screenshot I tried using a Box but the vertical centering is a hack(because I wouldn't know where on the screen the lemon image ends, vertically) that only works well on the preview (see Taps left: 0 there) but not on any other device (because of screen sizes difference) like in the emulator (see Taps left: 6 there).

  1. Is it possible to vertically center the Text so that it's just beneath the lemon image(and its included border), when using Box, that works on any device ? (this probably means, you've a way to detect where the lemon image ends(vertically) and place the Text right beneath that ?)

Versions
Android Studio version:
Android Studio Chipmunk | 2021.2.1 Patch 1
Build #AI-212.5712.43.2112.8609683, built on May 18, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.17.15-gentoo-x86_64
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46)
Current Desktop: LXQt
API version of the emulator:
31.2.10-8420304

Additional information
Include screenshots if they would be useful in clarifying the problem.
hackyBoxverticalcenter_screen-2022-07-19-20-51-35

Art Space app: Android Basics in Compose-----------help please!!

URL of codelab

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

Describe the problem
It keeps saying....... Expecting ')' and expecting '}', but I have no clue where another on is supposed to go. I tried putting it everywhere and I can't clear the error.

Please where am I missing so I can move on please? Screen shot below

Screen Shot 2022-07-04 at 6 20 29 AM

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.

Create an interactive Dice Roller app: Android Basics with Compose

Type of issue
Wrong/misleading explanation for correct instruction.

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-build-a-dice-roller-app

In which task and step of the codelab can this issue be found?
Task: 5. Create a vertical layout
Step: Pass a horizontalAlignment parameter to the Column() function and then set it to an Alignment.CenterHorizontally value.

Describe the problem
The explanation for this step's instruction (mentioned above) states:
This ensures that the column is centered on the device screen with respect to the width.

This, however, is not quite what the column's horizontalAlignment parameter actually does here, so maybe change to:
This ensures that the column's children are centered horizontally within the column (which, itself, is already centered horizontally and vertically on the screen).

Cheers!

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.

Use the debugger in Android Studio: Android Basics with Compose

In 5th Section :

Use the debugger -> Use the Step Into button -> follow these steps: -> Step 2

Click a4737e06791f5bbf.png Debug ‘app' to rerun the app with the debugger. The execution suspends at the line where the DiceRollerApp() function is called.

return instead of rerun
image

Use nullability in Kotlin: Android Basics in Compose

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

In which task and step of the codelab can this issue be found?
Handle Nullable Variables

Describe the problem
Inside "Use the ?. safe-call operator", 7th line, the item 1 says:
"In the println() statement, replace the . operator with the ?. safe-call operator:"

I believe the correct is "In the println() statement, add the ?. safe-call operator before the . operator:"

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.

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?hl=ko&continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%3Fhl%3Dko%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#3

In which task and step of the codelab can this issue be found?
println("$initialMeasurement degrees $initialUnit is $finalMeasurement degrees $finalTemperature.")

Describe the problem
println("$initialMeasurement degrees $initialUnit is $finalMeasurement degrees $finalTemperature.")
to
println("$initialMeasurement degrees $initialUnit is $finalMeasurement degrees $finalUnit.")

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.

Use function types and lambda expressions in Kotlin: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
4:" Use Functions as Data Types" 5th line "Call the trickFunction()..."0

Describe the problem
backward code from what is written in text description
fun main() {
val treatFunction = trickOrTreat(false)
val trickFunction = trickOrTreat(true)
*** treatFunction()
trickFunction() ***
}
Should be:
fun main() {
val treatFunction = trickOrTreat(false)
val trickFunction = trickOrTreat(true)

*** trickFunction()
treatFunction() ***
}

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.

Write conditionals in Kotlin: Android Basics with Compose

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

In which task and step of the codelab can this issue be found?
Use the in keyword for a range of conditions

Describe the problem
wrong image display

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

Use nullability with Kotlin: Android Basics in Compose

URL of codelab

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

Describe the problem
It seems that the final section that introduces the Elvis "?:", fails to have one final screen to show how it handles and assigns for a "null" value.

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.

Create an interactive Dice Roller app: Android Basics with Compose

URL of codelab

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

6

Describe the problem

You have a commented out TODO which is assumed is the Kotlin TODO function which throws an exception. As a consequence, the rendering doesn't work.

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.

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%3Fhl%3Den%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems&hl=en#3

In which task and step of the codelab can this issue be found?
4. Temperature Converter

Describe the problem
The problem provides 3 formulas, see below:
Celsius to Fahrenheit: ° F = 9/5 (° C) + 32
Kelvin to Celsius: ° C = K - 273.15
Fahrenheit to Kelvin: K = 5/9 (° F - 32) + 273.15

After finishing the whole exercise, 2 problems are reported in the first and third formula:

  • Expression '5' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found
  • Expression '9' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found

With my limited knowledge the only way that I found to solve the question and run the code was changing the formula to:
val celsius2Fah: (Double) -> Double = { 1.8 * celsiusTemp + 32 }
val kelvin2Celsius: (Double) -> Double = { kelvinTemp - 273.15 }
val fah2Kelvin: (Double) -> Double = { (5 * (fahTemp - 32)) / 9 + 273.15 }

Maybe providing the formulas in a different way could make the solution more approachable:
F = 1.8 * C + 32
C = K - 273.15 }
K = (5 * (F - 32)) / 9 + 273.15

Thank you.

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.

Write conditionals in Kotlin: Android Basics in Compose

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

In which task and step of the codelab can this issue be found?
println("x is a prime number between 1 and 10.") 줄은 사례 1로 주석을 답니다. in 1..10 -> println("x is a number between 1 and 10, but not a prime number.") 줄은 사례 2로 주석을 답니다. else -> println("x isn't a prime number between 1 and 10.") 줄은 사례 3으로 주석을 답니다. " class="l10n-absolute-url-src" l10n-attrs-original-order="alt,style,src,class" l10n-encrypted-style="Bfmtwp4MR0V5uTC1s3uklU8zz2uYoEmRhrQeP6/mnhY=" src="https://developer.android.com/codelabs/basic-android-kotlin-compose-conditionals/img/bde4eca467c105a2.png" style="width: 624.00px" />

Describe the problem
only text, can't see image

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.

Practice problems Unit 2 Pathway 1: Android Basics with Compose

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
https://developer.android.com/codelabs/basic-android-kotlin-compose-kotlin-fundamentals-practice-problems?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-kotlin-fundamentals-practice-problems#8

In which task and step of the codelab can this issue be found?
The temperature conversion solution code

Describe the problem
In the temperature conversion solutions code, there was an issue that I uncovered. During the process of the (5/9) division, either the solution code MUST use decimal places or the toDouble() casting function. Otherwise the 5/9 results in 0 due to integer truncation. This results in the code then multiplying by 0 until adding the 273.15.

It would be helpful if someone made a note/hint somewhere in the assignment of the problem, or in the solution that one would need to ensure that the code uses decimal places as the posted solution does, or that the toDouble() cast needs to be used, otherwise the error can be hard for a new programmer to trace.

Steps to reproduce?
Don't use decimal places. Use the function as close as possible to the way it's written in the assignment.

Versions
Playground

Additional information
I know it's a nitpick, but for someone just learning how to code, something this simple can be REALLY frustrating, especially when the difference in what needs to be done to fix their code isn't obvious. Depending on the person, something this simple could be just enough of a roadblock to discourage them from continuing in their journey.

This is also a good teaching moment for them to learn that logic errors are sometimes the most infuriating to trace down, and sometimes require thinking a little outside of the box.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.