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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageToolbar.java

Issue 1958233002: Reland of Update NTP to new material design spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.ntp; 5 package org.chromium.chrome.browser.ntp;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.util.AttributeSet; 8 import android.util.AttributeSet;
9 import android.view.View; 9 import android.view.View;
10 import android.view.ViewGroup; 10 import android.view.ViewGroup;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 @Override 45 @Override
46 protected void onFinishInflate() { 46 protected void onFinishInflate() {
47 super.onFinishInflate(); 47 super.onFinishInflate();
48 mBookmarksButton = initButton(R.id.bookmarks_button, R.drawable.btn_star ); 48 mBookmarksButton = initButton(R.id.bookmarks_button, R.drawable.btn_star );
49 mRecentTabsButton = initButton(R.id.recent_tabs_button, R.drawable.btn_r ecents); 49 mRecentTabsButton = initButton(R.id.recent_tabs_button, R.drawable.btn_r ecents);
50 ((TextView) mBookmarksButton.getChildAt(0)).setText(R.string.ntp_bookmar ks); 50 ((TextView) mBookmarksButton.getChildAt(0)).setText(R.string.ntp_bookmar ks);
51 ((TextView) mBookmarksButton.getChildAt(0)).setContentDescription(getRes ources().getString( 51 ((TextView) mBookmarksButton.getChildAt(0)).setContentDescription(getRes ources().getString(
52 R.string.accessibility_ntp_toolbar_btn_bookmarks)); 52 R.string.accessibility_ntp_toolbar_btn_bookmarks));
53 mInterestsButton = initButton(R.id.interests_button, R.drawable.btn_sta r_filled); 53 mInterestsButton = initButton(R.id.interests_button, R.drawable.btn_sta r_filled);
54
55 setBackgroundColor(NtpColorUtils.getBackgroundColorResource(getResources ()));
54 } 56 }
55 57
56 private ViewGroup initButton(int buttonId, int drawableId) { 58 private ViewGroup initButton(int buttonId, int drawableId) {
57 ViewGroup button = (ViewGroup) findViewById(buttonId); 59 ViewGroup button = (ViewGroup) findViewById(buttonId);
58 TextView textView = (TextView) button.getChildAt(0); 60 TextView textView = (TextView) button.getChildAt(0);
59 61
60 TintedDrawable icon = TintedDrawable.constructTintedDrawable(getResource s(), drawableId); 62 TintedDrawable icon = TintedDrawable.constructTintedDrawable(getResource s(), drawableId);
61 ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds( 63 ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(
62 textView, icon, null, null, null); 64 textView, icon, null, null, null);
63 65
64 return button; 66 return button;
65 } 67 }
66 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698