Skip to content

Commit 4f6ae4c

Browse files
Fix compile: read colorPrimary/colorError from appcompat R.attr
Those two attributes are declared by appcompat, not by the Material library's R.attr (unlike the Material3 surface roles), so com.google.android.material.R.attr .colorPrimary/.colorError don't resolve. Read them from androidx.appcompat.R.attr.
1 parent ee85859 commit 4f6ae4c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎controller/app/src/main/java/org/iiab/controller/redesign/FqrController.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ public FqrController(Activity activity, WebView webView) {
115115
this.cSurfaceHighest = attr(com.google.android.material.R.attr.colorSurfaceContainerHighest, 0xFF223029);
116116
this.cOnSurface = attr(com.google.android.material.R.attr.colorOnSurface, Color.WHITE);
117117
this.cOnSurfaceVariant= attr(com.google.android.material.R.attr.colorOnSurfaceVariant, 0xFF8FA39B);
118-
this.cPrimary = attr(com.google.android.material.R.attr.colorPrimary, 0xFF4CAF7D);
119-
this.cError = attr(com.google.android.material.R.attr.colorError, 0xFFE05353);
118+
// colorPrimary/colorError are declared by appcompat (not the Material R.attr), unlike the
119+
// Material3-specific surface roles above; read them from the appcompat namespace.
120+
this.cPrimary = attr(androidx.appcompat.R.attr.colorPrimary, 0xFF4CAF7D);
121+
this.cError = attr(androidx.appcompat.R.attr.colorError, 0xFFE05353);
120122
}
121123

122124
private int attr(int attrId, int fallback) {

0 commit comments

Comments
 (0)