Commit d7a4d7bd authored by Theresa's avatar Theresa Committed by Commit Bot

Don't use modern snackbar on tablets

We use a narrow snackbar on tablets, so a different background asset is
needed to show shadows on all edges of the white snackbar.

For now, don't use the modern snackbar on tablets.

BUG=817518

Change-Id: I49bb4f6a14cf804e719d433db9f26192a52a9495
Reviewed-on: https://chromium-review.googlesource.com/941506Reviewed-by: default avatarBecky Zhou <huayinz@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539977}
parent 07c7facb
......@@ -240,16 +240,13 @@ class SnackbarView {
int backgroundColor = snackbar.getBackgroundColor();
if (backgroundColor == 0) {
backgroundColor = ApiCompatibilityUtils.getColor(mContainerView.getResources(),
FeatureUtilities.isChromeModernDesignEnabled()
? R.color.modern_primary_color
useModernDesign() ? R.color.modern_primary_color
: R.color.snackbar_background_color);
}
int textAppearanceResId = snackbar.getTextAppearance();
if (textAppearanceResId == 0) {
textAppearanceResId = FeatureUtilities.isChromeModernDesignEnabled()
? R.style.BlackBodyDefault
: R.style.WhiteBody;
textAppearanceResId = useModernDesign() ? R.style.BlackBodyDefault : R.style.WhiteBody;
}
ApiCompatibilityUtils.setTextAppearance(mMessageView, textAppearanceResId);
......@@ -277,7 +274,7 @@ class SnackbarView {
mProfileImageView.setVisibility(View.GONE);
}
if (FeatureUtilities.isChromeModernDesignEnabled()) {
if (useModernDesign()) {
mActionButtonView.setTextColor(ApiCompatibilityUtils.getColor(
mContainerView.getResources(), R.color.blue_when_enabled));
mShadowView.setVisibility(View.VISIBLE);
......@@ -324,4 +321,8 @@ class SnackbarView {
view.setText(text);
}
}
private boolean useModernDesign() {
return !mIsTablet && FeatureUtilities.isChromeModernDesignEnabled();
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment