Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2011, 2012 Chris Banes. Copyright 2013 Naver Business Platform Corp. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
  
  package com.handmark.pulltorefresh.library;
  
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  
  
  public abstract class PullToRefreshBase<T extends Viewextends LinearLayout implements IPullToRefresh<T> {
  
  	// ===========================================================
  	// Constants
  	// ===========================================================
  
  	static final boolean DEBUG = false;
  
  	static final boolean USE_HW_LAYERS = false;
  
  	static final String LOG_TAG = "PullToRefresh";
  
  	public static final float DEFAULT_FRICTION = 2.0f;
  	public static final int DEFAULT_SMOOTH_SCROLL_DURATION_MS = 200;
  	public static final int DEFAULT_SMOOTH_SCROLL_LONG_DURATION_MS = 325;
  
  	static final int DEMO_SCROLL_INTERVAL = 225;
  
  	static final String STATE_STATE = "ptr_state";
  	static final String STATE_MODE = "ptr_mode";
  	static final String STATE_CURRENT_MODE = "ptr_current_mode";
  	static final String STATE_SCROLLING_REFRESHING_ENABLED = "ptr_disable_scrolling";
  	static final String STATE_SHOW_REFRESHING_VIEW = "ptr_show_refreshing_view";
  	static final String STATE_SUPER = "ptr_super";
  
  	static final int REFRESHABLE_VIEW_HIDE_WHILE_REFRESHING_DURATION = 500;
  	static final int GOOGLE_STYLE_VIEW_APPEAREANCE_DURATION = 200;
  
  	static final int LAYER_TYPE_HARDWARE = 2;
  	static final int LAYER_TYPE_NONE = 0;
  	// ===========================================================
  	// Fields
  	// ===========================================================
  	
  	private int mTouchSlop;
  	private float mLastMotionXmLastMotionY;
  	private float mInitialMotionXmInitialMotionY;
  	
  	// needed properties while scrolling
  	private float mFriction;
  	private int mSmoothScrollDurationMs = 200;
  	private int mSmoothScrollLongDurationMs = 325;
  	
  	private boolean mIsBeingDragged = false;
  	private State mState = .;
  	private Mode mMode = Mode.getDefault();
  
  	private Mode mCurrentMode;
 
 	private boolean mShowViewWhileRefreshing = true;
 	private boolean mScrollingWhileRefreshingEnabled = false;
 	private boolean mFilterTouchEvents = true;
 	private boolean mOverScrollEnabled = true;
 	private boolean mLayoutVisibilityChangesEnabled = true;
 
 	private Class<? extends LoadingLayoutmLoadingLayoutClazz = null;
 	
Top DecorView for containing google style pull to refresh
 
Flag whether onAttachedToWindow() event has been called
 	
 	private boolean mWindowAttached = false;
View Layout being shown over ActionBar
 	
Progress Bar being shown over ActionBar
 
Progress bar ratating on center while Refreshing
 	
 
 
 
 	private int mStatusBarHeight;
Current actionbar size
 
 	private int mActionBarHeight;
Flag whether onRefreshing(boolean) has been called
 
 	private boolean mRefreshing;
Flag whether Google style view layout appearance animation will be shown
 
 	private boolean mShowGoogleStyleViewAnimationEnabled = true;
Duration of Google style view layout appearance animation
 
Flag whether mRefreshaleView will be hidden while refreshing
 
 	private boolean mRefeshableViewHideWhileRefreshingEnabled = true;
mRefreshableView's fade-out Duration
 
Flag whether some ProgressBar will be shown while refreshing
 
mRefreshableViewRefreshingBar's fade-in Duration
 
Width of mRefreshableViewRefreshingBar
 
Height of mRefreshableViewRefreshingBar
 
Flag whether Google style view layout's size is set to ActionBar's size (Don't set to false as possible, it's hard to control height if this flag is false)
 
 	private boolean mSetGoogleViewLayoutSizeToActionbarHeight = true;
 
 
 	// ===========================================================
 	// Constructors
 	// ===========================================================
 	public PullToRefreshBase(Context context) {
 		super(context);
 		init(contextnull);
 	}
 
 	public PullToRefreshBase(Context contextAttributeSet attrs) {
 		super(contextattrs);
 		init(contextattrs);
 	}
 
 	public PullToRefreshBase(Context contextMode mode) {
 		super(context);
 		 = mode;
 		init(contextnull);
 	}
 
 	public PullToRefreshBase(Context contextMode modeClass<? extends LoadingLayoutloadingLayoutClazz) {
 		super(context);
 		 = mode;
 		 = loadingLayoutClazz;
 		init(contextnull);
 	}
 	
 	public void addView(View childint indexViewGroup.LayoutParams params) {
 		if () {
 			Log.d("addView: " + child.getClass().getSimpleName());
 		}
 
 		final T refreshableView = getRefreshableView();
 
 		if (refreshableView instanceof ViewGroup) {
 			((ViewGrouprefreshableView).addView(childindexparams);
 		} else {
 			throw new UnsupportedOperationException("Refreshable View is not a ViewGroup so can't addView");
 		}
 	}
 	
 	public final boolean demo() {
 			return true;
 		} else if (.showFooterLoadingLayout() && isReadyForPullEnd()) {
 			return true;
 		}
 
 		return false;
 	}
 
 	public final Mode getCurrentMode() {
 		return ;
 	}
 
 	public final boolean getFilterTouchEvents() {
 	}
 
 		return getLoadingLayoutProxy(truetrue);
 	}
 
 	public final ILoadingLayout getLoadingLayoutProxy(boolean includeStartboolean includeEnd) {
 		return createLoadingLayoutProxy(includeStartincludeEnd);
 	}
 
 	public final Mode getMode() {
 		return ;
 	}
 
 	public final T getRefreshableView() {
 	}
 
 	public final boolean getShowViewWhileRefreshing() {
 	}
 
 	public final State getState() {
 		return ;
 	}

 
 	public final boolean isDisableScrollingWhileRefreshing() {
 	}
 
 	public final boolean isPullToRefreshEnabled() {
 	}
 
 	public final boolean isPullToRefreshOverScrollEnabled() {
 	}
 
 	public final boolean isRefreshing() {
 	}
 
 	public final boolean isScrollingWhileRefreshingEnabled() {
 	}
 	
 	public final boolean onInterceptTouchEvent(MotionEvent event) {
 
 			return false;
 		}
 
 		final int action = event.getAction();
 
 		if (action == . || action == .) {
 			 = false;
 			return false;
 		}
 
 		if (action != . && ) {
 			return true;
 		}
 
 		switch (action) {
 				// If we're refreshing, and the flag is set. Eat all MOVE events
 					return true;
 				}
 
 				if (isReadyForPull()) {
 					final float y = event.getY(), x = event.getX();
 					final float diffoppositeDiffabsDiff;
 
 					// We need to use the correct values, based on scroll
 					// direction
 						case :
 							diff = x - ;
 							oppositeDiff = y - ;
 							break;
 						case :
 						default:
 							diff = y - ;
 							oppositeDiff = x - ;
 							break;
 					}
 					absDiff = Math.abs(diff);
 
 					if (absDiff >  && (! || absDiff > Math.abs(oppositeDiff))) {
 						if ((.showHeaderLoadingLayout() || .showGoogleStyle()) && diff >= 1f && isReadyForPullStart()) {
 							 = y;
 							 = x;
 							 = true;
 							if ( == .) {
 							}
 						} else if (.showFooterLoadingLayout() && diff <= -1f && isReadyForPullEnd()) {
 							 = y;
 							 = x;
 							 = true;
 							if ( == .) {
 							}
 						}
 					}
 				}
 				break;
 			}
 				if (isReadyForPull()) {
 					 = false;
 				}
 				break;
 			}
 		}
 
 		return ;
 	}
 
 	public final void onRefreshComplete() {
 		if (isRefreshing()) {
 		}
 	}
 
 	public final boolean onTouchEvent(MotionEvent event) {
 
 			return false;
 		}
 
 		// If we're refreshing, and the flag is set. Eat the event
 			return true;
 		}
 
 		if (event.getAction() == . && event.getEdgeFlags() != 0) {
 			return false;
 		}
 
 		switch (event.getAction()) {
 				if () {
 					 = event.getY();
 					 = event.getX();
 					return true;
 				}
 				break;
 			}
 
 				if (isReadyForPull()) {
 					return true;
 				}
 				break;
 			}
 
 				if () {
 					 = false;
 
 							&& (null !=  || null != )) {
 						return true;
 					}
 
 					// If we're already refreshing, just scroll back to the top
 					if (isRefreshing()) {
 						return true;
 					}
 
 					// If we haven't returned by here, then we're not in a state
 					// to pull, so just reset
 
 					return true;
 				}
 				break;
 			}
 		}
 
 		return false;
 	}
