jskubick

jskubick

Kotlin and Android Development featuring Jetpack: omitted change for bottomNav val (page 190)

I’m not sure whether I just overlooked it somewhere prior to page 190, but when I got to page 190 and added the code at the bottom of the page to create AppBarConfiguration(bottomNav.menu), I got an error because bottomNav was never defined.

After comparing my MainActivity.kt to the one from chapter 7 of the zipfile, I noticed that the zipfile changed

findViewById<BottomNavigationView>(R.id.bottom_nav).setupWithNavController(this.navController)

to

val bottomNav = findViewById<BottomNavigationView>(R.id.bottom_nav) bottomNav.setupWithNavController(this.navController)

It’s entirely possible you mentioned it earlier in the book & I just overlooked it. (Sigh… I wish publishers would bundle codes for free copies of the ebook with printed copies, or work out something with Amazon like, “buy the printed book, immediately get the Kindle version free”. Ebooks suck for actual reading, but they occasionally come in handy as super-indexes that can be brute-force searched for situations like this.)


I also noticed a minor issue with the way the penny_drop_created_by entry in strings.xml is encoded… the double quotes around the book’s title need to be backslash-escaped, or they won’t be printed:

<string name="penny_drop_created_by">The <i>Penny Drop</i> app was created by Michael Fazio for the Pragmatic Bookshelf title <a href="https://pragprog.com/titles/mfjetpack/">\"Kotlin and Android Development featuring Jetpack\"</a>.</string>

As an aside, for your own future projects, you might want to check out https://noties.io/Markwon as a convenient alternative to SpannableString. I discovered it a few months ago & totally fell in love with it :icon_cool:

First Post!

mfazio23

mfazio23

Author of Kotlin and Android Development featuring Jetpack

Jeff, don’t worry on this one, you’re correct. I forgot to include it in the text.

As far as the strings.xml update, you’re correct. I think I missed it due to the link highlighting.

Also, Markwon looks way nicer, and I’m always in favor of using Markdown syntax!

Popular Pragmatic topics Top

kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
New
johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
oaklandgit
Hi, I completed chapter 6 but am getting the following error when running: thread 'main' panicked at 'Failed to load texture: IoError(O...
New
s2k
Hi all, currently I wonder how the Tailwind colours work (or don’t work). For example, in app/views/layouts/application.html.erb I have...
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New

Other popular topics Top

ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New

Latest in PragProg

View all threads ❯