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

Commit 38330ec3 authored by Chet Haase's avatar Chet Haase Committed by Android (Google) Code Review
Browse files

Merge "Avoid running layout transitions on unattached views and windows" into jb-dev

parents b72ac9dd ab3a7768
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -1208,6 +1208,9 @@ public class LayoutTransition {
     * affect CHANGE_APPEARING or CHANGE_DISAPPEARING animations.
     * affect CHANGE_APPEARING or CHANGE_DISAPPEARING animations.
     */
     */
    private void addChild(ViewGroup parent, View child, boolean changesLayout) {
    private void addChild(ViewGroup parent, View child, boolean changesLayout) {
        if (parent.getWindowVisibility() != View.VISIBLE) {
            return;
        }
        if ((mTransitionTypes & FLAG_APPEARING) == FLAG_APPEARING) {
        if ((mTransitionTypes & FLAG_APPEARING) == FLAG_APPEARING) {
            // Want disappearing animations to finish up before proceeding
            // Want disappearing animations to finish up before proceeding
            cancel(DISAPPEARING);
            cancel(DISAPPEARING);
@@ -1243,6 +1246,9 @@ public class LayoutTransition {
     * @hide
     * @hide
     */
     */
    public void layoutChange(ViewGroup parent) {
    public void layoutChange(ViewGroup parent) {
        if (parent.getWindowVisibility() != View.VISIBLE) {
            return;
        }
        if ((mTransitionTypes & FLAG_CHANGING) == FLAG_CHANGING  && !isRunning()) {
        if ((mTransitionTypes & FLAG_CHANGING) == FLAG_CHANGING  && !isRunning()) {
            // This method is called for all calls to layout() in the container, including
            // This method is called for all calls to layout() in the container, including
            // those caused by add/remove/hide/show events, which will already have set up
            // those caused by add/remove/hide/show events, which will already have set up
@@ -1301,6 +1307,9 @@ public class LayoutTransition {
     * affect CHANGE_APPEARING or CHANGE_DISAPPEARING animations.
     * affect CHANGE_APPEARING or CHANGE_DISAPPEARING animations.
     */
     */
    private void removeChild(ViewGroup parent, View child, boolean changesLayout) {
    private void removeChild(ViewGroup parent, View child, boolean changesLayout) {
        if (parent.getWindowVisibility() != View.VISIBLE) {
            return;
        }
        if ((mTransitionTypes & FLAG_DISAPPEARING) == FLAG_DISAPPEARING) {
        if ((mTransitionTypes & FLAG_DISAPPEARING) == FLAG_DISAPPEARING) {
            // Want appearing animations to finish up before proceeding
            // Want appearing animations to finish up before proceeding
            cancel(APPEARING);
            cancel(APPEARING);