blob: d8fd1c987bff568eafbb0dfd7d43b85d345c6c82 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 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
17package android.widget;
18
19/**
20 * Extended {@link Adapter} that is the bridge between a {@link ListView}
21 * and the data that backs the list. Frequently that data comes from a Cursor,
22 * but that is not
23 * required. The ListView can display any data provided that it is wrapped in a
24 * ListAdapter.
25 */
26public interface ListAdapter extends Adapter {
27
28 /**
Romain Guy68b6b1c2011-02-23 16:05:07 -080029 * Indicates whether all the items in this adapter are enabled. If the
30 * value returned by this method changes over time, there is no guarantee
31 * it will take effect. If true, it means all items are selectable and
32 * clickable (there is no separator.)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033 *
Romain Guy68b6b1c2011-02-23 16:05:07 -080034 * @return True if all items are enabled, false otherwise.
35 *
36 * @see #isEnabled(int)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037 */
38 public boolean areAllItemsEnabled();
39
40 /**
41 * Returns true if the item at the specified position is not a separator.
42 * (A separator is a non-selectable, non-clickable item).
Gilles Debunne34783aa2010-03-24 14:47:28 -070043 *
44 * The result is unspecified if position is invalid. An {@link ArrayIndexOutOfBoundsException}
45 * should be thrown in that case for fast failure.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046 *
47 * @param position Index of the item
Romain Guy68b6b1c2011-02-23 16:05:07 -080048 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049 * @return True if the item is not a separator
Romain Guy68b6b1c2011-02-23 16:05:07 -080050 *
51 * @see #areAllItemsEnabled()
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052 */
53 boolean isEnabled(int position);
54}