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

Commit 4147ac18 authored by Taran Singh's avatar Taran Singh
Browse files

Reduce IME navbar DeadZone by half

In order to reduce touches being consumed by Deadzone and letting them
reach navbar, this CL reduces its dimensions by half.

This is an attempt to unblock us from deadZone consuming touch events.
In the long run, DeadZone should be replaced with NearestTouchFrame.

Bug: 364856257
Test: atest CtsInputMethodTestCases
Flag: android.view.inputmethod.fix_navbar_deadzone
Change-Id: Ib4050a4928427c8746fa5a9737b889aca8c664e5
parent 90dafe43
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.util.FloatProperty;
import android.util.Log;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.inputmethod.Flags;

/**
 * The "dead zone" consumes unintentional taps along the top edge of the navigation bar.
@@ -119,6 +120,10 @@ final class DeadZone {

        mSizeMin = dpToPx(NAVIGATION_BAR_DEADZONE_SIZE, res);
        mSizeMax = dpToPx(NAVIGATION_BAR_DEADZONE_SIZE_MAX, res);
        if (Flags.fixNavbarDeadzone()) {
            mSizeMax = mSizeMax / 2;
            mSizeMin = mSizeMin / 2;
        }
        mVertical = (res.getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE);

        if (DEBUG) {
+8 −0
Original line number Diff line number Diff line
@@ -221,3 +221,11 @@ flag {
  description: "Deprecate unsupported show/hide flags."
  bug: "322992891"
}

flag {
  name: "fix_navbar_deadzone"
  namespace: "input_method"
  description: "Reduce DeadZone for navbar"
  bug: "364856257"
}