From 523d33f1e18953dbeec4f948875f44ae92f319c3 Mon Sep 17 00:00:00 2001 From: Shu Chen Date: Thu, 13 Feb 2020 10:18:29 +0800 Subject: [PATCH] Fixes the opacity value for the insertion handle to range {0..255}. Bug: 149523168 Test: locally verified. Change-Id: I53c4be59e128a6451a9d8c847ee9d5fd295659ab --- core/java/android/widget/Editor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 46b8b771de874..12f245e87da20 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -5271,6 +5271,8 @@ public class Editor { if (opacity < 10 || opacity > 100) { opacity = 50; } + // Converts the opacity value from range {0..100} to {0..255}. + opacity = opacity * 255 / 100; } mDeltaHeight = deltaHeight; mDrawableOpacity = opacity;