Skip to content

Commit

Permalink
[M3][Color] Fix harmonization demo bug
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 538259732
  • Loading branch information
Material Design Team authored and afohrman committed Jun 6, 2023
1 parent 16c1575 commit 836c51e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions catalog/java/io/material/catalog/color/ColorGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ private ColorGrid(
this.materialColorSpecOnAccentContainer = materialColorSpecOnAccentContainer;
}

View renderView(Context context, ViewGroup container) {
View renderView(LayoutInflater layoutInflater, ViewGroup container) {
View catalogColorsGrid =
LayoutInflater.from(context)
.inflate(R.layout.cat_colors_grid, container, /* attachToRoot= */ false);
layoutInflater.inflate(R.layout.cat_colors_grid, container, /* attachToRoot= */ false);

bindColorSpecItem(catalogColorsGrid, R.id.cat_color_accent, materialColorSpecAccent);
bindColorSpecItem(catalogColorsGrid, R.id.cat_color_on_accent, materialColorSpecOnAccent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void createColorGridAndPopulateLayout(
@IdRes int layoutId) {
ColorGrid colorGrid = createColorGrid(context, colorHarmonizationGridRowData);
LinearLayout layout = demoView.findViewById(layoutId);
layout.addView(colorGrid.renderView(context, layout));
layout.addView(colorGrid.renderView(getLayoutInflater(), layout));
}

private ColorGrid createColorGrid(
Expand Down

0 comments on commit 836c51e

Please sign in to comment.