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

Commit fa6011fc authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

Work toggle button staying at the top when moving keyboard down

- Same fix from implementation when implementing extendedFAB. ag/19223926
- Essentiall remove isEnabled() check since it is not needed
bug: 235873194
test: Manual - before: https://drive.google.com/file/d/1JjDSudWS56fiDyMnP8Btvy0pWFyUIXND/view?usp=sharing
after: https://drive.google.com/file/d/1Ja-OVpXKK1yUrixpU_V6WsLV0Ryw152w/view?usp=sharing

Change-Id: Ibca405deccfcd61845dd4f5952ad196af1ab3fe2
parent 94a54203
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -170,12 +170,14 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi

    @Override
    public WindowInsets onApplyWindowInsets(WindowInsets insets) {
        if (Utilities.ATLEAST_R && isEnabled()) {
            setTranslationY(0);
        if (!Utilities.ATLEAST_R) {
            return insets;
        }
        if (insets.isVisible(WindowInsets.Type.ime())) {
            Insets keyboardInsets = insets.getInsets(WindowInsets.Type.ime());
            setTranslationY(mInsets.bottom - keyboardInsets.bottom);
            }
        } else {
            setTranslationY(0);
        }
        return insets;
    }