summaryrefslogtreecommitdiff
path: root/core/java/android/view/InsetsAnimationControlCallbacks.java
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2020-06-12 18:48:10 +0200
committerAdrian Roos <roosa@google.com>2020-06-22 16:55:54 +0200
commitc22eec9d35e797417b8630fff178ec53e7c29b65 (patch)
tree83a64bdab7c328cd3d2e0ad87d54580323f090c2 /core/java/android/view/InsetsAnimationControlCallbacks.java
parent70ad33113fdfcb77edcc2120e108cad4d2e3d7bf (diff)
IME animation: hide IME-related navbar icons until perceptible
During transitions and while the IME is controlled by the app, the IME may be "visible" as far as the IME framework is concerned, but not actually perceptible by the user due to offsets or alpha applied to the leash. This may lead to out-of-place navbar symbols for the IME, especially in gesture nav. To avoid this, the ImeInsetsSourceConsumer now notifies the IMF of whether it has made the IME unperceptible to the user. For now, we ignore the cases where the IME is controlled by something other than the client window - in that case, we just revert to the previous behavior of it being always considered perceptible. Fixes: 158079255 Test: manual, launch email compose activity, observe that back button only indicates once IME appears Test: atest InsetsAnimationControlImplTest Change-Id: I4dc9d6513d0559156f7da39244f3fc5ebc952ed4
Diffstat (limited to 'core/java/android/view/InsetsAnimationControlCallbacks.java')
-rw-r--r--core/java/android/view/InsetsAnimationControlCallbacks.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/view/InsetsAnimationControlCallbacks.java b/core/java/android/view/InsetsAnimationControlCallbacks.java
index 74c186948b2f..3431c3ecc310 100644
--- a/core/java/android/view/InsetsAnimationControlCallbacks.java
+++ b/core/java/android/view/InsetsAnimationControlCallbacks.java
@@ -16,6 +16,7 @@
package android.view;
+import android.view.WindowInsets.Type.InsetsType;
import android.view.WindowInsetsAnimation.Bounds;
/**
@@ -64,4 +65,15 @@ public interface InsetsAnimationControlCallbacks {
* previous calls to applySurfaceParams.
*/
void releaseSurfaceControlFromRt(SurfaceControl sc);
+
+ /**
+ * Reports that the perceptibility of the given types has changed to the given value.
+ *
+ * A type is perceptible if it is not (almost) entirely off-screen and not (almost) entirely
+ * transparent.
+ *
+ * @param types the (public) types whose perceptibility has changed
+ * @param perceptible true, if the types are now perceptible, false if they are not perceptible
+ */
+ void reportPerceptible(@InsetsType int types, boolean perceptible);
}