| OLD | NEW |
| 1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- | 1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- |
| 2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
| 4 * You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | 5 |
| 6 package org.mozilla.gecko.tabs; | 6 package org.mozilla.gecko.tabs; |
| 7 | 7 |
| 8 import org.mozilla.gecko.AppConstants.Versions; | 8 import org.mozilla.gecko.AppConstants.Versions; |
| 9 import org.mozilla.gecko.GeckoApp; | 9 import org.mozilla.gecko.GeckoApp; |
| 10 import org.mozilla.gecko.GeckoApplication; | 10 import org.mozilla.gecko.GeckoApplication; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 @Override | 257 @Override |
| 258 public void onDetachedFromWindow() { | 258 public void onDetachedFromWindow() { |
| 259 super.onDetachedFromWindow(); | 259 super.onDetachedFromWindow(); |
| 260 mTheme.removeListener(this); | 260 mTheme.removeListener(this); |
| 261 } | 261 } |
| 262 | 262 |
| 263 @Override | 263 @Override |
| 264 @SuppressWarnings("deprecation") // setBackgroundDrawable deprecated by API
level 16 | 264 @SuppressWarnings("deprecation") // setBackgroundDrawable deprecated by API
level 16 |
| 265 public void onLightweightThemeChanged() { | 265 public void onLightweightThemeChanged() { |
| 266 final int background = ColorUtils.getColor(getContext(), R.color.text_an
d_tabs_tray_grey); | 266 // Using ABB color palette. See https://issues.adblockplus.org/ticket/37
69 |
| 267 final int background = ColorUtils.getColor(getContext(), R.color.abb_bac
kground_light_grey); |
| 267 final LightweightThemeDrawable drawable = mTheme.getColorDrawable(this,
background, true); | 268 final LightweightThemeDrawable drawable = mTheme.getColorDrawable(this,
background, true); |
| 268 if (drawable == null) | 269 if (drawable == null) |
| 269 return; | 270 return; |
| 270 | 271 |
| 271 drawable.setAlpha(34, 0); | 272 drawable.setAlpha(34, 0); |
| 272 setBackgroundDrawable(drawable); | 273 setBackgroundDrawable(drawable); |
| 273 } | 274 } |
| 274 | 275 |
| 275 @Override | 276 @Override |
| 276 public void onLightweightThemeReset() { | 277 public void onLightweightThemeReset() { |
| 277 setBackgroundColor(ColorUtils.getColor(getContext(), R.color.text_and_ta
bs_tray_grey)); | 278 // Using ABB color palette. See https://issues.adblockplus.org/ticket/37
69 |
| 279 setBackgroundColor(ColorUtils.getColor(getContext(), R.color.abb_backgro
und_light_grey)); |
| 278 } | 280 } |
| 279 | 281 |
| 280 @Override | 282 @Override |
| 281 protected void onLayout(boolean changed, int left, int top, int right, int b
ottom) { | 283 protected void onLayout(boolean changed, int left, int top, int right, int b
ottom) { |
| 282 super.onLayout(changed, left, top, right, bottom); | 284 super.onLayout(changed, left, top, right, bottom); |
| 283 onLightweightThemeChanged(); | 285 onLightweightThemeChanged(); |
| 284 } | 286 } |
| 285 | 287 |
| 286 // Tabs Panel Toolbar contains the Buttons | 288 // Tabs Panel Toolbar contains the Buttons |
| 287 static class TabsPanelToolbar extends LinearLayout | 289 static class TabsPanelToolbar extends LinearLayout |
| (...skipping 13 matching lines...) Expand all Loading... |
| 301 | 303 |
| 302 @Override | 304 @Override |
| 303 public void onDetachedFromWindow() { | 305 public void onDetachedFromWindow() { |
| 304 super.onDetachedFromWindow(); | 306 super.onDetachedFromWindow(); |
| 305 mTheme.removeListener(this); | 307 mTheme.removeListener(this); |
| 306 } | 308 } |
| 307 | 309 |
| 308 @Override | 310 @Override |
| 309 @SuppressWarnings("deprecation") // setBackgroundDrawable deprecated by
API level 16 | 311 @SuppressWarnings("deprecation") // setBackgroundDrawable deprecated by
API level 16 |
| 310 public void onLightweightThemeChanged() { | 312 public void onLightweightThemeChanged() { |
| 311 final int background = ColorUtils.getColor(getContext(), R.color.tex
t_and_tabs_tray_grey); | 313 // Using ABB color palette. See https://issues.adblockplus.org/ticke
t/3769 |
| 314 final int background = ColorUtils.getColor(getContext(), R.color.abb
_background_light_grey); |
| 312 final LightweightThemeDrawable drawable = mTheme.getColorDrawable(th
is, background); | 315 final LightweightThemeDrawable drawable = mTheme.getColorDrawable(th
is, background); |
| 313 if (drawable == null) | 316 if (drawable == null) |
| 314 return; | 317 return; |
| 315 | 318 |
| 316 drawable.setAlpha(34, 34); | 319 drawable.setAlpha(34, 34); |
| 317 setBackgroundDrawable(drawable); | 320 setBackgroundDrawable(drawable); |
| 318 } | 321 } |
| 319 | 322 |
| 320 @Override | 323 @Override |
| 321 public void onLightweightThemeReset() { | 324 public void onLightweightThemeReset() { |
| 322 setBackgroundColor(ColorUtils.getColor(getContext(), R.color.text_an
d_tabs_tray_grey)); | 325 // Using ABB color palette. See https://issues.adblockplus.org/ticke
t/3769 |
| 326 setBackgroundColor(ColorUtils.getColor(getContext(), R.color.abb_bac
kground_light_grey)); |
| 323 } | 327 } |
| 324 | 328 |
| 325 @Override | 329 @Override |
| 326 protected void onLayout(boolean changed, int left, int top, int right, i
nt bottom) { | 330 protected void onLayout(boolean changed, int left, int top, int right, i
nt bottom) { |
| 327 super.onLayout(changed, left, top, right, bottom); | 331 super.onLayout(changed, left, top, right, bottom); |
| 328 onLightweightThemeChanged(); | 332 onLightweightThemeChanged(); |
| 329 } | 333 } |
| 330 } | 334 } |
| 331 | 335 |
| 332 public void show(Panel panelToShow) { | 336 public void show(Panel panelToShow) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 | 469 |
| 466 public void setTabsLayoutChangeListener(TabsLayoutChangeListener listener) { | 470 public void setTabsLayoutChangeListener(TabsLayoutChangeListener listener) { |
| 467 mLayoutChangeListener = listener; | 471 mLayoutChangeListener = listener; |
| 468 } | 472 } |
| 469 | 473 |
| 470 private void dispatchLayoutChange(int width, int height) { | 474 private void dispatchLayoutChange(int width, int height) { |
| 471 if (mLayoutChangeListener != null) | 475 if (mLayoutChangeListener != null) |
| 472 mLayoutChangeListener.onTabsLayoutChange(width, height); | 476 mLayoutChangeListener.onTabsLayoutChange(width, height); |
| 473 } | 477 } |
| 474 } | 478 } |
| OLD | NEW |