Show a spinner if a slice is loading when action is tapped

Behaviour:
* Action clicks -> show a spinner in place of the action
* Content clicks -> show a spinner in the header
* Spinners are tinted using colorControlHighlight, tested in
  light / dark theme
* Loading state persists across mode and layout changes

* Made RowView a bit better at not clobbering all its stuff when any
  update happens (whether slice or style / layout changes); decoupled:
  - changes in header actions / end items
  - changes in subtitle / last updated text
  - removed some duplicated logic by calling through to SliceView
    for row clicks

* Fixes an issue where end container showing actions / images wasn’t
  ‘gone’ when not showing anything
* Fixes an issue where shortcuts could have null actions

Fixes: 110224343
Test: ./gradlew slice-view:connectedCheck + manual
      manual: CP ag/4462524 for delay hack in loading the live slice and then:
      1) Ride slice, set serialized
         - tap on header, tap on home button, tap on work row
         => each should show a spinner
         - switch from large -> small and back; all spinners should
           remain if the row is visible
         - eventually updates with live slice and spinners are cleared
      2) Contact slice, set serialized
         - tap on bottom area, this activates primary action on this
           slice so a spinner should show in the header row
         - tap on header actions
         => each should show a spinner
         - switch from large -> small -> shortcut -> large; spinners
           should remain in small / large
         - eventually updates with live slice and spinners are cleared
      3) Wifi slice, set serialized
         - tap on header, toggle, and a list item
         => each should show a spinner
         - switch from large -> small; all spinners should remain
         - disable scrolling; tap on ‘see more’ button; note spinner
         - eventually updates with live slice and spinners are cleared
Change-Id: I9b6fcaa97e8cce585380802a82ed493b7253b5c9
13 files changed
tree: 6010c8055bb85de91affacc68ab4062461775b09
  1. .idea/
  2. annotations/
  3. api/
  4. app-toolkit/
  5. appcompat/
  6. asynclayoutinflater/
  7. benchmark/
  8. browser/
  9. buildSrc/
  10. car/
  11. cardview/
  12. collection/
  13. compat/
  14. content/
  15. coordinatorlayout/
  16. core/
  17. cursoradapter/
  18. customview/
  19. development/
  20. docs-fake/
  21. documentfile/
  22. drawerlayout/
  23. dynamic-animation/
  24. emoji/
  25. exifinterface/
  26. fragment/
  27. frameworks/
  28. gradle/
  29. graphics/
  30. gridlayout/
  31. heifwriter/
  32. interpolator/
  33. jetifier/
  34. leanback/
  35. leanback-preference/
  36. legacy/
  37. lifecycle/
  38. loader/
  39. localbroadcastmanager/
  40. media/
  41. media-widget/
  42. media2/
  43. mediarouter/
  44. navigation/
  45. paging/
  46. palette/
  47. percent/
  48. persistence/
  49. preference/
  50. print/
  51. recommendation/
  52. recyclerview/
  53. recyclerview-selection/
  54. room/
  55. samples/
  56. scripts/
  57. slices/
  58. slidingpanelayout/
  59. swiperefreshlayout/
  60. testutils/
  61. testutils-ktx/
  62. textclassifier/
  63. transition/
  64. tv-provider/
  65. versionedparcelable/
  66. viewpager/
  67. viewpager2/
  68. wear/
  69. webkit/
  70. work/
  71. .gitignore
  72. adding-support-library-as-included-build.md
  73. build.gradle
  74. gradle.properties
  75. gradlew
  76. include-composite-deps.gradle
  77. include-support-library.gradle
  78. LICENSE.txt
  79. OWNERS
  80. PREUPLOAD.cfg
  81. README.md
  82. settings.gradle
README.md

AOSP Support Library Contribution Guide

Accepted Types of Contributions

  • Bug fixes (needs a corresponding bug report in b.android.com)
  • Each bug fix is expected to come with tests
  • Fixing spelling errors
  • Updating documentation
  • Adding new tests to the area that is not currently covered by tests

We are not currently accepting new modules, features, or behavior changes.

Checking Out the Code

NOTE: You will need to use Linux or Mac OS. Building under Windows is not currently supported.

Follow the “Downloading the Source” guide to install and set up repo tool, but instead of running the listed repo commands to initialize the repository, run the folowing:

repo init -u https://android.googlesource.com/platform/manifest -b ub-supportlib-master

Now your repository is set to pull only what you need for building and running support library. Download the code (and grab a coffee while we pull down 7GB):

repo sync -j8 -c

You will use this command to sync your checkout in the future - it’s similar to git fetch

Using Android Studio

Open path/to/checkout/frameworks/support/ in Android Studio. Now you're ready edit, run, and test!

If you get “Unregistered VCS root detected” click “Add root” to enable git integration for Android Studio.

If you see any warnings (red underlines) run Build > Clean Project.

Builds

Full Build (Optional)

You can do most of your work from Android Studio, however you can also build the full support library from command line:

cd path/to/checkout/frameworks/support/
./gradlew createArchive

Building Support Library as part of your App build

If you intend to repeatedly make changes to Support Library and to wish to see the results in your app, and you don't want to have to repeatedly build them as separate Gradle projects, you can configure your app build to build Support Library too

Running Tests

Single Test Class or Method

  1. Open the desired test file in Android Studio.
  2. Right-click on a test class or @Test method name and select Run FooBarTest

Full Test Package

  1. In the project side panel open the desired module.
  2. Find the directory with the tests
  3. Right-click on the directory and select Run android.support.foobar

Running Sample Apps

Support library has a set of Android applications that exercise support library code. These applications can be useful when you want to debug a real running application, or reproduce a problem interactively, before writing test code.

These applications are named support-*-demos (e.g. support-4v-demos or support-leanback-demos. You can run them by clicking Run > Run ... and choosing the desired application.

Making a change

cd path/to/checkout/frameworks/support/
repo start my_branch_name .
(make needed modifications)
git commit -a
repo upload --current-branch .

If you see the following prompt, choose always:

Run hook scripts from https://android.googlesource.com/platform/manifest (yes/always/NO)?

Getting reviewed

  • After you run repo upload, open r.android.com
  • Sign in into your account (or create one if you do not have one yet)
  • Add an appropriate reviewer (use git log to find who did most modifications on the file you are fixing)