Add theme info sheet to theme full preview page
Mock: https://docs.google.com/presentation/d/15JadcGi5k1_0znUN_XdFpU7UxeXwxjK3Y7LxvhW5ETM/edit?ts=5ebdb4b0#slide=id.g7c8f4a82bf_0_268
Screenshot:
https://screenshot.googleplex.com/S1BuS1A52eP.png
https://screenshot.googleplex.com/mi3Yafmfibw.png
Test: Manually
Bug: 151286773
Change-Id: I1b3c68f6063b50951a757117259227b67a119731
diff --git a/src/com/android/customization/picker/theme/ThemeFullPreviewFragment.java b/src/com/android/customization/picker/theme/ThemeFullPreviewFragment.java
index 9181daa..4f6faa6 100644
--- a/src/com/android/customization/picker/theme/ThemeFullPreviewFragment.java
+++ b/src/com/android/customization/picker/theme/ThemeFullPreviewFragment.java
@@ -18,6 +18,7 @@
import static android.app.Activity.RESULT_OK;
import static com.android.wallpaper.widget.BottomActionBar.BottomAction.APPLY;
+import static com.android.wallpaper.widget.BottomActionBar.BottomAction.INFORMATION;
import android.app.Activity;
import android.content.Intent;
@@ -35,6 +36,7 @@
import com.android.customization.model.theme.ThemeBundleProvider;
import com.android.customization.module.CustomizationInjector;
import com.android.customization.picker.WallpaperPreviewer;
+import com.android.customization.widget.ThemeInfoView;
import com.android.wallpaper.R;
import com.android.wallpaper.model.WallpaperInfo;
import com.android.wallpaper.module.InjectorProvider;
@@ -125,8 +127,12 @@
@Override
protected void onBottomActionBarReady(BottomActionBar bottomActionBar) {
- bottomActionBar.showActionsOnly(APPLY);
+ bottomActionBar.showActionsOnly(INFORMATION, APPLY);
bottomActionBar.setActionClickListener(APPLY, v -> finishActivityWithResultOk());
+ ThemeInfoView themeInfoView = (ThemeInfoView) LayoutInflater.from(getContext()).inflate(
+ R.layout.theme_info_view, /* root= */ null);
+ themeInfoView.populateThemeInfo(mThemeBundle);
+ bottomActionBar.attachViewToBottomSheetAndBindAction(themeInfoView, INFORMATION);
bottomActionBar.show();
}
diff --git a/src/com/android/customization/widget/ThemeInfoView.java b/src/com/android/customization/widget/ThemeInfoView.java
index 2634d6c..5b05484 100644
--- a/src/com/android/customization/widget/ThemeInfoView.java
+++ b/src/com/android/customization/widget/ThemeInfoView.java
@@ -16,6 +16,7 @@
package com.android.customization.widget;
import android.content.Context;
+import android.content.res.ColorStateList;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.LinearLayout;
@@ -76,6 +77,8 @@
if (previewInfo.shapeDrawable != null) {
mShapePreviewImageView.setImageDrawable(previewInfo.shapeDrawable);
+ mShapePreviewImageView.setImageTintList(
+ ColorStateList.valueOf(previewInfo.resolveAccentColor(getResources())));
}
}
}