Loading res/layout/preview_card_color_content.xml +2 −3 Original line number Diff line number Diff line Loading @@ -75,14 +75,13 @@ android:layout_width="@dimen/preview_theme_icon_size" android:layout_height="@dimen/preview_theme_icon_size" android:layout_gravity="center" android:id="@+id/preview_color_qs_2_bg" android:tint="@color/tile_disabled_background_color"/> android:id="@+id/preview_color_qs_2_bg"/> <ImageView android:layout_width="@dimen/preview_theme_tile_size" android:layout_height="@dimen/preview_theme_tile_size" android:layout_gravity="center" android:id="@+id/preview_color_qs_2_icon" android:color="@color/tile_disabled_icon_color"/> android:color="@color/tile_enabled_icon_color"/> </FrameLayout> </LinearLayout> <Space Loading res/layout/preview_card_cover_content.xml +2 −3 Original line number Diff line number Diff line Loading @@ -67,13 +67,12 @@ <ImageView android:layout_width="@dimen/preview_theme_icon_size" android:layout_height="@dimen/preview_theme_icon_size" android:id="@+id/preview_color_qs_2_bg" android:tint="@color/tile_disabled_background_color"/> android:id="@+id/preview_color_qs_2_bg"/> <ImageView android:layout_width="@dimen/preview_theme_tile_size" android:layout_height="@dimen/preview_theme_tile_size" android:id="@+id/preview_color_qs_2_icon" android:color="@color/tile_disabled_icon_color" android:tint="@color/tile_enabled_icon_color" android:layout_gravity="center"/> </FrameLayout> Loading src/com/android/customization/model/theme/custom/ColorOptionsProvider.java +0 −3 Original line number Diff line number Diff line Loading @@ -81,9 +81,6 @@ public class ColorOptionsProvider extends ThemeComponentOptionProvider<ColorOpti } for (String iconName : ICONS_FOR_PREVIEW) { try { if (previewIcons.size() == COLOR_TILES_ICON_IDS.length) { break; } previewIcons.add(loadIconPreviewDrawable(iconName, iconPackage)); } catch (NameNotFoundException | NotFoundException e) { Log.w(TAG, String.format("Couldn't load icon in %s for color preview, will skip it", Loading src/com/android/customization/model/theme/custom/ThemeComponentOption.java +12 −5 Original line number Diff line number Diff line Loading @@ -265,9 +265,15 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC private static int[] COLOR_TILE_IDS = { R.id.preview_color_qs_0_bg, R.id.preview_color_qs_1_bg, R.id.preview_color_qs_2_bg }; static int[] COLOR_TILES_ICON_IDS = { R.id.preview_color_qs_0_icon, R.id.preview_color_qs_1_icon, R.id.preview_color_qs_2_icon /** * Ids of the views for the foreground of the icon, mapping to the corresponding index of * the actual icon drawable. */ static int[][] COLOR_TILES_ICON_IDS = { new int[]{ R.id.preview_color_qs_0_icon, 0}, new int[]{ R.id.preview_color_qs_1_icon, 1}, new int[] { R.id.preview_color_qs_2_icon, 3} }; /** Loading Loading @@ -371,14 +377,15 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC seekbar.setOnTouchListener((view, motionEvent) -> true); if (!mIcons.isEmpty() && mShapeDrawable != null) { for (int i = 0; i < COLOR_TILE_IDS.length; i++) { Drawable icon = mIcons.get(i).getConstantState().newDrawable(); Drawable icon = mIcons.get(COLOR_TILES_ICON_IDS[i][1]).getConstantState() .newDrawable(); //TODO: load and set the shape. Drawable bgShape = mShapeDrawable.getConstantState().newDrawable(); bgShape.setTint(accentColor); ImageView bg = container.findViewById(COLOR_TILE_IDS[i]); bg.setImageDrawable(bgShape); ImageView fg = container.findViewById(COLOR_TILES_ICON_IDS[i]); ImageView fg = container.findViewById(COLOR_TILES_ICON_IDS[i][0]); fg.setImageDrawable(icon); } } Loading src/com/android/customization/picker/theme/CustomThemeNameFragment.java +4 −2 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ public class CustomThemeNameFragment extends CustomThemeStepFragment { private int[] mColorTileIds = { R.id.preview_color_qs_0_bg, R.id.preview_color_qs_1_bg, R.id.preview_color_qs_2_bg }; private int[] mColorTileIconIds = { R.id.preview_color_qs_0_icon, R.id.preview_color_qs_1_icon, R.id.preview_color_qs_2_icon private int[][] mColorTileIconIds = { new int[]{ R.id.preview_color_qs_0_icon, 0}, new int[]{ R.id.preview_color_qs_1_icon, 1}, new int[] { R.id.preview_color_qs_2_icon, 3} }; private int[] mShapeIconIds = { Loading Loading
res/layout/preview_card_color_content.xml +2 −3 Original line number Diff line number Diff line Loading @@ -75,14 +75,13 @@ android:layout_width="@dimen/preview_theme_icon_size" android:layout_height="@dimen/preview_theme_icon_size" android:layout_gravity="center" android:id="@+id/preview_color_qs_2_bg" android:tint="@color/tile_disabled_background_color"/> android:id="@+id/preview_color_qs_2_bg"/> <ImageView android:layout_width="@dimen/preview_theme_tile_size" android:layout_height="@dimen/preview_theme_tile_size" android:layout_gravity="center" android:id="@+id/preview_color_qs_2_icon" android:color="@color/tile_disabled_icon_color"/> android:color="@color/tile_enabled_icon_color"/> </FrameLayout> </LinearLayout> <Space Loading
res/layout/preview_card_cover_content.xml +2 −3 Original line number Diff line number Diff line Loading @@ -67,13 +67,12 @@ <ImageView android:layout_width="@dimen/preview_theme_icon_size" android:layout_height="@dimen/preview_theme_icon_size" android:id="@+id/preview_color_qs_2_bg" android:tint="@color/tile_disabled_background_color"/> android:id="@+id/preview_color_qs_2_bg"/> <ImageView android:layout_width="@dimen/preview_theme_tile_size" android:layout_height="@dimen/preview_theme_tile_size" android:id="@+id/preview_color_qs_2_icon" android:color="@color/tile_disabled_icon_color" android:tint="@color/tile_enabled_icon_color" android:layout_gravity="center"/> </FrameLayout> Loading
src/com/android/customization/model/theme/custom/ColorOptionsProvider.java +0 −3 Original line number Diff line number Diff line Loading @@ -81,9 +81,6 @@ public class ColorOptionsProvider extends ThemeComponentOptionProvider<ColorOpti } for (String iconName : ICONS_FOR_PREVIEW) { try { if (previewIcons.size() == COLOR_TILES_ICON_IDS.length) { break; } previewIcons.add(loadIconPreviewDrawable(iconName, iconPackage)); } catch (NameNotFoundException | NotFoundException e) { Log.w(TAG, String.format("Couldn't load icon in %s for color preview, will skip it", Loading
src/com/android/customization/model/theme/custom/ThemeComponentOption.java +12 −5 Original line number Diff line number Diff line Loading @@ -265,9 +265,15 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC private static int[] COLOR_TILE_IDS = { R.id.preview_color_qs_0_bg, R.id.preview_color_qs_1_bg, R.id.preview_color_qs_2_bg }; static int[] COLOR_TILES_ICON_IDS = { R.id.preview_color_qs_0_icon, R.id.preview_color_qs_1_icon, R.id.preview_color_qs_2_icon /** * Ids of the views for the foreground of the icon, mapping to the corresponding index of * the actual icon drawable. */ static int[][] COLOR_TILES_ICON_IDS = { new int[]{ R.id.preview_color_qs_0_icon, 0}, new int[]{ R.id.preview_color_qs_1_icon, 1}, new int[] { R.id.preview_color_qs_2_icon, 3} }; /** Loading Loading @@ -371,14 +377,15 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC seekbar.setOnTouchListener((view, motionEvent) -> true); if (!mIcons.isEmpty() && mShapeDrawable != null) { for (int i = 0; i < COLOR_TILE_IDS.length; i++) { Drawable icon = mIcons.get(i).getConstantState().newDrawable(); Drawable icon = mIcons.get(COLOR_TILES_ICON_IDS[i][1]).getConstantState() .newDrawable(); //TODO: load and set the shape. Drawable bgShape = mShapeDrawable.getConstantState().newDrawable(); bgShape.setTint(accentColor); ImageView bg = container.findViewById(COLOR_TILE_IDS[i]); bg.setImageDrawable(bgShape); ImageView fg = container.findViewById(COLOR_TILES_ICON_IDS[i]); ImageView fg = container.findViewById(COLOR_TILES_ICON_IDS[i][0]); fg.setImageDrawable(icon); } } Loading
src/com/android/customization/picker/theme/CustomThemeNameFragment.java +4 −2 Original line number Diff line number Diff line Loading @@ -63,8 +63,10 @@ public class CustomThemeNameFragment extends CustomThemeStepFragment { private int[] mColorTileIds = { R.id.preview_color_qs_0_bg, R.id.preview_color_qs_1_bg, R.id.preview_color_qs_2_bg }; private int[] mColorTileIconIds = { R.id.preview_color_qs_0_icon, R.id.preview_color_qs_1_icon, R.id.preview_color_qs_2_icon private int[][] mColorTileIconIds = { new int[]{ R.id.preview_color_qs_0_icon, 0}, new int[]{ R.id.preview_color_qs_1_icon, 1}, new int[] { R.id.preview_color_qs_2_icon, 3} }; private int[] mShapeIconIds = { Loading