Description: I've an activity with bottom navigation and one framelayout (to inflate fragments).
When I inflate the second fragment, it has an TabLayout, every screen has the background tinted with theme accent color. It's not happening with just one or more fragments, includes activities openned later too.
Other scenario: I open XActivity. Everything is fine. I inflate the fragment (that have the tablayout) and open the same XActivity, now the background is tinted.
Source code: When I got this problem I started to remove every screen element and customization (after review styles, manifest etc) and I discovered the problem is happening with one specific property, app:tabIndicator.
Material Library version: com.google.android.material:material:1.2.0-alpha04 and happening too with com.google.android.material:material:1.2.0-alpha03. I didn't tested other versions.
Device: Happen in any device such as Asus Zenfone 5Z, Motorola Moto G5, Simulator etc.
Solution: Remove property app:tabIndicator from XML and set programmatically in Kotlin/Java. E.g.: binding.tabLayout.setSelectedTabIndicatorColor(ContextCompat.getColor(activity as Context, android.R.color.white))
Description: I've an activity with bottom navigation and one framelayout (to inflate fragments). When I inflate the second fragment, it has an TabLayout, every screen has the background tinted with theme accent color. It's not happening with just one or more fragments, includes activities openned later too.
Other scenario: I open XActivity. Everything is fine. I inflate the fragment (that have the tablayout) and open the same XActivity, now the background is tinted.
Source code: When I got this problem I started to remove every screen element and customization (after review styles, manifest etc) and I discovered the problem is happening with one specific property,
app:tabIndicator
.Android API version: compileSDK, targetSDK = 29 ; minSDK = 21
Material Library version: com.google.android.material:material:1.2.0-alpha04 and happening too with com.google.android.material:material:1.2.0-alpha03. I didn't tested other versions.
Device: Happen in any device such as Asus Zenfone 5Z, Motorola Moto G5, Simulator etc.
Solution: Remove property
app:tabIndicator
from XML and set programmatically in Kotlin/Java. E.g.:binding.tabLayout.setSelectedTabIndicatorColor(ContextCompat.getColor(activity as Context, android.R.color.white))