The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package 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 | */ |
| 26 | public interface ListAdapter extends Adapter { |
| 27 | |
| 28 | /** |
Romain Guy | 68b6b1c | 2011-02-23 16:05:07 -0800 | [diff] [blame] | 29 | * 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 Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | * |
Romain Guy | 68b6b1c | 2011-02-23 16:05:07 -0800 | [diff] [blame] | 34 | * @return True if all items are enabled, false otherwise. |
| 35 | * |
| 36 | * @see #isEnabled(int) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | */ |
| 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 Debunne | 34783aa | 2010-03-24 14:47:28 -0700 | [diff] [blame] | 43 | * |
| 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 Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | * |
| 47 | * @param position Index of the item |
Romain Guy | 68b6b1c | 2011-02-23 16:05:07 -0800 | [diff] [blame] | 48 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | * @return True if the item is not a separator |
Romain Guy | 68b6b1c | 2011-02-23 16:05:07 -0800 | [diff] [blame] | 50 | * |
| 51 | * @see #areAllItemsEnabled() |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | */ |
| 53 | boolean isEnabled(int position); |
| 54 | } |