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

Commit a2ef00b4 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Don't invalidate view if setEnabled doesn't change the state.

Check the current enabled state before setting it, in case there's
no change. Otherwise some apps are repeatedly redrawing buttons based
on validation of some text field (like gmail or mms message bodies).
Should slightly improve the performance of soft keyboard text entry.
parent bad80e0d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2983,6 +2983,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
     * @param enabled True if this view is enabled, false otherwise.
     */
    public void setEnabled(boolean enabled) {
        if (enabled == isEnabled()) return;

        setFlags(enabled ? ENABLED : DISABLED, ENABLED_MASK);

        /*