Set new friction

Parameters:
friction New friction value. Must be float. The default value is DEFAULT_FRICTION.
 
 	public final void setFriction(float friction) {
 		this. = friction;
 	}
Set new smooth scroll duration

Parameters:
smoothScrollDurationMs Milliseconds. The default value is DEFAULT_SMOOTH_SCROLL_DURATION_MS.
 
 	public final void setSmoothScrollDuration(int smoothScrollDurationMs) {
 		this. = smoothScrollDurationMs;
 	} 
Set new smooth scroll longer duration.
This duration is only used by calling smoothScrollToLonger(int).

Parameters:
smoothScrollLongDurationMs Milliseconds. The default value is DEFAULT_SMOOTH_SCROLL_LONG_DURATION_MS.
 
 	public final void setSmoothScrollLongDuration(int smoothScrollLongDurationMs) {
 		this. = smoothScrollLongDurationMs;
 	} 
 
 	public final void setScrollingWhileRefreshingEnabled(boolean allowScrollingWhileRefreshing) {
 		 = allowScrollingWhileRefreshing;
 	}
 
 	public void setDisableScrollingWhileRefreshing(boolean disableScrollingWhileRefreshing) {
 		setScrollingWhileRefreshingEnabled(!disableScrollingWhileRefreshing);
 	}
 
 	public final void setFilterTouchEvents(boolean filterEvents) {
 		 = filterEvents;
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy().
 
 	public void setLastUpdatedLabel(CharSequence label) {
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy().
 
 	public void setLoadingDrawable(Drawable drawable) {
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy(boolean,boolean).
 
 	public void setLoadingDrawable(Drawable drawableMode mode) {
 				drawable);
 	}
 
 	public void setLongClickable(boolean longClickable) {
 	}
 
 	public final void setMode(Mode mode) {
 		if (mode != ) {
 			if () {
 				Log.d("Setting mode to: " + mode);
 			}
 			 = mode;
 		}
 	}
 
 	public void setOnPullEventListener(OnPullEventListener<T> listener) {
 		 = listener;
 	}
 
 	public final void setOnRefreshListener(OnRefreshListener<T> listener) {
 		 = listener;
 	}
 
 	public final void setOnRefreshListener(OnRefreshListener2<T> listener) {
 		 = listener;
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy().
 
 	public void setPullLabel(CharSequence pullLabel) {
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy(boolean,boolean).
 
 	public void setPullLabel(CharSequence pullLabelMode mode) {
 	}

Deprecated:
This simple calls setMode with an appropriate mode based on the passed value.
Parameters:
enable Whether Pull-To-Refresh should be used
 
 	public final void setPullToRefreshEnabled(boolean enable) {
 		setMode(enable ? Mode.getDefault() : .);
 	}
 
 	public final void setPullToRefreshOverScrollEnabled(boolean enabled) {
 		 = enabled;
 	}
 
 	public final void setRefreshing() {
 	}
 
 	public final void setRefreshing(boolean doScroll) {
 		if (!isRefreshing()) {
 		}
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy().
 
 	public void setRefreshingLabel(CharSequence refreshingLabel) {
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy(boolean,boolean).
 
 	public void setRefreshingLabel(CharSequence refreshingLabelMode mode) {
 				refreshingLabel);
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy().
 
 	public void setReleaseLabel(CharSequence releaseLabel) {
 		setReleaseLabel(releaseLabel.);
 	}

Deprecated:
You should now call this method on the result of getLoadingLayoutProxy(boolean,boolean).
 
 	public void setReleaseLabel(CharSequence releaseLabelMode mode) {
 				releaseLabel);
 	}
 
 	public void setScrollAnimationInterpolator(Interpolator interpolator) {
 		 = interpolator;
 	}
 
 	public final void setShowViewWhileRefreshing(boolean showView) {
 	}

Returns:
Either PullToRefreshBase.Orientation.VERTICAL or PullToRefreshBase.Orientation.HORIZONTAL depending on the scroll direction.
 

Wrap getPullToRefreshScrollDirection() method
Other methods Use this method instead of getPullToRefreshScrollDirection() method, because an orientation must be VERTICAL when mode is google style

Returns:
Oreintation.VERTICAL if mMode.showGoogleStyle() is true,
Return value of getPullToRefreshScrollDirection() method if else
 
 		if (.showGoogleStyle() ) {
 			orientation = .;
 		}
 		return orientation;
 	}
 
 	final void setState(State statefinal boolean... params) {
 		 = state;
 		if () {
 			Log.d("State: " + .name());
 		}
 
 		switch () {
 			case :
 				break;
 				break;
 				break;
 			case :
 				onRefreshing(params[0]);
 				break;
 				// NO-OP
 				break;
 		}
 
 		// Call OnPullEventListener
 		if (null != ) {
 		}
 	}

Used internally for adding view. Need because we override addView to pass-through to the Refreshable View
 
 	protected final void addViewInternal(View childint indexViewGroup.LayoutParams params) {
 		super.addView(childindexparams);
 	}

Used internally for adding view. Need because we override addView to pass-through to the Refreshable View
 
 	protected final void addViewInternal(View childViewGroup.LayoutParams params) {
 		super.addView(child, -1, params);
 	}

Create a new loading layout instance by using the class token mLoadingLayoutClazz

Parameters:
context
mode
attrs
Returns:
Loading layout instance which was created by using the class token mLoadingLayoutClazz
 
 	protected LoadingLayout createLoadingLayout(Context contextMode modeTypedArray attrs) {
 		return LoadingLayoutFactory.createLoadingLayout(contextmodegetFilteredPullToRefreshScrollDirection(), attrs);
 	}
Create a new google style view layout instance by using the class token

Parameters:
layoutCode Google style view layout code to be converted to some class token
context
mode
attrs
Returns:
Google style view layout instance which was created by using the class token
 
 			String layoutCodeContext contextTypedArray a) {
 		Class<? extends GoogleStyleViewLayoutclazz = GoogleStyleViewLayoutFactory.createGoogleStyleViewLayoutClazzByLayoutCode(layoutCode);
 		return GoogleStyleViewLayoutFactory.createGoogleStyleViewLayout(clazzcontexta);
 	}	
Create a new google style progress layout instance by using the class token

Parameters:
layoutCode google style progress layout code to be converted to some class token
context
mode
attrs
Returns:
Google style progress layout instance which was created by using the class token
 
 			String layoutCodeContext contextTypedArray a) {
 		Class<? extends GoogleStyleProgressLayoutclazz = GoogleStyleProgressLayoutFactory.createGoogleStyleProgressLayoutClazzByLayoutCode(layoutCode);
 		return GoogleStyleProgressLayoutFactory.createGoogleStyleProgressLayout(clazzcontexta);
 	}
Used internally for getLoadingLayoutProxy(boolean,boolean). Allows derivative classes to include any extra LoadingLayouts.
 
 	protected LoadingLayoutProxy createLoadingLayoutProxy(final boolean includeStartfinal boolean includeEnd) {
 
 		if (includeStart && .showHeaderLoadingLayout()) {
 		}
 		if (includeEnd && .showFooterLoadingLayout()) {
 		}
 
 		return proxy;
 	}

This is implemented by derived classes to return the created View. If you need to use a custom View (such as a custom ListView), override this method and return an instance of your custom class.

Be sure to set the ID of the view in this method, especially if you're using a ListActivity or ListFragment.

Parameters:
context Context to create view with
attrs AttributeSet from wrapped class. Means that anything you include in the XML layout declaration will be routed to the created View
Returns:
New instance of the Refreshable View
 
 	protected abstract T createRefreshableView(Context contextAttributeSet attrs);
 
 	protected final void disableLoadingLayoutVisibilityChanges() {
 	}
 
 	protected final LoadingLayout getFooterLayout() {
 		return ;
 	}
 
 	protected final int getFooterSize() {
 	}
 
 	protected final LoadingLayout getHeaderLayout() {
 		return ;
 	}
 
 	protected final int getHeaderSize() {
 	}
 
 	protected final int getGoogleStyleViewSize() {
 	}
 
 	protected int getPullToRefreshScrollDuration() {
 	}
 
 	}
 
 	}

