@@ -0,0 +1,2327 @@
+package com.handmark.pulltorefresh.configuration;%0A%0Aimport android.content.Context;%0Aimport android.content.res.TypedArray;%0A%0Apublic class PullToRefreshAttributes %7B%0A%0A%09private Object mMode;%0A%0A%09public PullToRefreshAttributes(Context context, TypedArray a) %7B%0A%09%09if (a.hasValue(R.styleable.PullToRefresh_ptrMode)) %7B%0A%09%09%09mMode = Mode.mapIntToValue(a.getInteger(R.styleable.PullToRefresh_ptrMode, 0));%0A%09%09%7D%0A%0A%09%09if (a.hasValue(R.styleable.PullToRefresh_ptrAnimationStyle)) %7B%0A%09%09%09int loadingLayoutCode = a.getInteger(R.styleable.PullToRefresh_ptrAnimationStyle, 0);%0A%09%09%09PullToRefreshConfiguration configuration = PullToRefreshConfigurationFactory.createConfiguration(context);%0A%09%09%09mLoadingLayoutClazz = configuration.getLoadingLayout(loadingLayoutCode);%0A%09%09%09%0A%09%09%7D%0A%0A%09%09// Refreshable View%0A%09%09// By passing the attrs, we can add ListView/GridView params via XML%0A%09%09mRefreshableView = createRefreshableView(context, attrs);%0A%09%09addRefreshableView(context, mRefreshableView);%0A%0A%09%09// We need to create now layouts now%0A%09%09mHeaderLayout = createLoadingLayout(context, Mode.PULL_FROM_START, a);%0A%09%09mFooterLayout = createLoadingLayout(context, Mode.PULL_FROM_END, a);%0A%0A%09%09/**%0A%09%09 * Styleables from XML%0A%09%09 */%0A%09%09if (a.hasValue(R.styleable.PullToRefresh_ptrRefreshableViewBackground)) %7B%0A%09%09%09Drawable background = a.getDrawable(R.styleable.PullToRefresh_ptrRefreshableViewBackground);%0A%09%09%09if (null != background) %7B%0A%09%09%09%09mRefreshableView.setBackgroundDrawable(background);%0A%09%09%09%7D%0A%09%09%7D else if (a.hasValue(R.styleable.PullToRefresh_ptrAdapterViewBackground)) %7B%0A%09%09%09Utils.warnDeprecation(%22ptrAdapterViewBackground%22, %22ptrRefreshableViewBackground%22);%0A%09%09%09Drawable background = a.getDrawable(R.styleable.PullToRefresh_ptrAdapterViewBackground);%0A%09%09%09if (null != background) %7B%0A%09%09%09%09mRefreshableView.setBackgroundDrawable(background);%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09if (a.hasValue(R.styleable.PullToRefresh_ptrOverScroll)) %7B%0A%09%09%09mOverScrollEnabled = a.getBoolean(R.styleable.PullToRefresh_ptrOverScroll, true);%0A%09%09%7D%0A%0A%09%09if (a.hasValue(R.styleable.PullToRefresh_ptrScrollingWhileRefreshingEnabled)) %7B%0A%09%09%09mScrollingWhileRefreshingEnabled = a.getBoolean(%0A%09%09%09%09%09R.styleable.PullToRefresh_ptrScrollingWhileRefreshingEnabled, false);%0A%09%09%7D%0A%0A%09%09// Set Show Indicator to the XML value, or default value%0A%09%09mShowIndicator = a.getBoolean(R.styleable.PullToRefresh_ptrShowIndicator, !isPullToRefreshOverScrollEnabled());%09%09%0A%09%7D%0A%7D%0A

Create PullToRefreshAttributes for independently managing attributes of PullToRefreshBase