Home | History | Annotate | Download | only in widget
      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     /**
     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.)
     33      *
     34      * @return True if all items are enabled, false otherwise.
     35      *
     36      * @see #isEnabled(int)
     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).
     43      *
     44      * The result is unspecified if position is invalid. An {@link ArrayIndexOutOfBoundsException}
     45      * should be thrown in that case for fast failure.
     46      *
     47      * @param position Index of the item
     48      *
     49      * @return True if the item is not a separator
     50      *
     51      * @see #areAllItemsEnabled()
     52      */
     53     boolean isEnabled(int position);
     54 }
     55