Allows Derivative classes to handle the XML Attrs without creating a TypedArray themsevles

Parameters:
a - TypedArray of PullToRefresh Attributes
 
 	protected void handleStyledAttributes(TypedArray a) {
 	}

Implemented by derived class to return whether the View is in a state where the user can Pull to Refresh by scrolling from the end.

Returns:
true if the View is currently in the correct state (for example, bottom of a ListView)
 
 	protected abstract boolean isReadyForPullEnd();

Implemented by derived class to return whether the View is in a state where the user can Pull to Refresh by scrolling from the start.

Returns:
true if the View is currently the correct state (for example, top of a ListView)
 
 	protected abstract boolean isReadyForPullStart();

Called by onRestoreInstanceState(android.os.Parcelable) so that derivative classes can handle their saved instance state.

Parameters:
savedInstanceState - Bundle which contains saved instance state.
 
 	protected void onPtrRestoreInstanceState(Bundle savedInstanceState) {
 	}

Called by onSaveInstanceState() so that derivative classes can save their instance state.

Parameters:
saveState - Bundle to be updated with saved state.
 
 	protected void onPtrSaveInstanceState(Bundle saveState) {
 	}

Called when the UI has been to be updated to be in the PullToRefreshBase.State.PULL_TO_REFRESH state.
 
 	protected void onPullToRefresh() {
 		switch () {
 				break;
 			case :
 				break;
 				break;
 			default:
 				// NO-OP
 				break;
 		}
 	}

