本文整理汇总了Java中com.handmark.pulltorefresh.library.internal.Utils类的典型用法代码示例。如果您正苦于以下问题:Java Utils类的具体用法?Java Utils怎么用?Java Utils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Utils类属于com.handmark.pulltorefresh.library.internal包,在下文中一共展示了Utils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.handmark.pulltorefresh.library.internal.Utils; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs) {
switch (getPullToRefreshScrollDirection()) {
case HORIZONTAL:
setOrientation(0);
break;
default:
setOrientation(1);
break;
}
setGravity(17);
this.mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PullToRefresh);
if (a.hasValue(R.styleable.PullToRefresh_ptrMode)) {
this.mMode = Mode.mapIntToValue(a.getInteger(R.styleable.PullToRefresh_ptrMode, 0));
}
if (a.hasValue(R.styleable.PullToRefresh_ptrAnimationStyle)) {
this.mLoadingAnimationStyle = AnimationStyle.mapIntToValue(a.getInteger(R.styleable
.PullToRefresh_ptrAnimationStyle, 0));
}
this.mRefreshableView = createRefreshableView(context, attrs);
addRefreshableView(context, this.mRefreshableView);
this.mHeaderLayout = createLoadingLayout(context, Mode.PULL_FROM_START, a);
this.mFooterLayout = createLoadingLayout(context, Mode.PULL_FROM_END, a);
Drawable background;
if (a.hasValue(R.styleable.PullToRefresh_ptrRefreshableViewBackground)) {
background = a.getDrawable(R.styleable.PullToRefresh_ptrRefreshableViewBackground);
if (background != null) {
this.mRefreshableView.setBackgroundDrawable(background);
}
} else if (a.hasValue(R.styleable.PullToRefresh_ptrAdapterViewBackground)) {
Utils.warnDeprecation("ptrAdapterViewBackground", "ptrRefreshableViewBackground");
background = a.getDrawable(R.styleable.PullToRefresh_ptrAdapterViewBackground);
if (background != null) {
this.mRefreshableView.setBackgroundDrawable(background);
}
}
if (a.hasValue(R.styleable.PullToRefresh_ptrOverScroll)) {
this.mOverScrollEnabled = a.getBoolean(R.styleable.PullToRefresh_ptrOverScroll, true);
}
if (a.hasValue(R.styleable.PullToRefresh_ptrScrollingWhileRefreshingEnabled)) {
this.mScrollingWhileRefreshingEnabled = a.getBoolean(R.styleable
.PullToRefresh_ptrScrollingWhileRefreshingEnabled, false);
}
handleStyledAttributes(a);
a.recycle();
updateUIForMode();
}
示例2: initActionBarSize
import com.handmark.pulltorefresh.library.internal.Utils; //导入依赖的package包/类
/**
* Get an actionBar's size and save into a field
* @param context
*/
private void initActionBarSize(Context context) {
mActionBarHeight = Utils.getActionBarSize(context);
}
示例3: initStatusBarSize
import com.handmark.pulltorefresh.library.internal.Utils; //导入依赖的package包/类
/**
* Get an StatusBar's size and save into a field
* @param context
*/
private void initStatusBarSize(Context context) {
mStatusBarHeight = Utils.getStatusBarSize(context);
}