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

Commit 06060cd7 authored by chihhangchuang's avatar chihhangchuang
Browse files

Get rid of #getViewTreeObserver

Which cause app crash by an null exception

Test: Manually
Fixes: 156105622
Change-Id: Ife0d59c108e693e4603e6bd3e39d2746fb479306
parent a4b9eecf
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -145,13 +145,8 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal
        }
        }


        mBottomActionBar = findViewById(R.id.bottom_actionbar);
        mBottomActionBar = findViewById(R.id.bottom_actionbar);
        mBottomActionBar.getViewTreeObserver().addOnGlobalLayoutListener(() -> {
        mBottomActionBar.addVisibilityChangeListener(
            // Only update the visibility of mBottomNav when mBottomActionBar visibility changes.
                isVisible -> mBottomNav.setVisibility(isVisible ? View.GONE : View.VISIBLE));
            // Since the listener will be triggered by mBottomActionBar and its child views.
            if (mBottomActionBar.getVisibility() == mBottomNav.getVisibility()) {
                mBottomNav.setVisibility(mBottomActionBar.isVisible() ? View.GONE : View.VISIBLE);
            }
        });
    }
    }


    @Override
    @Override