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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java

Issue 1729683005: [Offline pages] Adding the offline bolt light icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@omnibox-patch-1
Patch Set: Replacing icons with icons with alpha, removing alpha related code Created 4 years, 10 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
« no previous file with comments | « chrome/android/java/res/values/colors.xml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.omnibox; 5 package org.chromium.chrome.browser.omnibox;
6 6
7 import static org.chromium.chrome.browser.toolbar.ToolbarPhone.URL_FOCUS_CHANGE_ ANIMATION_DURATION_MS; 7 import static org.chromium.chrome.browser.toolbar.ToolbarPhone.URL_FOCUS_CHANGE_ ANIMATION_DURATION_MS;
8 8
9 import android.Manifest; 9 import android.Manifest;
10 import android.animation.Animator; 10 import android.animation.Animator;
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 : Color.WHITE, PorterDuff.Mode.SRC_IN); 1283 : Color.WHITE, PorterDuff.Mode.SRC_IN);
1284 mNavigationButton.setImageDrawable(page); 1284 mNavigationButton.setImageDrawable(page);
1285 break; 1285 break;
1286 case MAGNIFIER: 1286 case MAGNIFIER:
1287 mNavigationButton.setImageResource(R.drawable.ic_omnibox_magnifi er); 1287 mNavigationButton.setImageResource(R.drawable.ic_omnibox_magnifi er);
1288 break; 1288 break;
1289 case EMPTY: 1289 case EMPTY:
1290 mNavigationButton.setImageDrawable(null); 1290 mNavigationButton.setImageDrawable(null);
1291 break; 1291 break;
1292 case OFFLINE: 1292 case OFFLINE:
1293 mNavigationButton.setImageResource(R.drawable.offline_bolt); 1293 mNavigationButton.setImageResource(
1294 mUseDarkColors ? R.drawable.offline_bolt : R.drawable.of fline_bolt_light);
1294 break; 1295 break;
1295 default: 1296 default:
1296 assert false; 1297 assert false;
1297 } 1298 }
1298 1299
1299 mNavigationButton.setAlpha(buttonType == NavigationButtonType.OFFLINE ? 0.54f : 1.0f);
1300
1301 if (mNavigationButton.getVisibility() != VISIBLE) { 1300 if (mNavigationButton.getVisibility() != VISIBLE) {
1302 mNavigationButton.setVisibility(VISIBLE); 1301 mNavigationButton.setVisibility(VISIBLE);
1303 } 1302 }
1304 mNavigationButtonType = buttonType; 1303 mNavigationButtonType = buttonType;
1305 1304
1306 updateVerboseStatusVisibility(); 1305 updateVerboseStatusVisibility();
1307 updateLocationBarIconContainerVisibility(); 1306 updateLocationBarIconContainerVisibility();
1308 } 1307 }
1309 1308
1310 /** 1309 /**
1311 * Update visibility of the verbose status based on the button type and focu s state of the 1310 * Update visibility of the verbose status based on the button type and focu s state of the
1312 * omnibox. 1311 * omnibox.
1313 */ 1312 */
1314 private void updateVerboseStatusVisibility() { 1313 private void updateVerboseStatusVisibility() {
1315 boolean verboseStatusVisible = 1314 boolean verboseStatusVisible =
1316 mNavigationButtonType == NavigationButtonType.OFFLINE && !mUrlHa sFocus; 1315 mNavigationButtonType == NavigationButtonType.OFFLINE && !mUrlHa sFocus;
1316
1317 int verboseStatusVisibility = verboseStatusVisible ? VISIBLE : GONE; 1317 int verboseStatusVisibility = verboseStatusVisible ? VISIBLE : GONE;
1318
1319 mVerboseStatusTextView.setTextColor(ApiCompatibilityUtils.getColor(
1320 getResources(), mUseDarkColors ? R.color.locationbar_verbose_sta tus_color
1321 : R.color.locationbar_light_verbo se_status_color));
Ted C 2016/02/26 17:58:58 despite what git cl format tries to do, this shoul
fgorski 2016/02/26 18:13:17 Done.
1318 mVerboseStatusTextView.setVisibility(verboseStatusVisibility); 1322 mVerboseStatusTextView.setVisibility(verboseStatusVisibility);
1319 findViewById(R.id.location_bar_verbose_status_separator) 1323
1320 .setVisibility(verboseStatusVisibility); 1324 View separator = findViewById(R.id.location_bar_verbose_status_separator );
1325 separator.setBackgroundColor(ApiCompatibilityUtils.getColor(getResources (), mUseDarkColors
1326 ? R.color.locationbar_status_separator_color
Ted C 2016/02/26 17:58:58 -8 indent
fgorski 2016/02/26 18:13:17 Done.
1327 : R.color.locationbar_light_status_separator_color));
1328 separator.setVisibility(verboseStatusVisibility);
1329
1321 findViewById(R.id.location_bar_verbose_status_extra_space) 1330 findViewById(R.id.location_bar_verbose_status_extra_space)
1322 .setVisibility(verboseStatusVisibility); 1331 .setVisibility(verboseStatusVisibility);
1323 } 1332 }
1324 1333
1325 /** 1334 /**
1326 * Update the visibility of the location bar icon container based on the sta te of the 1335 * Update the visibility of the location bar icon container based on the sta te of the
1327 * security and navigation icons. 1336 * security and navigation icons.
1328 */ 1337 */
1329 protected void updateLocationBarIconContainerVisibility() { 1338 protected void updateLocationBarIconContainerVisibility() {
1330 boolean showContainer = 1339 boolean showContainer =
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 public View getContainerView() { 2438 public View getContainerView() {
2430 return this; 2439 return this;
2431 } 2440 }
2432 2441
2433 @Override 2442 @Override
2434 public void setTitleToPageTitle() { } 2443 public void setTitleToPageTitle() { }
2435 2444
2436 @Override 2445 @Override
2437 public void setShowTitle(boolean showTitle) { } 2446 public void setShowTitle(boolean showTitle) { }
2438 } 2447 }
OLDNEW
« no previous file with comments | « chrome/android/java/res/values/colors.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698