android.view.View#getPaddingRight ( )源码实例Demo

下面列出了android.view.View#getPaddingRight ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: delion   文件: ChromeSwitchPreference.java
@Override
protected void onBindView(View view) {
    super.onBindView(view);

    if (mDrawDivider) {
        int left = view.getPaddingLeft();
        int right = view.getPaddingRight();
        int top = view.getPaddingTop();
        int bottom = view.getPaddingBottom();
        view.setBackground(DividerDrawable.create(getContext()));
        view.setPadding(left, top, right, bottom);
    }

    SwitchCompat switchView = (SwitchCompat) view.findViewById(R.id.switch_widget);
    // On BLU Life Play devices SwitchPreference.setWidgetLayoutResource() does nothing. As a
    // result, the user will see a non-material Switch and switchView will be null, hence the
    // null check below. http://crbug.com/451447
    if (switchView != null) {
        switchView.setChecked(isChecked());
    }

    TextView title = (TextView) view.findViewById(android.R.id.title);
    title.setSingleLine(false);
    if (!mDontUseSummaryAsTitle && TextUtils.isEmpty(getTitle())) {
        TextView summary = (TextView) view.findViewById(android.R.id.summary);
        title.setText(summary.getText());
        title.setVisibility(View.VISIBLE);
        summary.setVisibility(View.GONE);
    }

    if (mManagedPrefDelegate != null) mManagedPrefDelegate.onBindViewToPreference(this, view);
}
 
源代码2 项目: PlayTogether   文件: PaddingLeftAttr.java
@Override
protected void execute(View view, int val)
{
    int l = val;
    int t = view.getPaddingTop();
    int r = view.getPaddingRight();
    int b = view.getPaddingBottom();
    view.setPadding(l, t, r, b);

}
 
源代码3 项目: Autolayout   文件: AutoUtils.java
public static void autoPadding(View view) {

        int l = view.getPaddingLeft();
        int t = view.getPaddingTop();
        int r = view.getPaddingRight();
        int b = view.getPaddingBottom();


        l = getDisplayWidthValue(l);
        t = getDisplayHeightValue(t);
        r = getDisplayWidthValue(r);
        b = getDisplayHeightValue(b);

        view.setPadding(l, t, r, b);
    }
 
源代码4 项目: wallpaperboard   文件: ViewHelper.java
public static void resetViewBottomPadding(@Nullable View view, boolean scroll) {
    if (view == null) return;

    Context context = ContextHelper.getBaseContext(view);
    int orientation = context.getResources().getConfiguration().orientation;

    int left = view.getPaddingLeft();
    int right = view.getPaddingRight();
    int bottom = view.getPaddingTop();
    int top = view.getPaddingTop();
    int navBar = 0;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        boolean tabletMode = context.getResources().getBoolean(R.bool.android_helpers_tablet_mode);
        if (tabletMode || orientation == Configuration.ORIENTATION_PORTRAIT) {
            navBar = getNavigationBarHeight(context);
        }

        if (!scroll) {
            navBar += getStatusBarHeight(context);
        }
    }

    if (!scroll) {
        navBar += getToolbarHeight(context);
    }
    view.setPadding(left, top, right, (bottom + navBar));
}
 
源代码5 项目: PlayTogether   文件: AutoUtils.java
public static void autoPadding(View view)
{
	Object tag = view.getTag(R.id.id_tag_autolayout_padding);
	if (tag != null) return;
	view.setTag(R.id.id_tag_autolayout_padding, "Just Identify");
	int l = view.getPaddingLeft();
	int t = view.getPaddingTop();
	int r = view.getPaddingRight();
	int b = view.getPaddingBottom();
	l = getPercentWidthSize(l);
	t = getPercentHeightSize(t);
	r = getPercentWidthSize(r);
	b = getPercentHeightSize(b);
	view.setPadding(l, t, r, b);
}
 
源代码6 项目: 365browser   文件: ViewUtils.java
/**
 * Sets the background of a view to the given 9-patch resource and restores its padding. This
 * works around a bug in Android where the padding is lost when a 9-patch resource is applied
 * programmatically.
 */
