本文整理汇总了Java中android.view.ViewGroup.getPaddingRight方法的典型用法代码示例。如果您正苦于以下问题:Java ViewGroup.getPaddingRight方法的具体用法?Java ViewGroup.getPaddingRight怎么用?Java ViewGroup.getPaddingRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.ViewGroup
的用法示例。
在下文中一共展示了ViewGroup.getPaddingRight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ViewHolder
import android.view.ViewGroup; //导入方法依赖的package包/类
public ViewHolder(View itemView) {
super(itemView);
if (itemView instanceof CanMergeView) {
mCanMergeView = (CanMergeView) itemView;
} else if (itemView instanceof ViewGroup) {
ViewGroup group = (ViewGroup) itemView;
paddingLeft = group.getPaddingLeft();
paddingRight = group.getPaddingRight();
paddingTop = group.getPaddingTop();
paddingBottom = group.getPaddingBottom();
//只遍历一层 寻找第一个符合条件的view
for (int i = 0; i < group.getChildCount(); i++) {
View child = group.getChildAt(i);
if (child instanceof CanMergeView) {
mCanMergeView = (CanMergeView) child;
break;
}
}
}
}
示例2: setViewPadding
import android.view.ViewGroup; //导入方法依赖的package包/类
/**
* 调整位置Padding
* @param parent
* @param background
*/
private void setViewPadding(ViewGroup parent, int background) {
int[] rect = new int[4];
rect[0] = parent.getPaddingLeft();
rect[1] = parent.getPaddingTop();
rect[2] = parent.getPaddingRight();
rect[3] = parent.getPaddingBottom();
parent.setBackgroundResource(background);
parent.setPadding(rect[0], rect[1], rect[2], rect[3]);
}
示例3: AdjustHorizontalCenteredOutOfBounds
import android.view.ViewGroup; //导入方法依赖的package包/类
private static void AdjustHorizontalCenteredOutOfBounds(View instaBadgeView, ViewGroup rootView, Point point, Coordinates rootCoordinates) {
ViewGroup.LayoutParams params = instaBadgeView.getLayoutParams();
int rootWidth = rootView.getWidth() - rootView.getPaddingLeft() - rootView.getPaddingRight();
if (instaBadgeView.getMeasuredWidth() > rootWidth) {
point.x = rootCoordinates.left + rootView.getPaddingLeft();
params.width = rootWidth;
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
instaBadgeView.setLayoutParams(params);
measureViewWithFixedWidth(instaBadgeView, rootWidth);
}
}