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

Commit 30531c83 authored by George Mount's avatar George Mount Committed by Android Git Automerger
Browse files

am 00877d68: am f187823e: Merge "Fix exception when fragment container has no View." into lmp-dev

* commit '00877d68937f3f17cceff222b052d2b16f9b7d87':
  Fix exception when fragment container has no View.
parents 73a92d26 6ac3f381
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -745,6 +745,11 @@ public class Activity extends ContextThemeWrapper
        public View findViewById(int id) {
            return Activity.this.findViewById(id);
        }
        @Override
        public boolean hasView() {
            Window window = Activity.this.getWindow();
            return (window != null && window.peekDecorView() != null);
        }
    };

    // Most recent call to requestVisibleBehind().
+6 −0
Original line number Diff line number Diff line
@@ -868,6 +868,9 @@ final class BackStackRecord extends FragmentTransaction implements
     */
    private void calculateFragments(SparseArray<Fragment> firstOutFragments,
            SparseArray<Fragment> lastInFragments) {
        if (!mManager.mContainer.hasView()) {
            return; // nothing to see, so no transitions
        }
        Op op = mHead;
        while (op != null) {
            switch (op.cmd) {
@@ -923,6 +926,9 @@ final class BackStackRecord extends FragmentTransaction implements
     */
    public void calculateBackFragments(SparseArray<Fragment> firstOutFragments,
            SparseArray<Fragment> lastInFragments) {
        if (!mManager.mContainer.hasView()) {
            return; // nothing to see, so no transitions
        }
        Op op = mHead;
        while (op != null) {
            switch (op.cmd) {
+5 −0
Original line number Diff line number Diff line
@@ -2015,6 +2015,11 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
                }
                return mView.findViewById(id);
            }

            @Override
            public boolean hasView() {
                return (mView != null);
            }
        }, this);
    }

+1 −0
Original line number Diff line number Diff line
@@ -395,6 +395,7 @@ final class FragmentManagerState implements Parcelable {
 */
interface FragmentContainer {
    public View findViewById(int id);
    public boolean hasView();
}

/**