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 
17 package com.android.setupwizardlib.items;
18 
19 import android.view.View;
20 
21 /** Representation of an item in an {@link ItemHierarchy}. */
22 public interface IItem {
23 
24   /**
25    * Get the Android resource ID for locating the layout for this item.
26    *
27    * @return Resource ID for the layout of this item. This layout will be used to inflate the View
28    *     passed to {@link #onBindView(android.view.View)}.
29    */
getLayoutResource()30   int getLayoutResource();
31 
32   /**
33    * Called by items framework to display the data specified by this item. This method should update
34    * {@code view} to reflect its data.
35    *
36    * @param view A view inflated from {@link #getLayoutResource()}, which should be updated to
37    *     display data from this item. This view may be recycled from other items with the same
38    *     layout resource.
39    */
onBindView(View view)40   void onBindView(View view);
41 
42   /** @return True if this item is enabled. */
isEnabled()43   boolean isEnabled();
44 }
45