Index: chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java |
index 58902cb15d127a7d1fe3b0cd4dab19e187007069..917b10a49b3d56caa845639428a2ce47b1828e48 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java |
@@ -39,6 +39,7 @@ import org.chromium.chrome.browser.tab.Tab; |
import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; |
import org.chromium.chrome.browser.tabmodel.TabModel; |
import org.chromium.chrome.browser.tabmodel.TabModelSelector; |
+import org.chromium.chrome.browser.toolbar.BottomToolbarPhone; |
import org.chromium.chrome.browser.util.MathUtils; |
import org.chromium.chrome.browser.widget.FadingBackgroundView; |
import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContentController.ContentType; |
@@ -192,7 +193,7 @@ public class BottomSheet |
* The default toolbar view. This is shown when the current bottom sheet content doesn't have |
* its own toolbar and when the bottom sheet is closed. |
*/ |
- private View mDefaultToolbarView; |
+ private BottomToolbarPhone mDefaultToolbarView; |
/** Whether the {@link BottomSheet} and its children should react to touch events. */ |
private boolean mIsTouchEnabled = true; |
@@ -226,6 +227,11 @@ public class BottomSheet |
View getToolbarView(); |
/** |
+ * @return Whether or not the toolbar is currently lightly colored. |
+ */ |
+ boolean isUsingLightToolbar(); |
+ |
+ /** |
* @return The vertical scroll offset of the content view. |
*/ |
int getVerticalScrollOffset(); |
@@ -554,7 +560,21 @@ public class BottomSheet |
mBottomSheetContentContainer.addView(mPlaceholder, placeHolderParams); |
mToolbarHolder = (FrameLayout) mControlContainer.findViewById(R.id.toolbar_holder); |
- mDefaultToolbarView = mControlContainer.findViewById(R.id.toolbar); |
+ mDefaultToolbarView = (BottomToolbarPhone) mControlContainer.findViewById(R.id.toolbar); |
+ } |
+ |
+ /** |
+ * Set the color of the pull handle used by the toolbar. |
+ */ |
+ public void updateHandleTint() { |
+ boolean isLight = mDefaultToolbarView.usesLightDrawables(); |
+ |
+ // If the current sheet content's toolbar is using a special theme, use that. |
+ if (mSheetContent != null && mSheetContent.getToolbarView() != null) { |
+ isLight = mSheetContent.isUsingLightToolbar(); |
+ } |
+ |
+ mDefaultToolbarView.updateHandleTint(isLight); |
Theresa
2017/04/19 21:28:29
I'm interpreting isUsingLightToolbar() to mean tha
mdjones
2017/04/19 22:49:44
Yeah, I some of the names got confised. Fixed.
|
} |
@Override |
@@ -695,6 +715,7 @@ public class BottomSheet |
currentToolbar.setVisibility(View.GONE); |
} |
mToolbarFadeAnimator = null; |
+ updateHandleTint(); |
} |
}); |