Android 12 Developer Preview is here! Try it out, and give us your feedback!

Slice

Display templated UI elements outside your app.
Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
January 13, 2021 1.0.0 - - 1.1.0-alpha02

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.1.0

Version 1.1.0-alpha02

January 13, 2021

androidx.slice:slice-builders:1.1.0-alpha02, androidx.slice:slice-core:1.1.0-alpha02, and androidx.slice:slice-view:1.1.0-alpha02 are released. Version 1.1.0-alpha02 contains these commits.

API Changes

  • Support pickers in slice actions in row view (I4d965)
  • SliceAction support for GridRow (Ie289b)
  • Added Time picker text, which creates a time picker or date picker dialog when tapped. (I07deb)
  • Fixed an issue for Treehug error (I416cc)
  • Added ListBuilder.StarRatingBuilder, which is a row that supports star rating inputs for slices. (I25aec)
  • Replaced ListBuilder#setHostExtra with ListBuilder#setHostExtras to accept a bundle (I43ec7, b/)
  • Added new API ListBuilder#setHostExtra and SliceMetadata#getHostExtras to save and extract additional information for the host from slice. (Ib0768, b/)
  • Added new API for RowBuilder to indicate end of a section and show bottom line divider. (I23ddd, b/)
  • Add nullabilities annotation in slice builders for better kotlin interop. (If00f1, b/166489398)
  • Added CellBuilder.addOverlayText, which overlays text on the image in the cell. (I09d97)
  • Added imageCornerRadius attribute for applying rounded corners to SliceHints.LARGE_IMAGE images/icons. (I3e8f8)
  • Make configureViewPolicy protected instead of private so it can be called from subclasses. (I6772b)
  • Support raw images in gridrow view being sized for portrait and landscape images. (I925fb)
  • Added a new API SliceView#getNumberOfHiddenItems to obtain the number of slice items that didn't fit into the view. (I09651)
  • Added SliceView#setRowStyleFactory to allow slice hosts to customize the style of each row based on slice metadata. (Ia8f2e)

Bug Fixes

  • Fix Picker Slice action on Gridrow as only item (I3d899)

External Contribution

  • API lint check for the StaticFinalBuilder is enabled for androidx (I2b11b, b/138602561)

Slice-Builders-Ktx Version 1.0.0-alpha08

January 13, 2021

androidx.slice:slice-builders-ktx:1.0.0-alpha08 is released. Version 1.0.0-alpha08 contains these commits.

Updated to depend on slice-builders 1.1.0-alpha02.

Version 1.1.0-alpha01

May 7, 2019

androidx.slice:slice-builders:1.1.0-alpha01, androidx.slice:slice-builders-ktx:1.0.0-alpha07, androidx.slice:slice-core:1.1.0-alpha01, and androidx.slice:slice-view:1.1.0-alpha01 are released. The commits included in this version can be found here.

New features

  • onCreatePermissionRequest can be overridden in SliceProvider to customize the permission grant behavior

Bug fixes

  • Fixed OnSliceActionListener was not getting called when a row item with only one action was clicked
  • Fixed SliceView has not respecting MeasureSpec.EXACTLY layout params
  • Fixed duplicate onClick during onLongClick on SliceView