diff options
| author | Mady Mellor <madym@google.com> | 2017-11-08 14:15:43 -0800 |
|---|---|---|
| committer | Mady Mellor <madym@google.com> | 2017-11-14 12:01:54 -0800 |
| commit | fc2b340cf4e20e91ee77f2d843a289cb37908379 (patch) | |
| tree | 956fc84bec4b024bab78cfaf429c4292aec00433 /core/java | |
| parent | 5d8150092ddd0e33849664d9b5f9abd260c3d408 (diff) | |
Add hints for toggles in Slice
Test: Manual, build a slice with a toggle needs the support lib CL to
present the toggle
Bug: 68378574
Change-Id: I4cdae84e11e2b182663186f862fed95e3bacbac5
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/slice/Slice.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/app/slice/Slice.java b/core/java/android/app/slice/Slice.java index 1ce89d2a009b..fdf8c070b34f 100644 --- a/core/java/android/app/slice/Slice.java +++ b/core/java/android/app/slice/Slice.java @@ -113,6 +113,14 @@ public final class Slice implements Parcelable { */ public static final String HINT_HIDDEN = "hidden"; /** + * Hint to indicate that this content has a toggle action associated with it. To indicate that + * the toggle is on, use {@link #HINT_SELECTED}. When the toggle state changes, the intent + * associated with it will be sent along with an extra {@link #EXTRA_TOGGLE_STATE} which can be + * retrieved to see the new state of the toggle. + * @hide + */ + public static final String HINT_TOGGLE = "toggle"; + /** * Hint to indicate that this slice is incomplete and an update will be sent once * loading is complete. Slices which contain HINT_PARTIAL will not be cached by the * OS and should not be cached by apps. @@ -125,6 +133,11 @@ public final class Slice implements Parcelable { * @hide */ public static final String HINT_ALT = "alt"; + /** + * Key to retrieve an extra added to an intent when a control is changed. + * @hide + */ + public static final String EXTRA_TOGGLE_STATE = "android.app.slice.extra.TOGGLE_STATE"; private final SliceItem[] mItems; private final @SliceHint String[] mHints; |
