本文整理汇总了Java中android.view.View.getPaddingBottom方法的典型用法代码示例。如果您正苦于以下问题:Java View.getPaddingBottom方法的具体用法?Java View.getPaddingBottom怎么用?Java View.getPaddingBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.getPaddingBottom方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawHorizontal
import android.view.View; //导入方法依赖的package包/类
public void drawHorizontal(Canvas c, RecyclerView parent) {
final int childCount = parent.getChildCount();
// 在每一个子控件的底部画线
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final int left = child.getLeft() + child.getPaddingLeft();
final int right = child.getWidth() + child.getLeft() - child.getPaddingRight();
final int top = child.getBottom() - mDivider.getIntrinsicHeight() - child.getPaddingBottom();
final int bottom = top + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
示例2: SmartViewHolder
import android.view.View; //导入方法依赖的package包/类
public SmartViewHolder(View itemView, AdapterView.OnItemClickListener mListener) {
super(itemView);
this.mListener = mListener;
itemView.setOnClickListener(this);
/**
* 设置水波纹背景
*/
if (itemView.getBackground() == null) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = itemView.getContext().getTheme();
int top = itemView.getPaddingTop();
int bottom = itemView.getPaddingBottom();
int left = itemView.getPaddingLeft();
int right = itemView.getPaddingRight();
if (theme.resolveAttribute(android.R.attr.selectableItemBackground, typedValue, true)) {
itemView.setBackgroundResource(typedValue.resourceId);
}
itemView.setPadding(left, top, right, bottom);
}
}
示例3: applyPadding
import android.view.View; //导入方法依赖的package包/类
/**
* apply padding in view
*/
public static void applyPadding(View view, DynamicProperty property, int position) {
if (view != null) {
switch (property.type) {
case DIMEN: {
int[] padding = new int[] {
view.getPaddingLeft(),
view.getPaddingTop(),
view.getPaddingRight(),
view.getPaddingBottom()
};
padding[position] = property.getValueInt();
view.setPadding(padding[0], padding[1], padding[2], padding[3]);
}
break;
}
}
}
示例4: SmartViewHolder
import android.view.View; //导入方法依赖的package包/类
public SmartViewHolder(View itemView, AdapterView.OnItemClickListener mListener) {
super(itemView);
/**
* 设置水波纹背景
*/
if (itemView.getBackground() == null) {
TypedValue typedValue = new TypedValue();
Resources.Theme theme = itemView.getContext().getTheme();
int top = itemView.getPaddingTop();
int bottom = itemView.getPaddingBottom();
int left = itemView.getPaddingLeft();
int right = itemView.getPaddingRight();
if (theme.resolveAttribute(android.R.attr.selectableItemBackground, typedValue, true)) {
itemView.setBackgroundResource(typedValue.resourceId);
}
itemView.setPadding(left, top, right, bottom);
}
}
示例5: getAllChildrenHeightSum
import android.view.View; //导入方法依赖的package包/类
private int getAllChildrenHeightSum(boolean withPadding, boolean withMargin) {
final int childCount = getChildCount();
int height = 0;
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (child.getVisibility() == GONE)
continue;
int margin = ((MarginLayoutParams) child.getLayoutParams()).topMargin +
((MarginLayoutParams) child.getLayoutParams()).bottomMargin;
height += child.getMeasuredHeight() +
(withPadding ? child.getPaddingTop() + child.getPaddingBottom() : 0) +
(withMargin ? margin : 0);
}
return Math.max(height, 0);
}
示例6: getItemsHeight
import android.view.View; //导入方法依赖的package包/类
/**
* 获取指定区域item的高度
**/
public int getItemsHeight(int start, int end) {
int height = 0;
if (start > end || end > datas.size() - 1) {
return height;
}
start = start < 0 ? 0 : start;
RecyclerView.LayoutManager layoutManager = mListFragment.getLayoutManager();
for (int i = start; i <= end; i++) {
View item = layoutManager.findViewByPosition(i);
if (item != null) {
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) item.getLayoutParams();
height += item.getHeight() + item.getPaddingBottom() + item.getPaddingTop() + layoutParams.topMargin + layoutParams.bottomMargin /*item.getBottom() - item.getTop()*/;
/*int desiredWidth = View.MeasureSpec.makeMeasureSpec(item.getWidth(), View.MeasureSpec.AT_MOST);
item.measure(desiredWidth, 0); // 计算子项View 的宽高
height += item.getMeasuredHeight();*/
}
}
return height;
}
示例7: standUp
import android.view.View; //导入方法依赖的package包/类
/**
* @return the animation builder
*/
public AnimationBuilder standUp() {
for (View view : views) {
float x = (view.getWidth() - view.getPaddingLeft() - view.getPaddingRight()) / 2
+ view.getPaddingLeft();
float y = view.getHeight() - view.getPaddingBottom();
pivotX(x, x, x, x, x);
pivotY(y, y, y, y, y);
rotationX(55, -30, 15, -15, 0);
}
return this;
}
示例8: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
public void prepare(View target) {
float x = (target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()) / 2
+ target.getPaddingLeft();
float y = target.getHeight() - target.getPaddingBottom();
getAnimatorAgent().playTogether(
ObjectAnimator.ofFloat(target, "rotation", 12, -12, 3, -3, 0),
ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y)
);
}
示例9: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
float x = target.getPaddingLeft();
float y = target.getHeight() - target.getPaddingBottom();
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "alpha", 1, 0),
ObjectAnimator.ofFloat(target, "rotation", 0, 90),
ObjectAnimator.ofFloat(target, "pivotX", x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y)
);
}
示例10: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
public void prepare(View target) {
float x = target.getPaddingLeft();
float y = target.getHeight() - target.getPaddingBottom();
getAnimatorAgent().playTogether(
ObjectAnimator.ofFloat(target, "alpha", 1, 0),
ObjectAnimator.ofFloat(target, "rotation", 0, 90),
ObjectAnimator.ofFloat(target, "pivotX", x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y)
);
}
示例11: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
public void prepare(View target) {
float x = (target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()) / 2
+ target.getPaddingLeft();
float y = target.getHeight() - target.getPaddingBottom();
getAnimatorAgent().playTogether(
ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y),
ObjectAnimator.ofFloat(target, "rotationX", 55, -30, 15, -15, 0)
);
}
示例12: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
public void prepare(View target) {
float x = target.getWidth() - target.getPaddingRight();
float y = target.getHeight() - target.getPaddingBottom();
getAnimatorAgent().playTogether(
ObjectAnimator.ofFloat(target, "rotation", -90, 0),
ObjectAnimator.ofFloat(target, "alpha", 0, 1),
ObjectAnimator.ofFloat(target, "pivotX", x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y)
);
}
示例13: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
float x = target.getWidth() - target.getPaddingRight();
float y = target.getHeight() - target.getPaddingBottom();
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "rotation", 90, 0),
ObjectAnimator.ofFloat(target, "alpha", 0, 1),
ObjectAnimator.ofFloat(target, "pivotX", x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y)
);
}
示例14: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
float x = target.getPaddingLeft();
float y = target.getHeight() - target.getPaddingBottom();
animatorSet.playTogether(
ObjectAnimator.ofFloat(target, "rotation", -90, 0),
ObjectAnimator.ofFloat(target, "alpha", 0, 1),
ObjectAnimator.ofFloat(target, "pivotX", x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y)
);
}
示例15: prepare
import android.view.View; //导入方法依赖的package包/类
@Override
public void prepare(View target) {
float x = target.getWidth() - target.getPaddingRight();
float y = target.getHeight() - target.getPaddingBottom();
getAnimatorAgent().playTogether(
ObjectAnimator.ofFloat(target, "alpha", 1, 0),
ObjectAnimator.ofFloat(target, "rotation", 0, 90),
ObjectAnimator.ofFloat(target, "pivotX", x, x),
ObjectAnimator.ofFloat(target, "pivotY", y, y)
);
}