当前位置: 首页>>代码示例>>Java>>正文


Java View.getPaddingLeft方法代码示例

本文整理汇总了Java中android.view.View.getPaddingLeft方法的典型用法代码示例。如果您正苦于以下问题:Java View.getPaddingLeft方法的具体用法?Java View.getPaddingLeft怎么用?Java View.getPaddingLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.getPaddingLeft方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showMoreKeysPanel

import android.view.View; //导入方法依赖的package包/类
@Override
public void showMoreKeysPanel(final View parentView, final Controller controller,
        final int pointX, final int pointY, final KeyboardActionListener listener) {
    mController = controller;
    mListener = listener;
    final View container = getContainerView();
    // The coordinates of panel's left-top corner in parentView's coordinate system.
    // We need to consider background drawable paddings.
    final int x = pointX - getDefaultCoordX() - container.getPaddingLeft() - getPaddingLeft();
    final int y = pointY - container.getMeasuredHeight() + container.getPaddingBottom()
            + getPaddingBottom();

    parentView.getLocationInWindow(mCoordinates);
    // Ensure the horizontal position of the panel does not extend past the parentView edges.
    final int maxX = parentView.getMeasuredWidth() - container.getMeasuredWidth();
    final int panelX = Math.max(0, Math.min(maxX, x)) + CoordinateUtils.x(mCoordinates);
    final int panelY = y + CoordinateUtils.y(mCoordinates);
    container.setX(panelX);
    container.setY(panelY);

    mOriginX = x + container.getPaddingLeft();
    mOriginY = y + container.getPaddingTop();
    controller.onShowMoreKeysPanel(this);
}
 
开发者ID:rkkr,项目名称:simple-keyboard,代码行数:25,代码来源:MoreKeysKeyboardView.java

示例2: 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);
    }
}
 
开发者ID:qianxinyi,项目名称:DripUltraRefreshWithLoad,代码行数:20,代码来源:SmartViewHolder.java

示例3: standUp

import android.view.View; //导入方法依赖的package包/类
public AnimationBuilder standUp() {
    for (View view : this.views) {
        float x = (float) ((((view.getWidth() - view.getPaddingLeft()) - view.getPaddingRight
                ()) / 2) + view.getPaddingLeft());
        float y = (float) (view.getHeight() - view.getPaddingBottom());
        pivotX(x, x, x, x, x);
        pivotY(y, y, y, y, y);
        rotationX(55.0f, -30.0f, 15.0f, -15.0f, 0.0f);
    }
    return this;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:AnimationBuilder.java

示例4: onDrawOver

import android.view.View; //导入方法依赖的package包/类
/**
 * @param c
 * @param parent
 * @param state
 */
@Override
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
    if (dividerDrawable == null) {
        return;
    }

    int childCount = parent.getChildCount();
    int rightV = parent.getWidth();
    for (int i = 0; i < childCount; i++) {
        View child = parent.getChildAt(i);
        RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();

        int leftV = parent.getPaddingLeft() + child.getPaddingLeft();
        int bottomV = child.getTop() - params.topMargin;
        int topV = bottomV - dividerDrawable.getIntrinsicHeight();

        int topH = child.getTop() + params.topMargin;
        int bottomH = child.getBottom() + params.bottomMargin;
        int rightH = child.getLeft() - params.leftMargin;
        int leftH = rightH - dividerDrawable.getIntrinsicWidth();
        dividerDrawable.setBounds(leftH, topH, rightH, bottomH);
        dividerDrawable.draw(c);
        dividerDrawable.setBounds(leftV, topV, rightV, bottomV);
        dividerDrawable.draw(c);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:32,代码来源:GridItemDecoration.java

示例5: setPaddingVertical

import android.view.View; //导入方法依赖的package包/类
/**
 * Sets the top and bottom padding to the given View, keeping the horizontal padding values as the were.
 *
 * @param view    Which view to set the padding to, must not be {@code null}
 * @param padding The vertical padding value
 */
public static void setPaddingVertical(@NonNull final View view, @Px final int padding) {
    final int paddingStart = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 ? view.getPaddingStart() : view.getPaddingLeft();
    final int paddingEnd = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 ? view.getPaddingEnd() : view.getPaddingRight();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        view.setPaddingRelative(paddingStart, padding, paddingEnd, padding);
    } else {
        view.setPadding(paddingStart, padding, paddingEnd, padding);
    }
}
 
开发者ID:milosmns,项目名称:silly-android,代码行数:16,代码来源:SillyAndroid.java

示例6: 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)
    );
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:12,代码来源:RotateOutUpLeftAnimator.java

示例7: getScale

