OSDN Git Service

Filter shortcuts down to 4 if there are more.
authorTony Wickham <twickham@google.com>
Wed, 27 Jul 2016 19:32:32 +0000 (12:32 -0700)
committerTony Wickham <twickham@google.com>
Fri, 29 Jul 2016 23:10:43 +0000 (16:10 -0700)
commitc39edf54e6bda1c5187ea61c358b6af81266c21f
tree7e15b5605a318ab42af2d4e4249e97610b7914c8
parent72dc60c5760166699effee7be17528de7f29fa67
Filter shortcuts down to 4 if there are more.

- We take the first 4 in sorted order, except we remove up to 2
  static shortcuts to make room for dynamic ones if they exist.
- Added ShortcutFilterTest with testSortAndFilterShortcuts().
  This asserts that the filtered list is sorted and has the
  expected number of static and dynamic shortcuts based on
  inputs with various amounts of each.

Bug: 28980830
Change-Id: I832b6b21144f17c74bb8b90a840d6620e99911b8
src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
src/com/android/launcher3/shortcuts/ShortcutFilter.java [new file with mode: 0644]
tests/src/com/android/launcher3/shortcuts/ShortcutFilterTest.java [new file with mode: 0644]