IT. Expert System.

Android Reference

PagerAdapter


android.support.v4.view

Class PagerAdapter

    • Constructor Detail

      • PagerAdapter

        public PagerAdapter()
    • Method Detail

      • getCount

        public abstract int getCount()
        Return the number of views available.
      • startUpdate

        public void startUpdate(ViewGroup container)
        Called when a change in the shown pages is going to start being made.
        Parameters:
        container - The containing View which is displaying this adapter's page views.
      • instantiateItem

        public Object instantiateItem(ViewGroup container,
                             int position)
        Create the page for the given position. The adapter is responsible for adding the view to the container given here, although it only must ensure this is done by the time it returns from finishUpdate(ViewGroup).
        Parameters:
        container - The containing View in which the page will be shown.
        position - The page position to be instantiated.
        Returns:
        Returns an Object representing the new page. This does not need to be a View, but can be some other container of the page.
      • destroyItem

        public void destroyItem(ViewGroup container,
                       int position,
                       Object object)
        Remove a page for the given position. The adapter is responsible for removing the view from its container, although it only must ensure this is done by the time it returns from finishUpdate(ViewGroup).
        Parameters:
        container - The containing View from which the page will be removed.
        position - The page position to be removed.
        object - The same object that was returned by instantiateItem(View, int).
      • setPrimaryItem

        public void setPrimaryItem(ViewGroup container,
                          int position,
                          Object object)
        Called to inform the adapter of which item is currently considered to be the "primary", that is the one show to the user as the current page.
        Parameters:
        container - The containing View from which the page will be removed.
        position - The page position that is now the primary.
        object - The same object that was returned by instantiateItem(View, int).
      • finishUpdate

        public void finishUpdate(ViewGroup container)
        Called when the a change in the shown pages has been completed. At this point you must ensure that all of the pages have actually been added or removed from the container as appropriate.
        Parameters:
        container - The containing View which is displaying this adapter's page views.
      • startUpdate

        public void startUpdate(View container)
        Deprecated. Use startUpdate(ViewGroup)
        Called when a change in the shown pages is going to start being made.
        Parameters:
        container - The containing View which is displaying this adapter's page views.
      • instantiateItem

        public Object instantiateItem(View container,
                             int position)
        Create the page for the given position. The adapter is responsible for adding the view to the container given here, although it only must ensure this is done by the time it returns from finishUpdate(ViewGroup).
        Parameters:
        container - The containing View in which the page will be shown.
        position - The page position to be instantiated.
        Returns:
        Returns an Object representing the new page. This does not need to be a View, but can be some other container of the page.
      • destroyItem

        public void destroyItem(View container,
                       int position,
                       Object object)
        Remove a page for the given position. The adapter is responsible for removing the view from its container, although it only must ensure this is done by the time it returns from finishUpdate(View).
        Parameters:
        container - The containing View from which the page will be removed.
        position - The page position to be removed.
        object - The same object that was returned by instantiateItem(View, int).
      • setPrimaryItem

        public void setPrimaryItem(View container,
                          int position,
                          Object object)
        Called to inform the adapter of which item is currently considered to be the "primary", that is the one show to the user as the current page.
        Parameters:
        container - The containing View from which the page will be removed.
        position - The page position that is now the primary.
        object - The same object that was returned by instantiateItem(View, int).
      • finishUpdate

        public void finishUpdate(View container)
        Deprecated. Use finishUpdate(ViewGroup)
        Called when the a change in the shown pages has been completed. At this point you must ensure that all of the pages have actually been added or removed from the container as appropriate.
        Parameters:
        container - The containing View which is displaying this adapter's page views.
      • isViewFromObject

        public abstract boolean isViewFromObject(View view,
                               Object object)
        Determines whether a page View is associated with a specific key object as returned by instantiateItem(ViewGroup, int). This method is required for a PagerAdapter to function properly.
        Parameters:
        view - Page View to check for association with object
        object - Object to check for association with view
        Returns:
        true if view is associated with the key object object
      • saveState

        public Parcelable saveState()
        Save any instance state associated with this adapter and its pages that should be restored if the current UI state needs to be reconstructed.
        Returns:
        Saved state for this adapter
      • restoreState

        public void restoreState(Parcelable state,
                        ClassLoader loader)
        Restore any instance state associated with this adapter and its pages that was previously saved by saveState().
        Parameters:
        state - State previously saved by a call to saveState()
        loader - A ClassLoader that should be used to instantiate any restored objects
      • getItemPosition

        public int getItemPosition(Object object)
        Called when the host view is attempting to determine if an item's position has changed. Returns POSITION_UNCHANGED if the position of the given item has not changed or POSITION_NONE if the item is no longer present in the adapter.

        The default implementation assumes that items will never change position and always returns POSITION_UNCHANGED.

        Parameters:
        object - Object representing an item, previously returned by a call to instantiateItem(View, int).
        Returns:
        object's new position index from [0, getCount()), POSITION_UNCHANGED if the object's position has not changed, or POSITION_NONE if the item is no longer present.
      • notifyDataSetChanged

        public void notifyDataSetChanged()
        This method should be called by the application if the data backing this adapter has changed and associated views should update.
      • getPageTitle

        public CharSequence getPageTitle(int position)
        This method may be called by the ViewPager to obtain a title string to describe the specified page. This method may return null indicating no title for this page. The default implementation returns null.
        Parameters:
        position - The position of the title requested
        Returns:
        A title for the requested page
      • getPageWidth

        public float getPageWidth(int position)
        Returns the proportional width of a given page as a percentage of the ViewPager's measured width from (0.f-1.f]
        Parameters:
        position - The position of the page requested
        Returns:
        Proportional width for the given page position


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 296 / 158870688. Delta: 0.03973 с