public class

VerticalPullToRefreshLayout

extends LinearLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.LinearLayout
         ↳ com.droidux.pack.list.widget.pull2refresh.VerticalPullToRefreshLayout

Class Overview

A custom layout to add the "Pull-to-refresh" feature (similar to the one implemented in the official Twitter app). Note: This layout has special behaviour when the child is a ListView. When the child is a ListView it will add the PullToRefreshInterfaces.Views.LoadingView as a header/footer of the ListView.

Summary

[Expand]
Inherited Constants
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
VerticalPullToRefreshLayout(Context context)
VerticalPullToRefreshLayout(Context context, AttributeSet attrs)
Public Methods
boolean isDisableScrollingWhileRefreshing()
Gets whether the view scrolling is disabled while the view is refreshing its data.
boolean isPullToRefreshEnabled()
Gets whether the "pull-to-refresh" feature is enabled.
boolean isRefreshing()
Gets whether the view is currently refreshing its data.
void setDisableScrollingWhileRefreshing(boolean disable)
Sets whether to disable scrolling while the view is refreshing its data.
void setEdgeDetector(VerticalEdgeDetector detector)
Sets a custom edge detector.
void setLoadingViewFactory(PullToRefreshInterfaces.Factories.LoadingViewFactory factory)
void setOnPullDownRefreshListener(OnRefreshListener listener)
Sets the listener to be invoked when the view is refreshed by pulling down.
void setOnPullUpRefreshListener(OnRefreshListener listener)
Sets the listener to be invoked when the view is refreshed by pulling up.
void setPullToRefreshEnabled(boolean enable)
Sets whether the "pull-to-refresh" is enabled.
Protected Methods
abstract void attachLoadingViews()
abstract void doInternalRefresh()
LinearLayout.LayoutParams getContainerLayoutParams()
{hide}
abstract boolean handlePull(float dp)
void init(Context context, AttributeSet attrs)
abstract boolean interceptTouchForPull(float xDiff, float yDiff)
abstract boolean isReadyForPull()
abstract void onRefreshableViewAdded()
abstract void onStateChanged(PullToRefreshInterfaces.States newState)
void resetHeader()
abstract OnRefreshListener runBackgroundRefreshTask()
[Expand]
Inherited Methods
From class android.widget.LinearLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public VerticalPullToRefreshLayout (Context context)

Since: API Level 2.5

public VerticalPullToRefreshLayout (Context context, AttributeSet attrs)

Since: API Level 2.5

Public Methods

public boolean isDisableScrollingWhileRefreshing ()

Since: API Level

Gets whether the view scrolling is disabled while the view is refreshing its data.

Returns
  • If true, the scrolling is disabled. Default is false.

public boolean isPullToRefreshEnabled ()

Since: API Level

Gets whether the "pull-to-refresh" feature is enabled.

Returns
  • If true, the feature is enabled.

public boolean isRefreshing ()

Since: API Level

Gets whether the view is currently refreshing its data.

Returns
  • If true, the view is currently refreshing its data.

public void setDisableScrollingWhileRefreshing (boolean disable)

Since: API Level

Sets whether to disable scrolling while the view is refreshing its data.

Parameters
disable If true, the scrolling will be disabled. Default is false.

public void setEdgeDetector (VerticalEdgeDetector detector)

Since: API Level 2.5

Sets a custom edge detector. This is useful when the view hosted in this layout is complex or unusual.

Parameters
detector The custom edge detector.

public void setLoadingViewFactory (PullToRefreshInterfaces.Factories.LoadingViewFactory factory)

Since: API Level

public void setOnPullDownRefreshListener (OnRefreshListener listener)

Since: API Level 2.5

Sets the listener to be invoked when the view is refreshed by pulling down.

Parameters
listener The listener to be invoked.

public void setOnPullUpRefreshListener (OnRefreshListener listener)

Since: API Level 2.5

Sets the listener to be invoked when the view is refreshed by pulling up.

Parameters
listener The listener to be invoked.

public void setPullToRefreshEnabled (boolean enable)

Since: API Level

Sets whether the "pull-to-refresh" is enabled.

Parameters
enable If true, the "pull-to-refresh" feature is enabled. Default is true.

Protected Methods

protected abstract void attachLoadingViews ()

Since: API Level

protected abstract void doInternalRefresh ()

Since: API Level

protected LinearLayout.LayoutParams getContainerLayoutParams ()

Since: API Level 2.6

{hide}

protected abstract boolean handlePull (float dp)

Since: API Level

protected void init (Context context, AttributeSet attrs)

Since: API Level

protected abstract boolean interceptTouchForPull (float xDiff, float yDiff)

Since: API Level

protected abstract boolean isReadyForPull ()

Since: API Level

protected abstract void onRefreshableViewAdded ()

Since: API Level

protected abstract void onStateChanged (PullToRefreshInterfaces.States newState)

Since: API Level

protected void resetHeader ()

Since: API Level

protected abstract OnRefreshListener runBackgroundRefreshTask ()

Since: API Level