Loading core/java/com/android/internal/widget/FloatingToolbar.java +15 −10 Original line number Original line Diff line number Diff line Loading @@ -920,14 +920,14 @@ public final class FloatingToolbar { mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom } } } else { } else { if (hasOverflow()) { // Overflow not open. Set closed state. // overflow not open. Set closed state. final Size containerSize = mMainPanelSize; final Size containerSize = mMainPanelSize; setSize(mContentContainer, containerSize); setSize(mContentContainer, containerSize); mMainPanel.setAlpha(1); mMainPanel.setAlpha(1); mOverflowPanel.setAlpha(0); mOverflowPanel.setAlpha(0); mOverflowButton.setImageDrawable(mOverflow); mOverflowButton.setImageDrawable(mOverflow); if (hasOverflow()) { // Update x-coordinates depending on RTL state. // Update x-coordinates depending on RTL state. if (isRTL()) { if (isRTL()) { mContentContainer.setX(mMarginHorizontal); // align left mContentContainer.setX(mMarginHorizontal); // align left Loading Loading @@ -960,8 +960,11 @@ public final class FloatingToolbar { mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom } } } else { } else { mContentContainer.setX(mMarginHorizontal); // No overflow. mContentContainer.setY(mMarginVertical); mContentContainer.setX(mMarginHorizontal); // align left mContentContainer.setY(mMarginVertical); // align top mMainPanel.setX(0); // align left mMainPanel.setY(0); // align top } } } } } } Loading Loading @@ -1092,6 +1095,7 @@ public final class FloatingToolbar { final LinkedList<MenuItem> remainingMenuItems = new LinkedList<MenuItem>(menuItems); final LinkedList<MenuItem> remainingMenuItems = new LinkedList<MenuItem>(menuItems); mMainPanel.removeAllViews(); mMainPanel.removeAllViews(); mMainPanel.setPaddingRelative(0, 0, 0, 0); boolean isFirstItem = true; boolean isFirstItem = true; while (!remainingMenuItems.isEmpty()) { while (!remainingMenuItems.isEmpty()) { Loading Loading @@ -1302,7 +1306,6 @@ public final class FloatingToolbar { overflowButton.setOnClickListener(new View.OnClickListener() { overflowButton.setOnClickListener(new View.OnClickListener() { @Override @Override public void onClick(View v) { public void onClick(View v) { final Drawable drawable = overflowButton.getDrawable(); if (mIsOverflowOpen) { if (mIsOverflowOpen) { overflowButton.setImageDrawable(mToOverflow); overflowButton.setImageDrawable(mToOverflow); mToOverflow.start(); mToOverflow.start(); Loading Loading @@ -1599,6 +1602,8 @@ public final class FloatingToolbar { private static ViewGroup createContentContainer(Context context) { private static ViewGroup createContentContainer(Context context) { ViewGroup contentContainer = (ViewGroup) LayoutInflater.from(context) ViewGroup contentContainer = (ViewGroup) LayoutInflater.from(context) .inflate(R.layout.floating_popup_container, null); .inflate(R.layout.floating_popup_container, null); contentContainer.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); contentContainer.setTag(FLOATING_TOOLBAR_TAG); contentContainer.setTag(FLOATING_TOOLBAR_TAG); return contentContainer; return contentContainer; } } Loading Loading
core/java/com/android/internal/widget/FloatingToolbar.java +15 −10 Original line number Original line Diff line number Diff line Loading @@ -920,14 +920,14 @@ public final class FloatingToolbar { mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom } } } else { } else { if (hasOverflow()) { // Overflow not open. Set closed state. // overflow not open. Set closed state. final Size containerSize = mMainPanelSize; final Size containerSize = mMainPanelSize; setSize(mContentContainer, containerSize); setSize(mContentContainer, containerSize); mMainPanel.setAlpha(1); mMainPanel.setAlpha(1); mOverflowPanel.setAlpha(0); mOverflowPanel.setAlpha(0); mOverflowButton.setImageDrawable(mOverflow); mOverflowButton.setImageDrawable(mOverflow); if (hasOverflow()) { // Update x-coordinates depending on RTL state. // Update x-coordinates depending on RTL state. if (isRTL()) { if (isRTL()) { mContentContainer.setX(mMarginHorizontal); // align left mContentContainer.setX(mMarginHorizontal); // align left Loading Loading @@ -960,8 +960,11 @@ public final class FloatingToolbar { mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom mOverflowPanel.setY(mOverflowButtonSize.getHeight()); // align bottom } } } else { } else { mContentContainer.setX(mMarginHorizontal); // No overflow. mContentContainer.setY(mMarginVertical); mContentContainer.setX(mMarginHorizontal); // align left mContentContainer.setY(mMarginVertical); // align top mMainPanel.setX(0); // align left mMainPanel.setY(0); // align top } } } } } } Loading Loading @@ -1092,6 +1095,7 @@ public final class FloatingToolbar { final LinkedList<MenuItem> remainingMenuItems = new LinkedList<MenuItem>(menuItems); final LinkedList<MenuItem> remainingMenuItems = new LinkedList<MenuItem>(menuItems); mMainPanel.removeAllViews(); mMainPanel.removeAllViews(); mMainPanel.setPaddingRelative(0, 0, 0, 0); boolean isFirstItem = true; boolean isFirstItem = true; while (!remainingMenuItems.isEmpty()) { while (!remainingMenuItems.isEmpty()) { Loading Loading @@ -1302,7 +1306,6 @@ public final class FloatingToolbar { overflowButton.setOnClickListener(new View.OnClickListener() { overflowButton.setOnClickListener(new View.OnClickListener() { @Override @Override public void onClick(View v) { public void onClick(View v) { final Drawable drawable = overflowButton.getDrawable(); if (mIsOverflowOpen) { if (mIsOverflowOpen) { overflowButton.setImageDrawable(mToOverflow); overflowButton.setImageDrawable(mToOverflow); mToOverflow.start(); mToOverflow.start(); Loading Loading @@ -1599,6 +1602,8 @@ public final class FloatingToolbar { private static ViewGroup createContentContainer(Context context) { private static ViewGroup createContentContainer(Context context) { ViewGroup contentContainer = (ViewGroup) LayoutInflater.from(context) ViewGroup contentContainer = (ViewGroup) LayoutInflater.from(context) .inflate(R.layout.floating_popup_container, null); .inflate(R.layout.floating_popup_container, null); contentContainer.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); contentContainer.setTag(FLOATING_TOOLBAR_TAG); contentContainer.setTag(FLOATING_TOOLBAR_TAG); return contentContainer; return contentContainer; } } Loading