import android.view.View; //导入方法依赖的package包/类
private float getScale(float originalDrawableWidth) {
    View container = containerReference.get();
    if (container == null) {
        return 1f;
    }

    float maxWidth = container.getWidth() - container.getPaddingLeft() - container.getPaddingRight();

    if (matchParentWidth) {
        return maxWidth / originalDrawableWidth;
    } else {
        return Math.min(maxWidth, originalDrawableWidth) / originalDrawableWidth;
    }
}
 
开发者ID:mzlogin,项目名称:guanggoo-android,代码行数:15,代码来源:MyHtmlHttpImageGetter.java

示例8: prepare

import android.view.View; //导入方法依赖的package包/类
@Override
public void prepare(View target) {
    float x = target.getPaddingLeft();
    float y = target.getPaddingTop();
    getAnimatorAgent().playTogether(
            Glider.glide(Skill.SineEaseInOut, 1300, ObjectAnimator.ofFloat(target, "rotation", 0, 80, 60, 80, 60, 60)),
            ObjectAnimator.ofFloat(target, "translationY", 0, 0, 0, 0, 0, 700),
            ObjectAnimator.ofFloat(target, "alpha", 1, 1, 1, 1, 1, 0),
            ObjectAnimator.ofFloat(target, "pivotX", x, x, x, x, x, x),
            ObjectAnimator.ofFloat(target, "pivotY", y, y, y, y, y, y)
    );

    setDuration(1300);
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:15,代码来源:HingeAnimator.java

示例9: 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)
    );
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:12,代码来源:RotateOutDownLeftAnimator.java

示例10: prepare

import android.view.View; //导入方法依赖的package包/类
@Override
protected void prepare(AnimatorSet animatorSet, View target) {
    float x = (target.getWidth() - target.getPaddingLeft() - target.getPaddingRight()) / 2
            + target.getPaddingLeft();
    float y = target.getHeight() - target.getPaddingBottom();
    animatorSet.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)
    );
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:12,代码来源:WaveAnimatorDecoration.java

示例11: setGeometry

import android.view.View; //导入方法依赖的package包/类
public void setGeometry(final View previewTextView) {
    final int previewWidth = previewTextView.getMeasuredWidth();
    final int previewHeight = mPreviewHeight;
    // The width and height of visible part of the key preview background. The content marker
    // of the background 9-patch have to cover the visible part of the background.
    mVisibleWidth = previewWidth - previewTextView.getPaddingLeft()
            - previewTextView.getPaddingRight();
    mVisibleHeight = previewHeight - previewTextView.getPaddingTop()
            - previewTextView.getPaddingBottom();
    // The distance between the top edge of the parent key and the bottom of the visible part
    // of the key preview background.
    setVisibleOffset(mPreviewOffset - previewTextView.getPaddingBottom());
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:14,代码来源:KeyPreviewDrawParams.java

示例12: setItemStyle

import android.view.View; //导入方法依赖的package包/类
public static void setItemStyle(View[] viewArray, int[] bgRes, boolean keepPadding) {
	List<View> layout = new ArrayList<View>();
	for (int i = 0; i < viewArray.length; i++) {
		View v = viewArray[i];
		if (v.getVisibility() == View.VISIBLE) {
			layout.add(v);
		}
	}
	for (int i = 0, count = layout.size(); i < count; i++) {
		View view = layout.get(i);
		int l = view.getPaddingLeft();
		int t = view.getPaddingTop();
		int r = view.getPaddingRight();
		int b = view.getPaddingBottom();
		if (count == 1) {
			view.setBackgroundResource(bgRes[0]);
		} else if (count >= 2 && i == 0) {
			view.setBackgroundResource(bgRes[1]);
		} else if (count >= 2 && i == (count - 1)) {
			view.setBackgroundResource(bgRes[3]);
		} else {
			view.setBackgroundResource(bgRes[2]);
		}
		if (keepPadding) {
			view.setPadding(l, t, r, b);
		}
	}
}
 
开发者ID:liuyanggithub,项目名称:SuperSelector,代码行数:29,代码来源:Util.java

示例13: setNinePatchBackgroundResource

import android.view.View; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:14,代码来源:ViewUtils.java

示例14: getPaddingStart

import android.view.View; //导入方法依赖的package包/类
/**
 * @see android.view.View#getPaddingStart()
 */
public static int getPaddingStart(View view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        return view.getPaddingStart();
    } else {
        // Before JB MR1, all layouts are left-to-right, so start == left.
        return view.getPaddingLeft();
    }
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:12,代码来源:ApiCompatibilityUtils.java

示例15: 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;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:15,代码来源:AnimationBuilder.java


注:本文中的android.view.View.getPaddingLeft方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。