Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3678)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java

Issue 2750503008: Fix the condensed NTP layout for tablets. (Closed)
Patch Set: comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
index c833e891153f96956274def1610a2c790249cd9e..baf1a596ad0812ba8fb3701f898e1cec62b28c3b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
@@ -304,7 +304,11 @@ public class NewTabPageView
final TextView searchBoxTextView = (TextView) mSearchBoxView
.findViewById(R.id.search_box_text);
- if (!ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SHOW_GOOGLE_G_IN_OMNIBOX)) {
+ boolean isTablet = DeviceFormFactor.isTablet(getContext());
+
+ // If the Google G should not be shown then clear it because it is shown by default in xml.
+ if (isTablet
+ || !ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SHOW_GOOGLE_G_IN_OMNIBOX)) {
searchBoxTextView.setCompoundDrawablePadding(0);
// Not using the relative version of this call because we only want to clear
@@ -313,7 +317,7 @@ public class NewTabPageView
}
String hintText = getResources().getString(R.string.search_or_type_url);
- if (!DeviceFormFactor.isTablet(getContext()) || mManager.isFakeOmniboxTextEnabledTablet()) {
+ if (!isTablet || mManager.isFakeOmniboxTextEnabledTablet()) {
searchBoxTextView.setHint(hintText);
} else {
searchBoxTextView.setContentDescription(hintText);
@@ -519,7 +523,8 @@ public class NewTabPageView
if (hasLogo == mSearchProviderHasLogo && mInitialized) return;
mSearchProviderHasLogo = hasLogo;
boolean showLogo = mSearchProviderHasLogo
- && !ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_CONDENSED_LAYOUT);
+ && (DeviceFormFactor.isTablet(getContext())
+ || !ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_CONDENSED_LAYOUT));
// Set a bit more top padding on the tile grid if there is no logo.
int paddingTop = getResources().getDimensionPixelSize(showLogo
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698