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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java

Issue 2763883003: [Home] Use a taller progress bar (Closed)
Patch Set: fix indeterminate init 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
Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java
index 898adf6de7d08372cb1654f68d700a88d82556db..797c26f48efb3d1e824bbb9eebede935c7a8a5b8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java
@@ -98,7 +98,8 @@ public abstract class ToolbarLayout extends FrameLayout implements Toolbar {
public void onLayoutChange(View view, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
// Creation of the progress bar is done here so the toolbar height is available.
- mProgressBar = new ToolbarProgressBar(getContext(), getProgressBarTopMargin());
+ mProgressBar = new ToolbarProgressBar(getContext(), getProgressBarHeight(),
+ getProgressBarTopMargin(), getProgressBarUsesThemeColors());
if (isNativeLibraryReady()) mProgressBar.initializeAnimation();
addProgressBarToHierarchy();
@@ -118,6 +119,21 @@ public abstract class ToolbarLayout extends FrameLayout implements Toolbar {
- getResources().getDimensionPixelSize(R.dimen.toolbar_progress_bar_height);
}
+ /**
+ * Set the height that the progress bar should be.
+ * @return The progress bar height in px.
+ */
+ protected int getProgressBarHeight() {
+ return getResources().getDimensionPixelSize(R.dimen.toolbar_progress_bar_height);
+ }
+
+ /**
+ * @return Whether or not the toolbar's progress bar should use theme colors.
+ */
+ protected boolean getProgressBarUsesThemeColors() {
+ return true;
+ }
+
@Override
protected void onFinishInflate() {
super.onFinishInflate();

Powered by Google App Engine
This is Rietveld 408576698