Add new snackbar features to prepare for omnibox geolocation snackbar.
commit2b2cd69f0833466cd9b818575404bf05103ca7bd
authornewt <newt@chromium.org>
Thu, 9 Jul 2015 01:57:07 +0000 (8 18:57 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 9 Jul 2015 01:57:32 +0000 (9 01:57 +0000)
tree247cbce95a65891297e18cab1210d91ec6175f5d
parent5c46d6d7a3c3f9801c7f203f512bc944791ffacc
Add new snackbar features to prepare for omnibox geolocation snackbar.

This adds a few new features to snackbars to prepare for the geolocation
disclosure snackbar:
 - Snackbars now interact nicely with the keyboard. Snackbars won't
   overlap the keyboard; instead, they're appear above the keyboard if
   the keyboard is showing, and will drop down the bottom of the screen
   when the keyboard is hidden. This is achieved using
   View.getWindowVisibleDisplayFrame() to find where the keyboard is
   showing.
 - Snackbars now support multiline text. In this case, the snackbar text
   won't be ellipsized and TemplatePreservingTextView will act like a
   normal TextView.
 - Snackbar text can now be any CharSequence, not just a String. This
   will be used to display snackbars that contain spans.

Implementation change: this adds a Snackbar class, which allows greater
flexibility when configuring snackbars. SnackbarManager.showSnackbar()
now acceps a single Snackbar, instead of a long list of parameters.

BUG=505481

Review URL: https://codereview.chromium.org/1229733002

Cr-Commit-Position: refs/heads/master@{#337966}
12 files changed:
chrome/android/java/res/anim/snackbar_in_with_keyboard.xml [new file with mode: 0644]
chrome/android/java/res/color/snackbar_button_color.xml [moved from chrome/android/java/res/color/snack_bar_button_color.xml with 100% similarity]
chrome/android/java/res/layout/snackbar.xml [moved from chrome/android/java/res/layout/snack_bar.xml with 75% similarity]
chrome/android/java/res/values-v17/styles.xml
chrome/android/java/res/values/dimens.xml
chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkActivity.java
chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java [new file with mode: 0644]
chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarManager.java
chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarPopupWindow.java
chrome/android/java/src/org/chromium/chrome/browser/snackbar/TemplatePreservingTextView.java
chrome/android/javatests/src/org/chromium/chrome/browser/tab/UndoIntegrationTest.java