From f34c6275f14746baf73289c835fa8052683d21b8 Mon Sep 17 00:00:00 2001 From: Svet Ganov Date: Thu, 19 Mar 2020 00:27:53 -0700 Subject: [PATCH] Update the sample keyboard to showcase scroll, clip, toggle The keyboard now showcases how one can implement a suggestion strip with some pinned suggestions on the left and the right of the strip and the strip suggestions are scrollable and well as clipped to the scroll are's bounds. Also this showcases how to toggle the layering of the suggestions to temporary amimate on top of them. Fun, fun fun :) bug:1234567 Change-Id: I7f2a6ea148de31be7cd0f13f56d72f6e5246a5f8 --- .../res/layout/keyboard_10_9_9.xml | 40 ++- .../AutofillKeyboard/res/values/colors.xml | 19 ++ .../AutofillKeyboard/res/values/dimens.xml | 2 +- .../AutofillKeyboard/res/values/styles.xml | 12 +- .../autofillkeyboard/AutofillImeService.java | 232 ++++++++++++------ .../InlineContentClipView.java | 229 +++++++++++++++++ .../src/foo/bar/inline/InlineFillService.java | 84 ++++--- 7 files changed, 490 insertions(+), 128 deletions(-) create mode 100644 samples/AutofillKeyboard/res/values/colors.xml create mode 100644 samples/AutofillKeyboard/src/com/example/android/autofillkeyboard/InlineContentClipView.java diff --git a/samples/AutofillKeyboard/res/layout/keyboard_10_9_9.xml b/samples/AutofillKeyboard/res/layout/keyboard_10_9_9.xml index fc7bdb174..14f5bb4f4 100644 --- a/samples/AutofillKeyboard/res/layout/keyboard_10_9_9.xml +++ b/samples/AutofillKeyboard/res/layout/keyboard_10_9_9.xml @@ -22,14 +22,43 @@ xmlns:android="http://schemas.android.com/apk/res/android" style="@style/KeyboardArea"> - + + android:id="@+id/pinned_suggestions_start" + style="@style/PinnedSuggestionArea"> - + + + + + + + + + + + + + + + + + diff --git a/samples/AutofillKeyboard/res/values/colors.xml b/samples/AutofillKeyboard/res/values/colors.xml new file mode 100644 index 000000000..ace840cd7 --- /dev/null +++ b/samples/AutofillKeyboard/res/values/colors.xml @@ -0,0 +1,19 @@ + + + + + #FFEEEEEE + \ No newline at end of file diff --git a/samples/AutofillKeyboard/res/values/dimens.xml b/samples/AutofillKeyboard/res/values/dimens.xml index 401ea9188..e70ae9af7 100644 --- a/samples/AutofillKeyboard/res/values/dimens.xml +++ b/samples/AutofillKeyboard/res/values/dimens.xml @@ -22,6 +22,6 @@ 24dp 14dp - 41dp + 48dp 48dp diff --git a/samples/AutofillKeyboard/res/values/styles.xml b/samples/AutofillKeyboard/res/values/styles.xml index 63068b535..7a62b2fcf 100644 --- a/samples/AutofillKeyboard/res/values/styles.xml +++ b/samples/AutofillKeyboard/res/values/styles.xml @@ -25,18 +25,26 @@ wrap_content bottom vertical - #FFFFFFFF + bottom + +