jskubick

jskubick

Kotlin and Android Development featuring Jetpack: android:tint vs app:tint (chapter 7, p186)

I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint.

How to replicate:

  1. load chapter-7 from zipfile into Android Studio

  2. view layout_coin_slot.xml

  3. Notice that Android Studio is complaining about android:tint="@color/coin_slot_color" in the coin slot’s ImageView

Changing it to app:tint="@color/coin_slot_color" fixes it.

The code in the zipfile is consistent with the code in the text… but both are actually wrong (at least, as far as ArcticFox in October 2021 is concerned) and the prefix has to be changed in order to successfully compile.

I think adding the dependency on com.google.android.material on p179 is what caused the use of android:tint to break in chapter 7 (because it worked just fine in chapter 6). I’m not 100% sure, but it looks like Google’s original implementation of the Material library had a bug, and they later decided to fix it in a way that caused any code that used the original syntax (with the ‘android’ prefix) to break.

Due to the namespace change for app:tint, the section about changing the other two Views becomes confusing.

The ImageView needs app:tint="@color/coin_slot_color", but the View needs android:backgroundTint="@color/coin_slot_color", and the TextView needs android:textColor="@color/coin_slot_color"

Popular Prag Prog topics Top

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
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
joepstender
The generated iex result below should list products instead of product for the metadata. (page 67) iex> product = %Product{} %Pento....
New
alanq
This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_ST...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
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
PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
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: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
New

Latest in PragProg

View all threads ❯