Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c23ac326 authored by Abodunrinwa Toki's avatar Abodunrinwa Toki
Browse files

DO NOT MERGE: Minor fixes to FloatingToolbar.

* Changes to isShowing() method.
* Changes to initial content visibility on show().

Change-Id: I1b20cd5a3fc86ae7427b55c44efd3cc1118148ae
parent 47ea8b3d
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -438,6 +438,9 @@ public final class FloatingToolbar {
            // Make sure a panel is set as the content.
            // Make sure a panel is set as the content.
            if (mContentContainer.getChildCount() == 0) {
            if (mContentContainer.getChildCount() == 0) {
                setMainPanelAsContent();
                setMainPanelAsContent();
                // If we're yet to show the popup, set the container visibility to zero.
                // The "show" animation will make this visible.
                mContentContainer.setAlpha(0);
            }
            }
            preparePopupContent();
            preparePopupContent();
            mPopupWindow.showAtLocation(mParent, Gravity.NO_GRAVITY, x, y);
            mPopupWindow.showAtLocation(mParent, Gravity.NO_GRAVITY, x, y);
@@ -478,7 +481,7 @@ public final class FloatingToolbar {
         * Returns {@code true} if this popup is currently showing. {@code false} otherwise.
         * Returns {@code true} if this popup is currently showing. {@code false} otherwise.
         */
         */
        public boolean isShowing() {
        public boolean isShowing() {
            return mPopupWindow.isShowing() && !mDismissed && !mHidden;
            return !mDismissed && !mHidden;
        }
        }


        /**
        /**
@@ -494,7 +497,7 @@ public final class FloatingToolbar {
         * This is a no-op if this popup is not showing.
         * This is a no-op if this popup is not showing.
         */
         */
        public void updateCoordinates(int x, int y) {
        public void updateCoordinates(int x, int y) {
            if (!isShowing()) {
            if (!isShowing() || !mPopupWindow.isShowing()) {
                return;
                return;
            }
            }