Called when the UI has been to be updated to be in the PullToRefreshBase.State.REFRESHING or PullToRefreshBase.State.MANUAL_REFRESHING state.

Parameters:
doScroll - Whether the UI should scroll for this event.
 
 	protected void onRefreshing(final boolean doScroll) {
 		// Set the flag as below for fade-in animation of mRefreshableView when releasing 
 		 = true;
 
 		}
 		}
 			// Fade-out mRefreshableView
 			}
 			// Fade-in refreshing bar on center
 			}
 
 		}
 
 		if (doScroll) {
 
 				// Call Refresh Listener when the Scroll has finished
 					public void onSmoothScrollFinished() {
 					}
 				};
 
 				switch () {
 						break;
 					default:
 						smoothScrollTo(-getHeaderSize(), listener);
 						break;
 				}
 			} else {
 			}
 		} else {
 			// We're not scrolling, so just call Refresh Listener now
 		}
 	}

Called when the UI has been to be updated to be in the PullToRefreshBase.State.RELEASE_TO_REFRESH state.
 
 	protected void onReleaseToRefresh() {
 		switch () {
 				break;
 			case :
 				break;
 				break;
 			default:
 				// NO-OP
 				break;
 		}
 	}

Called when the UI has been to be updated to be in the PullToRefreshBase.State.RESET state.
 
 	protected void onReset() {
 		 = false;
 
 		// Always reset both layouts, just in case...
 
 			// Fade-in mRefreshableView
 			if (  == true &&  == true ) {
 			}
 			// Fade-out refreshing bar on center
 					public void onAnimationEnd(Animation animation) {
 					}
 
 					public void onAnimationRepeat(Animation animation) {
 						// do nothing
					public void onAnimationStart(Animation animation) {
						// do nothing
					}});	
		 = false;
	protected final void onRestoreInstanceState(Parcelable state) {
		if (state instanceof Bundle) {
			Bundle bundle = (Bundlestate;
			// Let super Restore Itself
			State viewState = State.mapIntToValue(bundle.getInt(, 0));
			if (viewState == . || viewState == .) {
				setState(viewStatetrue);
			// Now let derivative classes restore their state
			return;
	protected final Parcelable onSaveInstanceState() {
		Bundle bundle = new Bundle();
		// Let derivative classes get a chance to save state first, that way we
		// can make sure they don't overrite any of our values
		return bundle;
	protected final void onSizeChanged(int wint hint oldwint oldh) {
		if () {
			Log.d(, String.format("onSizeChanged. W: %d, H: %d"wh));
		super.onSizeChanged(wholdwoldh);
		// We need to update the header/footer when our size changes
		// Update the Refreshable View layout
As we're currently in a Layout Pass, we need to schedule another one to layout any changes we've made here
		post(new Runnable() {
			public void run() {
		});
	}

Re-measure the Loading Views height, and adjust internal padding as necessary
	protected final void refreshLoadingViewsSize() {
		final int maximumPullScroll = (int) (getMaximumPullScroll() * 1.2f);
		int pLeft = getPaddingLeft();
		int pTop = getPaddingTop();
		int pRight = getPaddingRight();
		int pBottom = getPaddingBottom();
					.setWidth(maximumPullScroll);
					pLeft = -maximumPullScroll;
else {
					pLeft = 0;
					.setWidth(maximumPullScroll);
					pRight = -maximumPullScroll;
else {
					pRight = 0;
				break;
			case :
					.setHeight(maximumPullScroll);
					pTop = -maximumPullScroll;
else if (.showGoogleStyle() &&  == true ) {
Set size of GoogleStyleViewLayout to ActionBar's size if mSetGoogleViewLayoutSizeToActionbarHeight is true This code is a default action, but if you want to use custom size of GoogleStyleViewLayout, set ptrSetGoogleViewLayoutSizeToActionbarHeight to false in layout xml (but not recommended).
					pTop = 0;
else {
					pTop = 0;
					.setHeight(maximumPullScroll);
					pBottom = -maximumPullScroll;
else {
					pBottom = 0;
				break;
		if () {
			Log.d(, String.format("Setting Padding. L: %d, T: %d, R: %d, B: %d"pLeftpToppRightpBottom));
		setPadding(pLeftpToppRightpBottom);
	protected final void refreshRefreshableViewSize(int widthint height) {
		// We need to set the Height of the Refreshable View to the same as
		// this layout
				if (lp.width != width) {
					lp.width = width;
				break;
			case :
				if (lp.height != height) {
					lp.height = height;
				break;
	}

Helper method which just calls scrollTo() in the correct scrolling direction.

Parameters:
value - New Scroll value
	protected final void setHeaderScroll(int value) {
		if () {
			Log.d("setHeaderScroll: " + value);
		// Clamp value to with pull scroll range
		final int maximumPullScroll = getMaximumPullScroll();
		value = Math.min(maximumPullScroll, Math.max(-maximumPullScrollvalue));
			if (value < 0) {
				switch () {
						break;
					default:	
						break;
else if (value > 0) {
else {
Use a Hardware Layer on the Refreshable View if we've scrolled at all. We don't use them on the Header/Footer Views as they change often, which would negate any HW layer performance boost.
 /* View.LAYER_TYPE_NONE */);
		// skip ScrollTo(...) 
			return;
			case :
				scrollTo(0, value);
				break;
				scrollTo(value, 0);
				break;
	}

Smooth Scroll to position using the duration of mSmoothScrollDurationMs ms.

Parameters:
scrollValue - Position to scroll to
	protected final void smoothScrollTo(int scrollValue) {
	}

Smooth Scroll to position using the the duration of mSmoothScrollDurationMs ms.

Parameters:
scrollValue - Position to scroll to
listener - Listener for scroll
	protected final void smoothScrollTo(int scrollValueOnSmoothScrollFinishedListener listener) {
		smoothScrollTo(scrollValuegetPullToRefreshScrollDuration(), 0, listener);
	}

Smooth Scroll to position using the longer the duration of mSmoothScrollLongDurationMs ms.

Parameters:
scrollValue - Position to scroll to
	protected final void smoothScrollToLonger(int scrollValue) {
	}

Updates the View State when the mode has been set. This does not do any checking that the mode is different to current state so always updates.
	protected void updateUIForMode() {
		// We need to use the correct LayoutParam values, based on scroll
		// direction
		// Remove Header, and then add Header Loading View again if needed
		if (this == .getParent()) {
		// Remove Footer, and then add Footer Loading View again if needed
		if (this == .getParent()) {
		// Hide Loading Views
		// If we're not using Mode.BOTH, set mCurrentMode to mMode, otherwise
		// set it to pull down
	}
Be called separately for google style mode when updating ui
	protected void updateUIForGoogleStyleMode() {
		if (  == false ) {
			return;
		if ( .showGoogleStyle() == false ) {
            return;