public static void setNinePatchBackgroundResource(View view, @DrawableRes int resource) {
    int left = view.getPaddingLeft();
    int top = view.getPaddingTop();
    int right = view.getPaddingRight();
    int bottom = view.getPaddingBottom();
    view.setBackgroundResource(resource);
    view.setPadding(left, top, right, bottom);
}
 
@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)
    );
}
 
源代码8 项目: Dashchan   文件: AnimationUtils.java
public static void measureDynamicHeight(View view) {
	int width = view.getWidth();
	if (width <= 0) {
		View parent = (View) view.getParent();
		width = parent.getWidth() - parent.getPaddingLeft() - parent.getPaddingRight();
	}
	int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY);
	int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
	view.measure(widthMeasureSpec, heightMeasureSpec);
}
 
@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)
    );
}
 
源代码10 项目: AutoLayout   文件: PaddingTopAttr.java
@Override
protected void execute(View view, int val)
{
    int l = view.getPaddingLeft();
    int t = val;
    int r = view.getPaddingRight();
    int b = view.getPaddingBottom();
    view.setPadding(l, t, r, b);

}
 
源代码11 项目: AndroidChromium   文件: ChromeSwitchPreference.java
@Override
protected void onBindView(View view) {
    super.onBindView(view);

    if (mDrawDivider) {
        int left = view.getPaddingLeft();
        int right = view.getPaddingRight();
        int top = view.getPaddingTop();
        int bottom = view.getPaddingBottom();
        view.setBackground(DividerDrawable.create(getContext()));
        view.setPadding(left, top, right, bottom);
    }

    SwitchCompat switchView = (SwitchCompat) view.findViewById(R.id.switch_widget);
    // On BLU Life Play devices SwitchPreference.setWidgetLayoutResource() does nothing. As a
    // result, the user will see a non-material Switch and switchView will be null, hence the
    // null check below. http://crbug.com/451447
    if (switchView != null) {
        switchView.setChecked(isChecked());
    }

    TextView title = (TextView) view.findViewById(android.R.id.title);
    title.setSingleLine(false);
    if (!mDontUseSummaryAsTitle && TextUtils.isEmpty(getTitle())) {
        TextView summary = (TextView) view.findViewById(android.R.id.summary);
        title.setText(summary.getText());
        title.setVisibility(View.VISIBLE);
        summary.setVisibility(View.GONE);
    }

    if (mManagedPrefDelegate != null) mManagedPrefDelegate.onBindViewToPreference(this, view);
}
 
源代码12 项目: KUtils   文件: RotateInUpRightAnimator.java
@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 项目: UltimateAndroid   文件: WaveAnimator.java
@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)
    );
}
 
源代码14 项目: ViewAnimator   文件: AnimationBuilder.java
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;
}
 
源代码15 项目: AutoLayout   文件: PaddingLeftAttr.java
@Override
protected void execute(View view, int val)
{
    int l = val;
    int t = view.getPaddingTop();
    int r = view.getPaddingRight();
    int b = view.getPaddingBottom();
    view.setPadding(l, t, r, b);

}
 
@Override
public Float get(View object) {
    return (float) object.getPaddingRight();
}
 
源代码17 项目: Telegram-FOSS   文件: ViewHelper.java
public static int getPaddingEnd(View view) {
    return LocaleController.isRTL ? view.getPaddingLeft() : view.getPaddingRight();
}
 
源代码18 项目: letv   文件: ViewCompat.java
public int getPaddingEnd(View view) {
    return view.getPaddingRight();
}
 
源代码19 项目: CountdownView   文件: BackgroundCountdown.java
@Override
public void onMeasure(View v, int viewWidth, int viewHeight, int allContentWidth, int allContentHeight) {
    float retTopPaddingSize = initTimeTextBaselineAndTimeBgTopPadding(viewHeight, v.getPaddingTop(), v.getPaddingBottom(), allContentHeight);
    mLeftPaddingSize = v.getPaddingLeft() == v.getPaddingRight() ?  (viewWidth - allContentWidth) / 2 : v.getPaddingLeft();
    initTimeBgRect(retTopPaddingSize);
}
 
源代码20 项目: Telegram   文件: ViewHelper.java
public static int getPaddingEnd(View view) {
    return LocaleController.isRTL ? view.getPaddingLeft() : view.getPaddingRight();
}
 
 方法所在类
 同类方法