本文整理汇总了Java中in.srain.cube.views.ptr.util.PtrLocalDisplay类的典型用法代码示例。如果您正苦于以下问题:Java PtrLocalDisplay类的具体用法?Java PtrLocalDisplay怎么用?Java PtrLocalDisplay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PtrLocalDisplay类属于in.srain.cube.views.ptr.util包,在下文中一共展示了PtrLocalDisplay类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initiateDimens
import in.srain.cube.views.ptr.util.PtrLocalDisplay; //导入依赖的package包/类
private void initiateDimens() {
PtrLocalDisplay.init(mContext);
mTotalDragDistance = PtrLocalDisplay.dp2px(120);
mScreenWidth = getContext().getResources().getDisplayMetrics().widthPixels;
mSkyHeight = (int) (SKY_RATIO * mScreenWidth);
mSkyTopOffset = -(mSkyHeight * 0.28f);
mSkyMoveOffset = PtrLocalDisplay.designedDP2px(15);
mTownHeight = (int) (TOWN_RATIO * mScreenWidth);
mTownInitialTopOffset = (mTotalDragDistance - mTownHeight * TOWN_INITIAL_SCALE) + mTotalDragDistance * .42f;
mTownFinalTopOffset = (mTotalDragDistance - mTownHeight * TOWN_FINAL_SCALE) + mTotalDragDistance * .42f;
mTownMoveOffset = PtrLocalDisplay.designedDP2px(10);
mSunLeftOffset = 0.3f * (float) mScreenWidth;
mSunTopOffset = (mTotalDragDistance * 0.5f);
mTop = 0;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:RentalsSunDrawable.java
示例2: initWithPointList
import in.srain.cube.views.ptr.util.PtrLocalDisplay; //导入依赖的package包/类
public void initWithPointList(ArrayList<float[]> pointList) {
float drawWidth = 0;
float drawHeight = 0;
boolean shouldLayout = mItemList.size() > 0;
mItemList.clear();
for (int i = 0; i < pointList.size(); i++) {
float[] line = pointList.get(i);
PointF startPoint = new PointF(PtrLocalDisplay.dp2px(line[0]) * mScale, PtrLocalDisplay.dp2px(line[1]) * mScale);
PointF endPoint = new PointF(PtrLocalDisplay.dp2px(line[2]) * mScale, PtrLocalDisplay.dp2px(line[3]) * mScale);
drawWidth = Math.max(drawWidth, startPoint.x);
drawWidth = Math.max(drawWidth, endPoint.x);
drawHeight = Math.max(drawHeight, startPoint.y);
drawHeight = Math.max(drawHeight, endPoint.y);
StoreHouseBarItem item = new StoreHouseBarItem(i, startPoint, endPoint, mTextColor, mLineWidth);
item.resetPosition(mHorizontalRandomness);
mItemList.add(item);
}
mDrawZoneWidth = (int) Math.ceil(drawWidth);
mDrawZoneHeight = (int) Math.ceil(drawHeight);
if (shouldLayout) {
requestLayout();
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:StoreHouseHeader.java
示例3: setUp
import in.srain.cube.views.ptr.util.PtrLocalDisplay; //导入依赖的package包/类
private void setUp(final double diameter) {
PtrLocalDisplay.init(mParent.getContext());
final int shadowYOffset = PtrLocalDisplay.dp2px(Y_OFFSET);
final int shadowXOffset = PtrLocalDisplay.dp2px(X_OFFSET);
int mShadowRadius = PtrLocalDisplay.dp2px(SHADOW_RADIUS);
OvalShape oval = new OvalShadow(mShadowRadius, (int) diameter);
mShadow = new ShapeDrawable(oval);
if (Build.VERSION.SDK_INT >= 11) {
mParent.setLayerType(View.LAYER_TYPE_SOFTWARE, mShadow.getPaint());
}
mShadow.getPaint().setShadowLayer(mShadowRadius, shadowXOffset, shadowYOffset, KEY_SHADOW_COLOR);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:MaterialProgressDrawable.java
示例4: initView
import in.srain.cube.views.ptr.util.PtrLocalDisplay; //导入依赖的package包/类
private void initView() {
PtrLocalDisplay.init(getContext());
mLineWidth = PtrLocalDisplay.dp2px(1);
mDropHeight = PtrLocalDisplay.dp2px(40);
mHorizontalRandomness = PtrLocalDisplay.SCREEN_WIDTH_PIXELS / 2;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:StoreHouseHeader.java
示例5: getTopOffset
import in.srain.cube.views.ptr.util.PtrLocalDisplay; //导入依赖的package包/类
private int getTopOffset() {
return getPaddingTop() + PtrLocalDisplay.dp2px(10);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:StoreHouseHeader.java
示例6: getBottomOffset
import in.srain.cube.views.ptr.util.PtrLocalDisplay; //导入依赖的package包/类
private int getBottomOffset() {
return getPaddingBottom() + PtrLocalDisplay.dp2px(10);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:StoreHouseHeader.java
注:本文中的in.srain.cube.views.ptr.util.PtrLocalDisplay类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论