public class

SliceHints

extends java.lang.Object

 java.lang.Object

↳androidx.slice.core.SliceHints

Gradle dependencies

compile group: 'androidx.slice', name: 'slice-core', version: '1.1.0-alpha02'

  • groupId: androidx.slice
  • artifactId: slice-core
  • version: 1.1.0-alpha02

Artifact androidx.slice:slice-core:1.1.0-alpha02 it located at Google repository (https://maven.google.com/)

Androidx artifact mapping:

androidx.slice:slice-core com.android.support:slices-core

Overview

Temporary class to contain hint constants for slices to be used.

Summary

Fields
public static final intACTION_WITH_LABEL

Indicates that an action with label.

public static final intDETERMINATE_RANGE

Indicates that the content is the determinate mode for a range.

public static final java.lang.StringHINT_ACTIVITY

Hint indicating that the action/slice tagged with this will launch an activity.

public static final java.lang.StringHINT_CACHED

Hint indicating that this slice was parsed from a serialized format.

public static final java.lang.StringHINT_END_OF_SECTION

Hint indicating that this slice is the end of section and may need some form of visual separation.

public static final java.lang.StringHINT_OVERLAY

Hint indicating that the text in this slice should be used to overlay an image.

public static final java.lang.StringHINT_RAW

Hint indicating that the content in this slice should be left unaltered as much as possible.

public static final java.lang.StringHINT_SELECTION_OPTION

Hint indicating that this slice represents an option selectable in a selection slice.

public static final java.lang.StringHINT_SHOW_LABEL

Hint indicating that the button in this slice should be shown as text button.

public static final intICON_IMAGE

Indicates that an image should be presented as an icon and it can be tinted.

public static final intINDETERMINATE_RANGE

Indicates that the content is the indeterminate mode for a range.

public static final longINFINITY

Constant representing infinity.

public static final intLARGE_IMAGE

Indicates that an image presented in a larger size and it shouldn't be tinted.

public static final intRAW_IMAGE_LARGE

Indicates that an image should be presented in its intrinsic size and shouldn't be tinted.

public static final intRAW_IMAGE_SMALL

Indicates that an image should be presented in its intrinsic size and shouldn't be tinted.

public static final java.lang.StringSLICE_METADATA_KEY

The meta-data key that allows an activity to easily be linked directly to a slice.

public static final intSMALL_IMAGE

Indicates that an image should be presented in a smaller size and it shouldn't be tinted.

public static final intSTAR_RATING

Indicates that the content is the star rating mode for a range.

public static final java.lang.StringSUBTYPE_DATE_PICKER

Subtype indicating that this slice represents a Date Picker.

public static final java.lang.StringSUBTYPE_HOST_EXTRAS

public static final java.lang.StringSUBTYPE_MILLIS

Subtype to tag an item as representing a time in milliseconds since midnight, January 1, 1970 UTC.

public static final java.lang.StringSUBTYPE_MIN

Subtype indicating that this content is the minimum value for a range.

public static final java.lang.StringSUBTYPE_SELECTION

Subtype indicating that this slice represents a selection.

public static final java.lang.StringSUBTYPE_SELECTION_OPTION_KEY

Subtype indicating that this slice represents the key passed back to the application when the user selects this option.

public static final java.lang.StringSUBTYPE_SELECTION_OPTION_VALUE

Subtype indicating that this slice represents the text displayed to the user for this option.

public static final java.lang.StringSUBTYPE_TIME_PICKER

Subtype indicating that this slice represents a Time Picker.

public static final intUNKNOWN_IMAGE

Indicates that an image mode is unknown.

Methods
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final java.lang.String SUBTYPE_MIN

Subtype indicating that this content is the minimum value for a range.

public static final int DETERMINATE_RANGE

Indicates that the content is the determinate mode for a range.

public static final int INDETERMINATE_RANGE

Indicates that the content is the indeterminate mode for a range.

public static final int STAR_RATING

Indicates that the content is the star rating mode for a range.

public static final java.lang.String SLICE_METADATA_KEY

The meta-data key that allows an activity to easily be linked directly to a slice.

An activity can be statically linked to a slice uri by including a meta-data item for this key that contains a valid slice uri for the same application declaring the activity.

public static final java.lang.String SUBTYPE_MILLIS

Subtype to tag an item as representing a time in milliseconds since midnight, January 1, 1970 UTC.

public static final java.lang.String HINT_ACTIVITY

Hint indicating that the action/slice tagged with this will launch an activity.

public static final java.lang.String HINT_END_OF_SECTION

Hint indicating that this slice is the end of section and may need some form of visual separation.

public static final java.lang.String HINT_CACHED

Hint indicating that this slice was parsed from a serialized format.

public static final java.lang.String HINT_RAW

Hint indicating that the content in this slice should be left unaltered as much as possible.

public static final java.lang.String HINT_OVERLAY

Hint indicating that the text in this slice should be used to overlay an image.

public static final java.lang.String HINT_SHOW_LABEL

Hint indicating that the button in this slice should be shown as text button.

public static final java.lang.String SUBTYPE_SELECTION

Subtype indicating that this slice represents a selection. The options will be included as sub-slices.

public static final java.lang.String SUBTYPE_DATE_PICKER

Subtype indicating that this slice represents a Date Picker.

public static final java.lang.String SUBTYPE_TIME_PICKER

Subtype indicating that this slice represents a Time Picker.

public static final java.lang.String HINT_SELECTION_OPTION

Hint indicating that this slice represents an option selectable in a selection slice. The parent of this slice must be of subtype SliceHints.SUBTYPE_SELECTION.

public static final java.lang.String SUBTYPE_SELECTION_OPTION_KEY

Subtype indicating that this slice represents the key passed back to the application when the user selects this option. The parent of this slice must have hint SliceHints.HINT_SELECTION_OPTION. Expected to be an item of format .

public static final java.lang.String SUBTYPE_SELECTION_OPTION_VALUE

Subtype indicating that this slice represents the text displayed to the user for this option. The parent of this slice must have hint SliceHints.HINT_SELECTION_OPTION. Expected to be an item of format .

public static final java.lang.String SUBTYPE_HOST_EXTRAS

public static final int ICON_IMAGE

Indicates that an image should be presented as an icon and it can be tinted.

public static final int SMALL_IMAGE

Indicates that an image should be presented in a smaller size and it shouldn't be tinted.

public static final int LARGE_IMAGE

Indicates that an image presented in a larger size and it shouldn't be tinted.

public static final int RAW_IMAGE_SMALL

Indicates that an image should be presented in its intrinsic size and shouldn't be tinted. If SliceView in the call-site doesn't support RAW_IMAGE, fallback to SMALL_IMAGE instead.

public static final int RAW_IMAGE_LARGE

Indicates that an image should be presented in its intrinsic size and shouldn't be tinted. If SliceView in the call-site doesn't support RAW_IMAGE, fallback to LARGE_IMAGE instead.

public static final int UNKNOWN_IMAGE

Indicates that an image mode is unknown.

public static final int ACTION_WITH_LABEL

Indicates that an action with label.

public static final long INFINITY

Constant representing infinity.

Source

/*
 * Copyright 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.slice.core;

import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;

import static java.lang.annotation.RetentionPolicy.SOURCE;

import androidx.annotation.IntDef;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;

import java.lang.annotation.Retention;

/**
 * Temporary class to contain hint constants for slices to be used.
 * @hide
 */
@RestrictTo(LIBRARY_GROUP_PREFIX)
@RequiresApi(19)
public class SliceHints {

    /**
     * Subtype indicating that this content is the minimum value for a range.
     */
    public static final String SUBTYPE_MIN = "min";

    /**
     * Indicates that the content is the determinate mode for a range.
     */
    public static final int DETERMINATE_RANGE = 0;

    /**
     * Indicates that the content is the indeterminate mode for a range.
     */
    public static final int INDETERMINATE_RANGE = 1;

    /**
     * Indicates that the content is the star rating mode for a range.
     */
    public static final int STAR_RATING = 2;

    /**
     * The meta-data key that allows an activity to easily be linked directly to a slice.
     * <p>
     * An activity can be statically linked to a slice uri by including a meta-data item
     * for this key that contains a valid slice uri for the same application declaring
     * the activity.
     */
    public static final String SLICE_METADATA_KEY = "android.metadata.SLICE_URI";

    /**
     * Subtype to tag an item as representing a time in milliseconds since midnight,
     * January 1, 1970 UTC.
     */
    public static final String SUBTYPE_MILLIS = "millis";

    /**
     * Hint indicating that the action/slice tagged with this will launch an activity.
     */
    public static final String HINT_ACTIVITY = "activity";

    /**
     * Hint indicating that this slice is the end of section and may need some form of visual
     * separation.
     */
    public static final String HINT_END_OF_SECTION = "end_of_section";

    /**
     * Hint indicating that this slice was parsed from a serialized format.
     */
    public static final String HINT_CACHED = "cached";

    /**
     * Hint indicating that the content in this slice should be left unaltered as much as possible.
     */
    public static final String HINT_RAW = "raw";

    /**
     * Hint indicating that the text in this slice should be used to overlay an image.
     */
    public static final String HINT_OVERLAY = "overlay";

    /**
     * Hint indicating that the button in this slice should be shown as text button.
     */
    public static final String HINT_SHOW_LABEL = "show_label";

    /**
     * Subtype indicating that this slice represents a selection. The options will be included as
     * sub-slices.
     */
    public static final String SUBTYPE_SELECTION = "selection";

    /**
     * Subtype indicating that this slice represents a Date Picker.
     */
    public static final String SUBTYPE_DATE_PICKER = "date_picker";
    /**
     * Subtype indicating that this slice represents a Time Picker.
     */
    public static final String SUBTYPE_TIME_PICKER = "time_picker";

    /**
     * Hint indicating that this slice represents an option selectable in a selection slice.
     * The parent of this slice must be of subtype {@link #SUBTYPE_SELECTION}.
     */
    public static final String HINT_SELECTION_OPTION = "selection_option";

    /**
     * Subtype indicating that this slice represents the key passed back to the application when the
     * user selects this option. The parent of this slice must have hint
     * {@link #HINT_SELECTION_OPTION}.
     *
     * Expected to be an item of format {@link androidx.slice.SliceItem@FORMAT_TEXT}.
     */
    public static final String SUBTYPE_SELECTION_OPTION_KEY = "selection_option_key";

    /**
     * Subtype indicating that this slice represents the text displayed to the user for this option.
     * The parent of this slice must have hint {@link #HINT_SELECTION_OPTION}.
     *
     * Expected to be an item of format {@link androidx.slice.SliceItem@FORMAT_TEXT}.
     */
    public static final String SUBTYPE_SELECTION_OPTION_VALUE = "selection_option_value";

    public static final String SUBTYPE_HOST_EXTRAS = "host_extras";


    /**
     * Indicates that an image should be presented as an icon and it can be tinted.
     */
    public static final int ICON_IMAGE = 0;
    /**
     * Indicates that an image should be presented in a smaller size and it shouldn't be tinted.
     */
    public static final int SMALL_IMAGE = 1;
    /**
     * Indicates that an image presented in a larger size and it shouldn't be tinted.
     */
    public static final int LARGE_IMAGE = 2;
    /**
     * Indicates that an image should be presented in its intrinsic size and shouldn't be tinted.
     * If SliceView in the call-site doesn't support RAW_IMAGE, fallback to SMALL_IMAGE instead.
     */
    public static final int RAW_IMAGE_SMALL = 3;
    /**
     * Indicates that an image should be presented in its intrinsic size and shouldn't be tinted.
     * If SliceView in the call-site doesn't support RAW_IMAGE, fallback to LARGE_IMAGE instead.
     */
    public static final int RAW_IMAGE_LARGE = 4;
    /**
     * Indicates that an image mode is unknown.
     */
    public static final int UNKNOWN_IMAGE = 5;
    /**
     * Indicates that an action with label.
     */
    public static final int ACTION_WITH_LABEL = 6;

    @IntDef({
            LARGE_IMAGE, SMALL_IMAGE, ICON_IMAGE, RAW_IMAGE_SMALL, RAW_IMAGE_LARGE, UNKNOWN_IMAGE,
            ACTION_WITH_LABEL
    })
    @Retention(SOURCE)
    public @interface ImageMode {
    }

    /**
     * Constant representing infinity.
     */
    public static final long INFINITY = -1;

    private SliceHints() {
    }
}