Android Programming learning abstract class AbsListView usage example analysis

  • 2020-11-03 22:35:40
  • OfStack

This article illustrates the use of AbsListView as an abstract class for Android programming learning. To share for your reference, the details are as follows:

1. Inheritance relationship

public abstract class AbsListView extends AdapterView < T extendsAdapter >

java.lang.Object
android.view.View
android.view.ViewGroup
android.widget.AdapterView < T extends android.widget.Adapter >
android.widget.AbsListView

2. AbsListView overview

The base class used to implement a virtual list for a series 1 entry, but the list is not spatially-defined here. For example, a subclass of this class can display the contents of the virtual list as a grid, a rotatable list, a stack, and so on.

3. Nested classes


class AbsListView.LayoutParams//AbsListView implementation LayoutParams Provides space for loading view types. 
interface AbsListView.MutiChoiceModeListener// MutiChoiceModeListener Response for multiple choice mode listener 1 a CHOICE_MODE_MULTIPLE_MODAL( Since the API Level 11).
interface AbaListView.OnScrollListener//  provides 1 A callback function that is triggered when the view is scrolled. 
interface AbsListView.RecyclerListener//  Used to receive View A listener for messages sent when they are placed in the area of the heap to be reclaimed. 

4. XML properties

1. XML attribute of AbsListView


android:cacheColorHint//  Indicates that the background of this list is always single 1.  Fixed color drawing, can optimize the drawing process.  
android:choiceMode// Specifies the selected behavior for the view. Optional types are: none , singleChoice , multipleChoice , multipleChoiceModal .  
android:drawSelectorOnTop//  If set to true , the selector will draw above the selected item. The default is false .  
android:faseScrollEnabled//  Sets whether the use of the quick scroll slider is allowed.  
android:listSelector//  Sets the drawable object displayed by the selection, which can be an image or a color property.  
android:scrollingCache//  Sets whether the draw cache is used while scrolling. If set to true , will make scrolling faster but take up more memory. The default is true .  
android:smoothScrollbar//  If true, the list USES a more precise calculation based on the height of the visible pixels of the entry on the screen. This property is true by default and should be set to false if your adapter needs to draw entries with variable heights. When this property is true, the handle of the scroll bar will change size as you scroll while the adapter displays a higher entry. When set to false, the list USES only the number of items in the adapter and the visible items on the screen to determine the properties of the scroll bar.  
android:stackFromBottom//  Set up the GridView and ListView Whether to display the content from the bottom.  
android:textFilterEnabled//  When set to true, the list filters the results to the user type. That's the premise of this list Adapter Must support Filterable Interface.  
android:transcriptMode// Set list transcriptMode. The following options are available:  
//(1)disabled      disable TranscriptMode Is also the default value ; 
//(2)normal        When a new entry is added to the list and is ready to be displayed, the list automatically slides to the bottom to show the latest entry ; 
//(3)alwaysScroll   The list slides to the bottom automatically, regardless of whether the new entry is ready to be displayed . 

2. XML attributes inherited from ViewGroup


android:addStatesFromChildren//  Set this ViewGroup the drawable Whether the state includes children View In the state. If set to true And when the View Such as EditText or Button Get the focus when the whole thing ViewGroup You get the focus. 
android:alwaysDrawnWithCache//  Set up the ViewGroup In drawing the son View whether 1 Use the drawing cache directly. The default is true . 
android:animationCache//  Sets whether the layout is its children when the animation effect is drawn View Create a drawing cache. If set to true , will consume more memory, require a longer duration of initialization, but perform better. The default is true . 
android:clipChildren//  Set up the child View Is limited to drawing within its own boundaries. If set to false, when View If the space occupied is larger than the boundary, it can be drawn outside the boundary. The default is true . 
android:clipToPadding// Defines whether there is spacing between layouts. The default is true . 
android:descendantFocusability//  Definition When looking for 1 A focus View The time, ViewGroup And his son View The relationship between. Options are: 
//(1)beforeDescendants    ViewGroup Than his son View Get the focus first ;
//(2)afterDescendants     Only when there are no children View When I want to get the focus, ViewGroup To get the focus ;
//(3)blockDescendants     ViewGroup Will stop the child View Get focus  
android:layoutAnimation// Is defined as ViewGroup The first 1 The animation effect when the secondary is expanded can also be artificially in the control 1 Call after expansion. 
android:persistentDrawingCache//  Defines the persistence of the drawing cache. The following options are available: 
//(1)none           Do not retain the drawing cache when used 
//(2)animation   in layout animation Then keep the drawing cache 
//(3)scrolling   in Scroll Preserve the drawing cache after operation 
//(4)all   always Retained drawing cache 

I hope this article has been helpful in Android programming.


Related articles: