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

Commit f17c5811 authored by Brandon Dayauon's avatar Brandon Dayauon Committed by Android (Google) Code Review
Browse files

Merge "Work toggle button staying at the top when moving keyboard down" into tm-qpr-dev

parents 7d8ba14b fa6011fc
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;
    }