1 /* 2 * Copyright (C) 2015 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 package com.android.support.car.lenspicker; 17 18 import android.content.Intent; 19 import android.graphics.drawable.Drawable; 20 21 /** 22 * Object to hold all necessary information required to represent an application/activity 23 * in the lens picker. 24 */ 25 public class LensPickerItem { 26 private final Drawable mIcon; 27 private final String mLabel; 28 private final Intent mLaunchIntent; 29 private final String mFacetId; 30 31 public LensPickerItem(String label, Drawable icon, Intent launchIntent, String facetId) { 32 mIcon = icon; 33 mLabel = label; 34 mLaunchIntent = launchIntent; 35 mFacetId = facetId; 36 } 37 38 /** 39 * Gets a {@link Drawable} icon to represent this {@link LensPickerItem}. 40 */ 41 public Drawable getIcon() { 42 return mIcon; 43 } 44 45 /** 46 * Gets a label that describes this {@link LensPickerItem}. 47 */ 48 public String getLabel() { 49 return mLabel; 50 } 51 52 /** 53 * Gets the {@link Intent} to be launched when this {@link LensPickerItem} is selected. 54 */ 55 public Intent getLaunchIntent() { 56 return mLaunchIntent; 57 } 58 59 /** 60 * Gets the id that identifies which facet this {@link LensPickerItem} belongs to. 61 */ 62 public String getFacetId(){ 63 return mFacetId; 64 } 65 } 66