Bug 1414084 - Part 17 - Fix setting of private browsing theme state. r?grisha
Previously, this wasn't noticeable since adding/removing a PageAction would call
refreshPageActionIcons(), which would do the correct thing, but now a newly
created PageActionLayout can start with an already pre-populated mPageAction-
List, which means that the subsequently arriving call to setPrivateMode() will
erroneously activate the private mode tinting for all PageActions that support
it.
MozReview-Commit-ID: EvNx1Q9vwZ5
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/PageActionLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/PageActionLayout.java
@@ -121,17 +121,17 @@ public class PageActionLayout extends Th
}
@Override
public void setPrivateMode(boolean isPrivate) {
super.setPrivateMode(isPrivate);
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof ThemedImageButton) {
- ((ThemedImageButton) child).setPrivateMode(true);
+ ((ThemedImageButton) child).setPrivateMode(isPrivate);
}
}
}
private void setNumberShown(int count) {
ThreadUtils.assertOnUiThread();
mMaxVisiblePageActions = count;