Home | History | Annotate | Download | only in core
      1 /*
      2  * Copyright 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package androidx.slice.core;
     18 
     19 import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
     20 
     21 import static java.lang.annotation.RetentionPolicy.SOURCE;
     22 
     23 import androidx.annotation.IntDef;
     24 import androidx.annotation.RestrictTo;
     25 
     26 import java.lang.annotation.Retention;
     27 
     28 /**
     29  * Temporary class to contain hint constants for slices to be used.
     30  * @hide
     31  */
     32 @RestrictTo(LIBRARY_GROUP)
     33 public class SliceHints {
     34 
     35     /**
     36      * Subtype indicating that this content is the minimum value for a range.
     37      */
     38     public static final String SUBTYPE_MIN = "min";
     39 
     40     /**
     41      * The meta-data key that allows an activity to easily be linked directly to a slice.
     42      * <p>
     43      * An activity can be statically linked to a slice uri by including a meta-data item
     44      * for this key that contains a valid slice uri for the same application declaring
     45      * the activity.
     46      */
     47     public static final String SLICE_METADATA_KEY = "android.metadata.SLICE_URI";
     48 
     49     /**
     50      * A hint to indicate that the contents of this subslice represent a list of keywords
     51      * related to the parent slice.
     52      */
     53     public static final String HINT_KEYWORDS = "keywords";
     54 
     55     /**
     56      * Hint indicating an item representing a time-to-live for the content.
     57      */
     58     public static final String HINT_TTL = "ttl";
     59 
     60     /**
     61      * Hint indicating an item representing when the content was created or last updated.
     62      */
     63     public static final String HINT_LAST_UPDATED = "last_updated";
     64 
     65     /**
     66      * Subtype to tag an item as representing a time in milliseconds since midnight,
     67      * January 1, 1970 UTC.
     68      */
     69     public static final String SUBTYPE_MILLIS = "millis";
     70 
     71     public static final String HINT_PERMISSION_REQUEST = "permission_request";
     72 
     73     @IntDef({
     74             LARGE_IMAGE, SMALL_IMAGE, ICON_IMAGE, UNKNOWN_IMAGE
     75     })
     76     @Retention(SOURCE)
     77     public @interface ImageMode{}
     78 
     79     /**
     80      * Indicates that an image should be presented as an icon and it can be tinted.
     81      */
     82     public static final int ICON_IMAGE = 0;
     83     /**
     84      * Indicates that an image should be presented in a smaller size and it shouldn't be tinted.
     85      */
     86     public static final int SMALL_IMAGE = 1;
     87     /**
     88      * Indicates that an image presented in a larger size and it shouldn't be tinted.
     89      */
     90     public static final int LARGE_IMAGE = 2;
     91     /**
     92      * Indicates that an image mode is unknown.
     93      */
     94     public static final int UNKNOWN_IMAGE = 3;
     95 
     96     /**
     97      * Constant representing infinity.
     98      */
     99     public static final long INFINITY = -1;
    100 
    101     private SliceHints() {
    102     }
    103 }
    104