From 1b87854bf55fd3e413d1f153872e32607acb5efe Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Tue, 23 Jul 2019 07:57:39 -0700 Subject: [PATCH] Add support for Android's visible password input type (flutter/engine#9999) For framework PR https://github.com/flutter/flutter/issues/31738 --- .../embedding/engine/systemchannels/TextInputChannel.java | 3 ++- .../android/io/flutter/plugin/editing/TextInputPlugin.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java index 857168dadc..55386eeba5 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java @@ -371,7 +371,8 @@ public class TextInputChannel { PHONE("TextInputType.phone"), MULTILINE("TextInputType.multiline"), EMAIL_ADDRESS("TextInputType.emailAddress"), - URL("TextInputType.url"); + URL("TextInputType.url"), + VISIBLE_PASSWORD("TextInputType.visiblePassword"); static TextInputType fromValue(@NonNull String encodedName) throws NoSuchFieldException { for (TextInputType textInputType : TextInputType.values()) { diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java index f6d4f8eb31..a3affe66c3 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java @@ -155,6 +155,8 @@ public class TextInputPlugin { textType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS; } else if (type.type == TextInputChannel.TextInputType.URL) { textType |= InputType.TYPE_TEXT_VARIATION_URI; + } else if (type.type == TextInputChannel.TextInputType.VISIBLE_PASSWORD) { + textType |= InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; } if (obscureText) {