google-developer-training / android-fundamentals-apps-v2

Other
649 stars 2.63k forks source link

The basic layout does not produce two layouts anymore. The codelab content needs to be updated. #234

Closed uzbeki closed 1 year ago

uzbeki commented 3 years ago

Describe the problem Android fundamentals 04.1: Clickable images codelab needs to be updated. It says:

The project opens with two layouts in the res > layout folder: activity_main.xml for the app bar and floating action button (which you don't change in this task), and content_main.xml for everything else in the layout.

But, the current version of the Android Studio creates 4 layouts: activity_main.xml, content_main.xml, fragment_first.xml and fragment_second.xml. Thus, the rest of the codelab is incorrect. This is the problem.

In which lesson and step of the codelab can this issue be found? Android fundamentals 04.1: Clickable images + Task 1: Add Images to the layout.

How to reproduce?

  1. Go to the codelab link
  2. Go to Task 1: Add Images to the layout
  3. Create a new project in the Android Studio

Versions

  1. What version of Android Studio are you using?

Android Studio 4.1.1 Build #AI-201.8743.12.41.6953283, built on November 5, 2020 Runtime version: 1.8.0_242-release-1644-b01 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1246M Cores: 4 Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true Non-Bundled Plugins: org.jetbrains.kotlin

  1. What API level are you targeting?

    minSdkVersion - 19 Compile SDK version - 30 Build Tools Version- 30.0.3 Gradle Version - 6.5 Kotlin version - 1.4.21

Additional information Here is the layout image: created layout screenshot

here is how the app looks right after the project creation: app

codelab: android-fundamentals

zakacat commented 3 years ago

I was running into the same problem and I was able to go thru 4.5 RecyclerView by altering the Basic Activity on start up. Mine also started with fragment files that I hardly know how to use and also a navigation layout which I have yet to even use. I deleted these on start up:

-FirstFragment.java -SecondFragment.java -fragment_first.xml -fragment_second.xml -the navigation folder in res. (which contains only nav_graph.xml) -the nav fragment layout in content_main.xml

This left me with a single activity with 2 layout files that housed a FAB button and a toolbar/appbar.

I was able to go through 4.5 with no problems.